Compare commits

..

No commits in common. "tkk" and "master" have entirely different histories.
tkk ... master

250 changed files with 758 additions and 9301 deletions

View File

@ -74,6 +74,4 @@ public interface CacheKey {
*/
String PRODUCT = "PRODUCT:";
String SONG_URL = "song:";
String VIPCODE = "VIPCODE:";
}

View File

@ -23,11 +23,9 @@ import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import cn.ysk.cashier.exception.BadRequestException;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.util.IOUtils;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
@ -39,8 +37,10 @@ import java.io.*;
import java.security.MessageDigest;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* File工具类扩展 hutool 工具包
@ -270,7 +270,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
}
}
public static void downloadExcelAndMerge(ConcurrentLinkedQueue<Map<String, Object>> list, int colSize, HttpServletResponse response, List<Integer> mergeRowIndex) throws IOException {
public static void downloadExcelAndMerge(List<Map<String, Object>> list, int colSize, HttpServletResponse response, ArrayList<Integer> mergeRowIndex) throws IOException {
String tempPath = SYS_TEM_DIR + IdUtil.fastSimpleUUID() + ".xlsx";
File file = new File(tempPath);
ExcelWriter writer = ExcelUtil.getWriter(file);

View File

@ -257,15 +257,6 @@ public class RedisUtils {
}
}
public boolean setNx(String key, Object value) {
try {
return redisTemplate.opsForValue().setIfAbsent(key, value);
} catch (Exception e) {
log.error(e.getMessage(), e);
return false;
}
}
/**
* 普通缓存放入并设置时间
*

View File

@ -96,7 +96,8 @@ public class LogServiceImpl implements LogService {
String value = SpelUtil.generateKeyBySpEL(split[1], joinPoint);
// 描述
log.setDescription(split[0] + ":" + value);
} else if (split.length == 3) {
}
if (split.length == 3) {
// String v1 = SpelUtil.generateKeyBySpEL(split[1], joinPoint);
String v2 = SpelUtil.generateKeyBySpEL(split[2], joinPoint);
if (methodName.contains("createOutAndONOperate")) {

View File

@ -19,10 +19,6 @@
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<!-- 代码生成模块 -->
<dependency>

View File

@ -36,8 +36,8 @@ import org.springframework.web.bind.annotation.RestController;
@EnableAsync
@RestController
@Api(hidden = true)
@EnableTransactionManagement
@SpringBootApplication
@EnableTransactionManagement
@EnableJpaAuditing(auditorAwareRef = "auditorAware")
public class AppRun {

View File

@ -13,10 +13,6 @@ public class RabbitConfig {
public static final String EXCHANGE_STOCK_RECORD = "exchange.stock.record";
public static final String ROUTING_STOCK_RECORD_SALE = "routing.stock.record.sale";
public static final String QUEUE_STOCK_RECORD = "queue.stock.record";
public static final String ROUTING_STOCK_RECORD= "routing.stock.record";
@Bean
Queue stockRecordSaleQueue() {
return new Queue(QUEUE_STOCK_RECORD_SALE);
@ -31,14 +27,4 @@ public class RabbitConfig {
Binding binding(Queue stockRecordSaleQueue, DirectExchange stockRecordExchange) {
return BindingBuilder.bind(stockRecordSaleQueue).to(stockRecordExchange).with(ROUTING_STOCK_RECORD_SALE);
}
@Bean
Queue stockRecordSaleQueue2() {
return new Queue(QUEUE_STOCK_RECORD);
}
@Bean
Binding binding2(Queue stockRecordSaleQueue2, DirectExchange stockRecordExchange) {
return BindingBuilder.bind(stockRecordSaleQueue2).to(stockRecordExchange).with(ROUTING_STOCK_RECORD);
}
}

View File

@ -1,25 +0,0 @@
package cn.ysk.cashier.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
@Configuration//加上这个注解作用可以被Spring扫描
public class RestTemplateConfig {
@Bean
public RestTemplate restTemplate(ClientHttpRequestFactory factory){
return new RestTemplate(factory);
}
@Bean
public ClientHttpRequestFactory simpleClientHttpRequestFactory(){
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setReadTimeout(500000);//单位为ms
factory.setConnectTimeout(500000);//单位为ms
return factory;
}
}

View File

@ -43,7 +43,6 @@ import cn.ysk.cashier.config.security.service.dto.JwtUserDto;
import cn.ysk.cashier.config.security.service.OnlineUserService;
import cn.ysk.cashier.pojo.shop.TbShopInfo;
import cn.ysk.cashier.repository.shop.TbShopInfoRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
@ -233,14 +232,6 @@ public class AuthorizationController {
return ResponseEntity.ok(imgResult);
}
@ApiOperation("设置验证码")
@AnonymousGetMapping(value = "/setCode")
public ResponseEntity<Object> setCode(@RequestParam String uuid, @RequestParam String code) {
// 保存
redisUtils.set(uuid, code, loginProperties.getLoginCode().getExpiration(), TimeUnit.MINUTES);
return ResponseEntity.ok("ok");
}
@ApiOperation("退出登录")
@AnonymousDeleteMapping(value = "/logout")
public ResponseEntity<Object> logout(HttpServletRequest request) {

View File

@ -105,7 +105,6 @@ public class TokenProvider implements InitializingBean {
.getBody();
}
/**
* @param token 需要检查的token
*/
@ -138,17 +137,4 @@ public class TokenProvider implements InitializingBean {
}
return null;
}
public String getSubject() {
HttpServletRequest request = SpringContextHolder.getRequest();
final String requestHeader = request.getHeader(properties.getHeader());
if (requestHeader != null && requestHeader.startsWith(properties.getTokenStartWith())) {
Claims claims = jwtParser
.parseClaimsJws(requestHeader.substring(7))
.getBody();
return claims.getSubject();
}
return null;
}
}

View File

@ -1,40 +0,0 @@
package cn.ysk.cashier.cons;
public interface RedisConstant {
//在线用户
String ONLINE_USER = "ONLINE:USER";
String CART = "CZG:CART:";
public final Object PRODUCT = "PRODUCT:";
public final String OUT_NUMBER="ORDER:NUMBER:";
public static final String ORDER_MESSAGE="ORDER:MESSAGE:";
public static final String ORDER_PRODUCT_NUM = "ORDER_NUM:";
public static final String ORDER_CART_EXISTS = "ORDER_CART_EXISTS:";
String CURRENT_TABLE_ORDER = "CURRENT_TABLE_ORDER:";
public static String TABLE_CART = "TABLE:CART:";
String ADD_TABLE_CART_LOCK = "ADD_TABLE_CART";
String PC_OUT_NUMBER = "PC_OUT_NUMBER:";
String LOCK_KEY = "LOCK:";
String CREATE_ORDER = "CREATE_ORDER";
static String getCurrentOrderKey(String tableId, String shopId) {
return CURRENT_TABLE_ORDER + shopId + ":" + tableId;
}
static String getTableCartKey(String tableId, String shopId) {
return TABLE_CART + tableId + "-" + shopId;
}
static String getLockKey(String sign, Object... args) {
StringBuilder key = new StringBuilder(LOCK_KEY + ":" + sign + ":");
for (Object arg : args) {
key.append(":").append(arg.toString());
}
return key.toString();
}
}

View File

@ -101,12 +101,6 @@ public class TbConsInfo implements Serializable {
@ApiModelProperty(value = "消耗总量")
private BigDecimal stockConsume;
@Column(name = "`is_check`")
@ApiModelProperty(value = "是否检测库存")
private String isCheck;
public void copy(TbConsInfo source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}

View File

@ -23,7 +23,6 @@ import javax.persistence.*;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
/**
* @author admin
@ -75,11 +74,6 @@ public class ViewConInfoFlow implements Serializable {
private BigDecimal balance;
@Column(name = "`status`")
@ApiModelProperty(value = "status")
private String status;
@Column(name = "`product_id`")
@ApiModelProperty(value = "商品id")
@ -90,48 +84,6 @@ public class ViewConInfoFlow implements Serializable {
@ApiModelProperty(value = "商品名称")
private String productName;
@Column(name = "`con_code`")
@ApiModelProperty(value = "耗材代码")
private String conCode;
@Column(name = "`con_type_code`")
@ApiModelProperty(value = "耗材类型代码")
private String conTypeCode;
@Column(name = "`con_type_name`")
@ApiModelProperty(value = "耗材类型名称")
private String conTypeName;
@Column(name = "`con_unit`")
@ApiModelProperty(value = "耗材单位")
private String conUnit;
@Column(name = "`con_warning`")
@ApiModelProperty(value = "预警值")
private String conWarning;
@Column(name = "`con_type_id`")
@ApiModelProperty(value = "耗材类型名称")
private Integer conTypeId;
@Column(name = "`is_check`")
@ApiModelProperty(value = "是否检测库存")
private String isCheck;
@Column(name = "`create_time`")
@ApiModelProperty(value = "创建时间")
private Date createTime;
@Column(name = "`update_time`")
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@Column(name = "price")
@ApiModelProperty(value = "单价")
private BigDecimal price;
public void copy(ViewConInfoFlow source){

View File

@ -5,18 +5,4 @@ public interface RabbitConstants {
String CONS_COLLECT_ROUTINGKEY_PUT = "cons_collect_routingkey_put";
String CONS_MSG_COLLECT_PUT = "cons_msg_collect_put";
String CONS_MSG_COLLECT_ROUTINGKEY_PUT = "cons_msg_collect_routingkey_put";
String CART_ORDER_COLLECT_PUT = "cart_order_collect_put";
String CART_ORDER_COLLECT_ROUTINGKEY_PUT = "cart_order_collect_routingkey_put";
// 打印
String PRINT_MECHINE_COLLECT_PUT="print_mechine_collect_put";
String PRINT_MECHINE_COLLECT_QUEUE_PUT = "print_mechine_collect_queue_put";
String PRINT_MECHINE_COLLECT_ROUTINGKEY_PUT = "print_mechine_collect_routingkey_put";
// 售出记录
String EXCHANGE_STOCK_RECORD = "exchange.stock.record";
String ROUTING_STOCK_RECORD_SALE = "routing.stock.record.sale";
}

View File

@ -51,7 +51,6 @@ public class TbProskuConController {
} catch (BadRequestException be) {
throw new Exception(be.getMessage());
}catch (Exception e){
e.printStackTrace();
throw new Exception("相同商品耗材信息不允许添加");
}
}

View File

@ -77,7 +77,4 @@ public class TbConsInfoDto implements Serializable {
private String contypeCode;
private String isCheck;
}

View File

@ -68,6 +68,4 @@ public class TbConsInfoFlowDto implements Serializable {
private Integer orderId;
private String orderNo;
}

View File

@ -21,7 +21,6 @@ import lombok.Data;
import javax.persistence.Column;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
/**
* @author admin
@ -50,24 +49,4 @@ public class ViewConInfoFlowDto implements Serializable {
private String productId;
private String productName;
private String status;
private String conCode;
private String conTypeCode;
private String conTypeName;
private String conUnit;
private String conWarning;
private Integer conTypeId;
private String isCheck;
private Date createTime;
private Date updateTime;
private BigDecimal price;
}

View File

@ -18,7 +18,4 @@ public class ViewConInfoFlowQueryCriteria{
@Query
private String shopId;
@Query
private String conTypeCode;
}

View File

@ -1,7 +1,6 @@
package cn.ysk.cashier.cons.service.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.ysk.cashier.cons.domain.*;
import cn.ysk.cashier.cons.repository.TbConsInfoFlowRepository;
import cn.ysk.cashier.cons.repository.TbConsInfoRepository;
@ -82,9 +81,9 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
@Override
public List<TbConsInfoDto> queryAll(TbConsInfoQueryCriteria criteria) {
List<TbConsInfoDto> list = tbConsInfoMapper.toDto(tbConsInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder)));
if (Objects.nonNull(list) && list.size() > 0) {
list.parallelStream().forEach(it -> {
List<TbConsInfoDto> list= tbConsInfoMapper.toDto(tbConsInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder)));
if(Objects.nonNull(list)&&list.size()>0){
list.parallelStream().forEach(it->{
it.setContypeCode(tbConsTypeRepository.findById(it.getConTypeId()).orElseGet(TbConsType::new).getConTypeCode());
});
}
@ -116,31 +115,14 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
// }
resource.setConCode(StringCodeUtil.getRandom(8, LETTER_CAPITAL_NUMBER));
resource.setConCode(StringCodeUtil.getRandom(8,LETTER_CAPITAL_NUMBER));
resource.setConTypeName(tbConsType.getConTypeName());
resource.setLasterInStock(BigDecimal.ZERO);
resource.setStockNumber(BigDecimal.ZERO);
resource.setStatus("1");
resource.setStockConsume(BigDecimal.ZERO);
resource.setCreateTime(new Timestamp(System.currentTimeMillis()));
resource = tbConsInfoRepository.save(resource);
TbConsInfoFlow flow = new TbConsInfoFlow();
flow.setBizCode("stockIn");
flow.setBizName("初始化入库");
flow.setBizType("+");
flow.setConsId(resource.getId());
flow.setShopId(resource.getShopId());
flow.setConName(resource.getConName());
flow.setAmount(BigDecimal.ZERO);
flow.setBalance(BigDecimal.ZERO);
flow.setCreateTime(new Timestamp(System.currentTimeMillis()));
tbConsInfoFlowRepository.save(flow);
tbConsInfoRepository.save(resource);
}
return tbConsInfoMapper.toDto(new TbConsInfo());
}
@ -155,14 +137,12 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
throw new Exception("耗材信息不存在");
}
tbConsInfo.setConName(ObjectUtil.isEmpty(resource.getConName())||ObjectUtil.isNull(resource.getConName())?tbConsInfo.getConName():resource.getConName());
tbConsInfo.setPrice(ObjectUtil.isEmpty(resource.getPrice())||ObjectUtil.isNull(resource.getPrice())?tbConsInfo.getPrice():resource.getPrice());
tbConsInfo.setConUnit(ObjectUtil.isEmpty(resource.getConUnit())||ObjectUtil.isNull(resource.getConUnit())?tbConsInfo.getConUnit(): resource.getConUnit());
tbConsInfo.setConWarning(ObjectUtil.isEmpty(resource.getConWarning())||ObjectUtil.isNull(resource.getConWarning())?tbConsInfo.getConWarning():resource.getConWarning());
tbConsInfo.setStatus(ObjectUtil.isEmpty(resource.getStatus())||ObjectUtil.isNull(resource.getStatus())?tbConsInfo.getStatus():resource.getStatus());
tbConsInfo.setIsCheck(ObjectUtil.isEmpty(resource.getIsCheck())||ObjectUtil.isNull(resource.getIsCheck())?tbConsInfo.getIsCheck():resource.getIsCheck());
tbConsInfo.setConName(resource.getConName());
tbConsInfo.setPrice(resource.getPrice());
tbConsInfo.setConUnit(resource.getConUnit());
tbConsInfo.setConWarning(resource.getConWarning());
tbConsInfo.setStatus(resource.getStatus());
tbConsInfo.setUpdateTime(new Timestamp(System.currentTimeMillis()));
tbConsInfoRepository.save(tbConsInfo);
}
@ -184,9 +164,9 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
map.put("耗材名称", tbConsInfo.getConName());
map.put("耗材类型代码", tbConsInfo.getContypeCode());
map.put("单位", tbConsInfo.getConUnit());
map.put("价格", tbConsInfo.getPrice());
map.put("耗材预警值", tbConsInfo.getConWarning());
map.put("库存", tbConsInfo.getStockNumber().subtract(tbConsInfo.getStockConsume()));
map.put("价格",tbConsInfo.getPrice());
map.put("耗材预警值",tbConsInfo.getConWarning());
map.put("库存",tbConsInfo.getStockNumber().subtract(tbConsInfo.getStockConsume()));
list.add(map);
}
FileUtil.downloadExcel(list, response);
@ -195,7 +175,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
@Override
@Transactional(rollbackFor = Exception.class)
public void stockInOut(SuppFlow resources) throws Exception {
log.info("resources:{}", JSON.toJSONString(resources));
log.info("resources:{}",JSON.toJSONString(resources));
if (Objects.isNull(resources)) {
throw new Exception("参数错误");
}
@ -205,9 +185,9 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
throw new Exception("店铺信息不存在");
}
TbShopPurveyor purveyor = null;
TbShopPurveyor purveyor=null;
TbProductStockOperate stockOperate = new TbProductStockOperate();
if (Objects.nonNull(resources.getSupplierId())) {
if(Objects.nonNull(resources.getSupplierId())){
purveyor = tbShopPurveyorRepository.getById(resources.getSupplierId());
if (Objects.nonNull(purveyor)) {
stockOperate.setPurveyorId(resources.getSupplierId().toString());
@ -217,7 +197,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
stockOperate.setShopId(tbShopInfo.getId().toString());
stockOperate.setStockSnap("");
stockOperate.setType(resources.getType().equals("in") ? "cons_in" : "cons_out");
stockOperate.setType(resources.getType().equals("in")?"cons_in":"cons_out");
Map<String, String> operatorSnapMap = new HashMap<>();
operatorSnapMap.put("name", tbShopInfo.getShopName());
operatorSnapMap.put("account", tbShopInfo.getAccount());
@ -229,11 +209,11 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
stockOperate.setUpdatedAt(System.currentTimeMillis());
stockOperate.setStatus("normal");
JSONArray array = new JSONArray();
JSONArray array=new JSONArray();
for (SuppFlow.ConInfos conInfos : resources.getList()) {
JSONObject object = new JSONObject();
JSONObject object=new JSONObject();
TbConsInfo info = tbConsInfoRepository.getById(conInfos.getConInfold());
if (Objects.isNull(info)) {
@ -247,19 +227,19 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
TbShopPurveyorTransact purveyorTransact = new TbShopPurveyorTransact();
purveyorTransact.setShopId(tbShopInfo.getId().toString());
purveyorTransact.setPurveyorName(Objects.isNull(purveyor) ? "" : purveyor.getPurveyorName());
purveyorTransact.setPurveyorId(Objects.isNull(purveyor) ? "" : purveyor.getId().toString());
purveyorTransact.setPurveyorName(Objects.isNull(purveyor)?"":purveyor.getPurveyorName());
purveyorTransact.setPurveyorId(Objects.isNull(purveyor)?"":purveyor.getId().toString());
purveyorTransact.setRemark(resources.getRemark());
purveyorTransact.setCreatedAt(System.currentTimeMillis());
purveyorTransact.setUpdatedAt(System.currentTimeMillis());
suppFlow.setConInfoId(info.getConTypeId());
suppFlow.setShopId(resources.getShopId());
suppFlow.setSupplierId(Objects.isNull(resources.getSupplierId()) ? 0 : resources.getSupplierId());
suppFlow.setSupplierId(Objects.isNull(resources.getSupplierId())?0: resources.getSupplierId());
suppFlow.setType(resources.getType());
suppFlow.setStockNumber(conInfos.getStockNumber());
BigDecimal amount = info.getStockNumber().subtract(info.getStockConsume());
BigDecimal amount=info.getStockNumber().subtract(info.getStockConsume());
if ("in".equals(resources.getType())) {
@ -279,17 +259,19 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
purveyorTransact.setWaitAmount((resources.getAccountsPayable().subtract(resources.getActualPayment())));
purveyorTransact.setType("cons_in");
object.put("number", conInfos.getStockNumber());
} else if ("out".equals(resources.getType())) {
object.put("number",conInfos.getStockNumber());
} else if("out".equals(resources.getType())) {
stockOperate.setSubType(-1);
if (conInfos.getStockNumber().compareTo(info.getStockNumber()) > 0) {
if(conInfos.getStockNumber().compareTo(info.getStockNumber())>0){
throw new BadRequestException("出库数量大于现有的库存数量");
}
info.setStockNumber(info.getStockNumber().subtract(conInfos.getStockNumber()));
suppFlow.setBalance(info.getStockNumber().subtract(info.getStockConsume()).subtract(conInfos.getStockNumber()));
@ -302,16 +284,16 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
purveyorTransact.setWaitAmount((resources.getAccountsPayable().subtract(resources.getActualPayment())).negate());
purveyorTransact.setType("cons_out");
object.put("number", conInfos.getStockNumber());
} else {
object.put("number",conInfos.getStockNumber());
}else {
throw new BadRequestException("错误操作类型");
}
object.put("stockNumber", amount);
object.put("stockNumber",amount);
object.put("name", info.getConName());
object.put("unitName", info.getConUnit());
object.put("name",info.getConName());
object.put("unitName",info.getConUnit());
array.add(object);
suppFlow.setPrice(conInfos.getPrice());
@ -365,7 +347,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
XSSFSheet sheet = xssfWorkbook.getSheetAt(0);
XSSFRow row = null;
List<TbConsInfo> consInfos = new ArrayList<>();
List<TbConsInfo> consInfos=new ArrayList<>();
for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) {
row = sheet.getRow(i);
if (row != null) {
@ -429,7 +411,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
TbConsInfo consInfo = tbConsInfoRepository.findByConCode(cell0.toString());
if (ObjectUtil.isEmpty(consInfo) || ObjectUtil.isNull(consInfo)) {
consInfo = new TbConsInfo();
consInfo.setConCode(StringCodeUtil.getRandom(8, LETTER_CAPITAL_NUMBER));
consInfo.setConCode(StringCodeUtil.getRandom(8,LETTER_CAPITAL_NUMBER));
consInfo.setShopId(Integer.valueOf(shopId));
consInfo.setConTypeId(tbConsType.getId());
consInfo.setConTypeName(tbConsType.getConTypeName());
@ -485,7 +467,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
}
} else {
TbConsInfo consInfo = new TbConsInfo();
consInfo.setConCode(StringCodeUtil.getRandom(8, LETTER_CAPITAL_NUMBER));
consInfo.setConCode(StringCodeUtil.getRandom(8,LETTER_CAPITAL_NUMBER));
consInfo.setShopId(Integer.valueOf(shopId));
consInfo.setConTypeId(tbConsType.getId());
consInfo.setConTypeName(tbConsType.getConTypeName());
@ -521,7 +503,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
}
public static void main(String[] args) {
public static void main(String[] args){
System.out.println(UUID.randomUUID().toString());
}

View File

@ -71,8 +71,6 @@ public class TbProskuConServiceImpl implements TbProskuConService {
@Override
@Transactional(rollbackFor = Exception.class)
public TbProskuConDto create(List<ProskuInfo> resources) throws BadRequestException,Exception {
log.info("List<ProskuInfo> resources:{}",JSONUtil.toJSONString(resources));
for (ProskuInfo resource : resources) {
TbProduct product= tbProductRepository.getById(resource.getProductId());
if(Objects.isNull(product)){

View File

@ -1,46 +0,0 @@
package cn.ysk.cashier.controller;
import cn.ysk.cashier.dto.TbMiniAppPagesDto;
import cn.ysk.cashier.mybatis.service.TbMiniAppPagesService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* @author GYJ
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/miniAppPages")
public class TbMiniAppPagesController {
final private TbMiniAppPagesService tbMiniAppPagesService;
@PostMapping
@ApiOperation("新增/system/miniAppPages")
public ResponseEntity<Object> createTbMiniAppPages(@Validated @RequestBody TbMiniAppPagesDto pagesDto) {
return tbMiniAppPagesService.createTbMiniAppPages(pagesDto);
}
@PutMapping
@ApiOperation("修改/system/miniAppPages")
public ResponseEntity<Object> updateTbMiniAppPages(@Validated @RequestBody TbMiniAppPagesDto pagesDto) {
return tbMiniAppPagesService.updateTbMiniAppPages(pagesDto);
}
@DeleteMapping("/{pagesId}")
@ApiOperation("删除/system/miniAppPages")
public ResponseEntity<Object> deleteTbMiniAppPages(@PathVariable Integer pagesId) {
return tbMiniAppPagesService.deleteTbMiniAppPages(pagesId);
}
@GetMapping
@ApiOperation("查询/system/miniAppPages")
public ResponseEntity<Object> getTbMiniAppPages(@RequestParam Map<String, Object> params) {
return tbMiniAppPagesService.getTbMiniAppPages(params);
}
}

View File

@ -1,27 +0,0 @@
package cn.ysk.cashier.controller;
import cn.ysk.cashier.dto.ScanPayDTO;
import cn.ysk.cashier.service.TbPayService;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/pay")
public class TbPayController {
private final TbPayService payService;
public TbPayController(TbPayService payService) {
this.payService = payService;
}
@PostMapping("/scanPay")
public ResponseEntity<?> scanPay(
@RequestBody @Validated ScanPayDTO scanPayDTO
) {
// payService.scanPay(scanPayDTO);
return null;
}
}

View File

@ -0,0 +1,185 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.ysk.cashier.controller;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.pojo.TbUserInfo;
import cn.ysk.cashier.pojo.shop.TbMerchantAccount;
import cn.ysk.cashier.repository.TbUserInfoRepository;
import cn.ysk.cashier.repository.shop.TbMerchantAccountRepository;
import cn.ysk.cashier.service.TbUserInfoService;
import cn.ysk.cashier.dto.TbUserInfoQueryCriteria;
import cn.ysk.cashier.utils.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.io.IOException;
import java.util.Map;
import java.util.Objects;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @website https://eladmin.vip
* @author lyf
* @date 2023-11-13
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "/userInfo/list管理")
@RequestMapping("/api/tbUserInfo")
public class TbUserInfoController {
private final TbUserInfoService tbUserInfoService;
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbUserInfo:list')")
public void exportTbUserInfo(HttpServletResponse response, TbUserInfoQueryCriteria criteria) throws IOException {
tbUserInfoService.download(tbUserInfoService.queryAll(criteria), response);
}
@GetMapping
@ApiOperation("查询/userInfo/list")
public ResponseEntity<Object> queryTbUserInfo(TbUserInfoQueryCriteria criteria, Pageable pageable){
return new ResponseEntity<>(tbUserInfoService.queryAll(criteria,pageable),HttpStatus.OK);
}
@PostMapping
@ApiOperation("新增/userInfo/list")
public ResponseEntity<Object> createTbUserInfo(@Validated @RequestBody TbUserInfo resources){
return new ResponseEntity<>(tbUserInfoService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@ApiOperation("修改/userInfo/list")
public ResponseEntity<Object> updateTbUserInfo(@Validated @RequestBody TbUserInfo resources){
tbUserInfoService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@DeleteMapping
@ApiOperation("删除/userInfo/list")
public ResponseEntity<Object> deleteTbUserInfo(@RequestBody Integer[] ids) {
tbUserInfoService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
@Autowired
ValidateCodeUtil validateCodeUtil;
@Autowired
RedisUtils redisUtils;
@GetMapping("sendMsg")
public Object sendMsg(){
Object o= SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if(Objects.isNull(o)){
throw new BadRequestException("用户登录信息失效");
}
JSONObject object=JSON.parseObject(JSON.toJSONString(o));
if(Objects.isNull(object)){
throw new BadRequestException("用户登录信息失效");
}
String regex="^\\d{11}$";
if(!object.containsKey("username")||Objects.isNull(object.getString("username"))||
!object.getString("username").matches(regex)
){
throw new BadRequestException("用户登录信息失效");
}
String phone=object.getString("username");
String tempcode="SMS_244665149";
String random = StringUtil.random(6);
try {
validateCodeUtil.requestValidateCodeAli(phone, random,tempcode);
redisUtils.set(phone.concat("#").concat(tempcode),random,300L);
return "{\n" +
" \"code\": 0,\n" +
" \"msg\": \"成功\"\n" +
"}";
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
}
@Autowired
TbMerchantAccountRepository tbMerchantAccountRepository;
@RequestMapping(value = "modfiyUserInfo",method = RequestMethod.POST)
public ResponseEntity<Object> modfiyUserInfo(@RequestBody Map<String,String> map){
Object o= SecurityContextHolder.getContext().getAuthentication().getPrincipal();
if(Objects.isNull(o)){
throw new BadRequestException("用户登录信息失效");
}
JSONObject object=JSON.parseObject(JSON.toJSONString(o));
if(Objects.isNull(object)){
throw new BadRequestException("用户登录信息失效");
}
String regex="^\\d{11}$";
if(!object.containsKey("username")||Objects.isNull(object.getString("username"))||
!object.getString("username").matches(regex)
){
throw new BadRequestException("用户登录信息失效");
}
String tempcode="SMS_244665149";
String phone=object.getString("username");
Object redisCode= redisUtils.get(phone.concat("#").concat(tempcode));
if(Objects.isNull(redisCode)){
throw new BadRequestException("短信验证码已过期");
}
String code= map.get("code");
if(!redisCode.toString().equals(code)){
throw new BadRequestException("短信验证码错误");
}
redisUtils.del(phone.concat("#").concat(tempcode));
String pwd= map.get("pwd");
TbMerchantAccount account= tbMerchantAccountRepository.findByAccount(phone);
if(Objects.isNull(account)){
throw new BadRequestException("账户不存在");
}
account.setPwd(MD5Utils.md5(pwd.concat(account.getAccount()).concat(account.getId().toString())));
account.setUpdatedAt(System.currentTimeMillis());
tbMerchantAccountRepository.save(account);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
}

View File

@ -28,29 +28,18 @@ public class TbVersionController {
}
@PostMapping
@Log("版本管理 新增")
@ApiOperation("新增版本")
public ResponseEntity<Object> createTbVersion(@Validated @RequestBody TbVersion resources){
return new ResponseEntity<>(tbVersionService.create(resources),HttpStatus.CREATED);
}
@PutMapping
@Log("版本管理 修改")
@ApiOperation("修改版本")
public ResponseEntity<Object> updateTbVersion(@Validated @RequestBody TbVersion resources){
tbVersionService.update(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PutMapping("upSel")
@Log("版本管理 修改选中")
@ApiOperation("修改当前选中")
public ResponseEntity<Object> updateSel(@Validated @RequestBody TbVersion resources){
tbVersionService.updateSel(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@DeleteMapping
@ApiOperation("删除版本")
public ResponseEntity<Object> deleteTbVersion(@RequestBody Integer[] ids) {

View File

@ -42,6 +42,7 @@ public class TbOrderInfoController {
@PostMapping("/date")
@ApiOperation("查询订单")
@AnonymousPostMapping
public ResponseEntity<Object> queryTbOrderInfo(@RequestBody TbOrderInfoQueryCriteria criteria){
return new ResponseEntity<>(tbOrderInfoService.queryAllPage(criteria),HttpStatus.OK);
}

View File

@ -1,220 +0,0 @@
package cn.ysk.cashier.controller.product;
import cn.ysk.cashier.annotation.AnonymousAccess;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.cons.rabbit.RabbitConstants;
import cn.ysk.cashier.dto.shoptable.*;
import cn.ysk.cashier.pojo.order.TbCashierCart;
import cn.ysk.cashier.service.product.TbProductService;
import cn.ysk.cashier.service.shop.TbShopTableService;
import cn.ysk.cashier.utils.RabbitMsgUtils;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.Validator;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.UUID;
@RestController
@RequestMapping("/api/place")
public class TbPlaceController {
private final TbShopTableService tbShopTableService;
private final TbProductService tbProductService;
private final Validator validator;
private final RabbitMsgUtils rabbitMsgUtils;
@AnonymousAccess
@GetMapping ("/activate")
@ApiOperation("查询/product")
public ResponseEntity<Object> queryActivateTbProductInfo(
@RequestParam(defaultValue = "0") Integer page,
@RequestParam(defaultValue = "30") Integer size,
@RequestParam(required = false) Integer categoryId,
@RequestParam Integer shopId,
@RequestParam(required = false) Integer productId
){
return new ResponseEntity<>(tbProductService.activateProduct(page, size, categoryId, shopId, productId),HttpStatus.OK);
}
public TbPlaceController(TbShopTableService tbShopTableService, TbProductService tbProductService, Validator validator, RabbitTemplate rabbitTemplate, RabbitMsgUtils rabbitMsgUtils) {
this.tbShopTableService = tbShopTableService;
this.tbProductService = tbProductService;
this.validator = validator;
this.rabbitTemplate = rabbitTemplate;
this.rabbitMsgUtils = rabbitMsgUtils;
}
@AnonymousAccess
@PostMapping("/addCart")
@Log("代客下单:#addCartDTO.tableId")
@ApiOperation("代客下单/shop/table")
public ResponseEntity<TbCashierCart> addCartForUser(@Valid @RequestBody AddCartDTO addCartDTO) {
return ResponseEntity.ok(tbShopTableService.addCartForUser(addCartDTO));
}
@AnonymousAccess
@PutMapping("/updateCart")
@Log("代客下单")
@ApiOperation("代客下单/shop/table")
public ResponseEntity<TbCashierCart> updateCart(@Valid @RequestBody UpdateCartDTO updateCartDTO) {
return ResponseEntity.ok(tbShopTableService.updateCart(updateCartDTO));
}
@AnonymousAccess
@PutMapping("/pack")
@Log("代客下单")
@ApiOperation("代客下单/shop/table")
public ResponseEntity<TbCashierCart> pack(@Valid @RequestBody PackCartDTO packCartDTO) {
tbShopTableService.pack(packCartDTO);
return ResponseEntity.ok(null);
}
@AnonymousAccess
@DeleteMapping("/removeCart")
@Log("代客下单 删除购物车商品")
@ApiOperation("代客下单 清空购物车 /shop/table")
public ResponseEntity<Object> removeCart(@Validated @RequestBody RemoveCartDTO removeCartDTO) {
tbShopTableService.removeCart(removeCartDTO);
return new ResponseEntity<>(HttpStatus.OK);
}
@AnonymousAccess
@DeleteMapping("/clearCart")
@Log("代客下单 清空购物车")
@ApiOperation("代客下单 清空购物车 /shop/table"/**/)
public ResponseEntity<Object> clearCart(@Validated @RequestBody ClearCartDTO clearCartDTO) {
tbShopTableService.clearCart(clearCartDTO);
return new ResponseEntity<>(HttpStatus.OK);
}
@AnonymousAccess
@GetMapping("/cart")
@Log("代客下单 查询购物车")
@ApiOperation("代客下单 查询购物车 /shop/table")
public ResponseEntity<Object> getCart(
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size,
@RequestParam Long tableId,
@RequestParam Integer shopId,
@RequestParam(required = false) Integer vipUserId,
@RequestParam String masterId
) {
return ResponseEntity.ok(tbShopTableService.getCart(tableId, page, size, shopId, vipUserId, masterId));
}
@AnonymousAccess
@GetMapping("/pending/cart")
@Log("代客下单 查询购物车")
@ApiOperation("代客下单 查询购物车 /shop/table")
public ResponseEntity<Object> getPendingCart(
@RequestParam Integer shopId,
@RequestParam String tableId
) {
return ResponseEntity.ok(tbShopTableService.getCar(shopId, tableId));
}
@AnonymousAccess
@GetMapping("/masterId")
@Log("代客下单 查询购物车")
@ApiOperation("代客下单 ")
public ResponseEntity<Object> getMasterId(
@RequestParam Integer shopId,
@RequestParam Long tableId,
@RequestParam(required = false) Integer vipUserId
) {
return ResponseEntity.ok(tbShopTableService.getMasterId(shopId, tableId, vipUserId));
}
@AnonymousAccess
@PostMapping("/order")
@Log("代客下单 查询购物车")
@ApiOperation("代客下单 查询购物车 /shop/table")
public ResponseEntity<Object> createOrder(
@RequestBody CreateOrderDTO createOrderDTO
) {
return ResponseEntity.ok(tbShopTableService.createOrder(createOrderDTO, !createOrderDTO.isPostPay(), true));
}
@AnonymousAccess
@PostMapping("/pending")
@Log("代客下单 查询购物车")
@ApiOperation("代客下单 查询购物车 /shop/table")
public ResponseEntity<Object> pending(
@RequestBody PendingDTO pendingDTO
) {
pendingDTO.setIsPending(true);
return ResponseEntity.ok(tbShopTableService.pending(pendingDTO));
}
@AnonymousAccess
@GetMapping("/payType")
@Log("代客下单 查询购物车")
@ApiOperation("代客下单 查询购物车 /shop/table")
public ResponseEntity<Object> getPayType(
@RequestParam Integer shopId
) {
return ResponseEntity.ok(tbShopTableService.getPayType(shopId));
}
@AnonymousAccess
@DeleteMapping("/order")
@Log("代客下单 删除订单")
@ApiOperation("代客下单 查询购物车 /shop/table")
public ResponseEntity<Object> delete(
@Validated @RequestBody DeleteOrderDTO deleteOrderDTO
) {
return ResponseEntity.ok(tbShopTableService.deleteOrder(deleteOrderDTO));
}
@AnonymousAccess
@PutMapping("/pay")
@Log("代客下单 查询购物车")
@ApiOperation("代客下单 查询购物车 /shop/table")
public ResponseEntity<Object> pay(
@Validated @RequestBody PayDTO payDTO
) {
return ResponseEntity.ok(tbShopTableService.pay(payDTO));
}
@AnonymousAccess
@PutMapping("/updateVip")
@Log("代客下单 查询购物车")
@ApiOperation("代客下单 查询购物车 /shop/table")
public ResponseEntity<Object> updateVip(
@Validated @RequestBody UpdateVipDTO updateVipDTO
) {
return ResponseEntity.ok(tbShopTableService.updateVip(updateVipDTO));
}
private final RabbitTemplate rabbitTemplate;
@AnonymousAccess
@GetMapping("/test")
public void test(
@RequestParam Integer id
) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("type", "create");
jsonObject.put("orderId", id);
// rabbitTemplate.convertAndSend(RabbitConstants.CART_ORDER_COLLECT_PUT, RabbitConstants.CART_ORDER_COLLECT_ROUTINGKEY_PUT, jsonObject.toJSONString(), new CorrelationData(UUID.randomUUID().toString()));
rabbitMsgUtils.printTicket(String.valueOf(id));
// rabbitTemplate.convertAndSend(RabbitConstants.PRINT_MECHINE_COLLECT_PUT, RabbitConstants.PRINT_MECHINE_COLLECT_ROUTINGKEY_PUT, id, new CorrelationData(UUID.randomUUID().toString()));
}
}

View File

@ -1,6 +1,5 @@
package cn.ysk.cashier.controller.product;
import cn.ysk.cashier.annotation.AnonymousAccess;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.dto.product.TbProductSortCriteria;
import cn.ysk.cashier.vo.TbProductVo;
@ -33,8 +32,6 @@ public class TbProductController {
return new ResponseEntity<>(tbProductService.queryAll(criteria, false),HttpStatus.OK);
}
@GetMapping("/list")
@ApiOperation("查询/productForAdmin")
public ResponseEntity<Object> queryTbProductForAdmin(TbProductQueryCriteria criteria){
@ -52,15 +49,12 @@ public class TbProductController {
public Object queryTbProductInfo(@PathVariable("product") Integer product)throws Exception{
return tbProductService.findByProductId(product);
}
@GetMapping ("/productList")
@ApiOperation("查询/product")
public Object queryTbProductInfo(@RequestParam List<String> productList){
return tbProductService.findByProductList(productList);
}
@PostMapping("/upProSort")
@ApiOperation("修改商品排序")
public ResponseEntity<Object> upProSort(@RequestBody TbProductSortCriteria param){

View File

@ -36,12 +36,12 @@ public class TbProductGroupController {
@Resource
private TbProductService tbProductService;
// @ApiOperation("导出数据")
// @GetMapping(value = "/download")
// @PreAuthorize("@el.check('tbProductGroup:list')")
// public void exportTbProductGroup(HttpServletResponse response, TbProductGroupQueryCriteria criteria) throws IOException {
// tbProductGroupService.download(tbProductGroupService.queryAll(criteria), response);
// }
@ApiOperation("导出数据")
@GetMapping(value = "/download")
@PreAuthorize("@el.check('tbProductGroup:list')")
public void exportTbProductGroup(HttpServletResponse response, TbProductGroupQueryCriteria criteria) throws IOException {
tbProductGroupService.download(tbProductGroupService.queryAll(criteria), response);
}
@GetMapping
@ApiOperation("查询product/group")

View File

@ -1,78 +0,0 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.annotation.AnonymousAccess;
import cn.ysk.cashier.dto.shop.*;
import cn.ysk.cashier.mybatis.entity.TbShopOpenId;
import cn.ysk.cashier.pojo.shop.TbFullShopId;
import cn.ysk.cashier.service.shop.MsgService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
@RestController
@RequestMapping("/api/msg")
public class MsgController {
private final MsgService msgService;
public MsgController(MsgService msgService) {
this.msgService = msgService;
}
/**
* 获取所有订阅消息用户
* @return
*/
@AnonymousAccess
@GetMapping("/all")
public ResponseEntity<Page<TbFullShopId>> all(
@RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer size,
@RequestParam Integer shopId,
@RequestParam(required = false) String nickName,
@RequestParam(required = false) String openId,
@RequestParam(required = false) Integer state,
@RequestParam(required = false) Integer type
) {
Page<TbFullShopId> all = msgService.all(page, size, shopId, nickName, openId, state, type);
return ResponseEntity.ok(all);
}
@AnonymousAccess
@PutMapping("/shopState")
public ResponseEntity<Boolean> shopMsgState(
@Valid @RequestBody ShopMsgStateDTO shopMsgStateDTO
) {
return ResponseEntity.of(msgService.updateShopState(shopMsgStateDTO));
}
@AnonymousAccess
@DeleteMapping
public ResponseEntity<Boolean> removeSubUser(
@Valid @RequestBody ShopMsgRemoveDTO shopMsgRemoveDTO
) {
return ResponseEntity.of(msgService.removeSubUser(shopMsgRemoveDTO));
}
@AnonymousAccess
@PutMapping("/info")
public ResponseEntity<Boolean> updateInfo(
@Valid @RequestBody ShopInfoUpdateDTO shopInfoUpdateDTO
) {
return ResponseEntity.of(msgService.updateInfo(shopInfoUpdateDTO));
}
@AnonymousAccess
@GetMapping("/state")
public ResponseEntity<HashMap<String, Object>> updateInfo(
@RequestParam Integer shopId
) {
return ResponseEntity.ok(msgService.getInfo(shopId, null));
}
}

View File

@ -1,67 +0,0 @@
package cn.ysk.cashier.controller.shop;
import cn.hutool.core.map.MapProxy;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.system.enums.ParamsEnum;
import cn.ysk.cashier.system.service.ParamsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.nio.charset.Charset;
import java.util.Map;
/**
* 店铺支付相关接口
*
* @author tankaikai
* @since 2024-09-24 16:56
*/
@Slf4j
@RestController
@RequiredArgsConstructor
@Api(tags = "店铺支付相关接口")
@RequestMapping(value = {"/api/shop-pay-api", "/api/shopPayApi"})
public class ShopPayApiController {
private final ParamsService paramsService;
@GetMapping("getOrderPayUrl")
@ApiOperation("获取店铺订单支付URL")
@ApiImplicitParams({
@ApiImplicitParam(name = "orderId", value = "订单id", paramType = "query", required = true, dataType = "String"),
@ApiImplicitParam(name = "shopId", value = "店铺id", paramType = "query", required = true, dataType = "String"),
})
public ResponseEntity url(@RequestParam Map<String, Object> params) {
MapProxy mapProxy = MapProxy.create(params);
String shopId = mapProxy.getStr("shopId");
String orderId = mapProxy.getStr("orderId");
try {
if (StrUtil.isBlank(shopId)) {
throw new BadRequestException("店铺id不能为空");
}
if (StrUtil.isBlank(orderId)) {
throw new BadRequestException("订单id不能为空");
}
String baseUrl = paramsService.getValue(ParamsEnum.SHOP_ORDER_PAY_BASE_URL.name());
String buildUrl = URLUtil.buildQuery(params, Charset.defaultCharset());
String fullUrl = baseUrl.concat("?").concat(buildUrl);
return ResponseEntity.ok().body(fullUrl);
} catch (BadRequestException e) {
return ResponseEntity.badRequest().body(e.getMessage());
} catch (Exception e) {
log.error("获取店铺订单支付URL异常", e);
return ResponseEntity.ok().body("获取店铺订单支付URL异常");
}
}
}

View File

@ -1,79 +0,0 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.dto.shop.ShopPrinterDTO;
import cn.ysk.cashier.service.shop.ShopPrinterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 店铺打印机配置
*
* @author tankaikai
* @since 2024-09-24 16:56
*/
@Slf4j
@RestController
@RequiredArgsConstructor
@Api(tags = "店铺配置-打印机设置")
@RequestMapping("/api/shop-config/printer")
public class ShopPrinterController {
private final ShopPrinterService shopPrinterService;
@GetMapping("page")
@ApiOperation("分页")
public ResponseEntity page(@RequestParam Map<String, Object> params) {
Map<String, Object> page = shopPrinterService.page(params);
return ResponseEntity.ok().body(page);
}
@GetMapping("list")
@ApiOperation("列表")
public ResponseEntity list(@RequestParam Map<String, Object> params) {
List<ShopPrinterDTO> list = shopPrinterService.list(params);
return ResponseEntity.ok().body(list);
}
@GetMapping("{id}")
@ApiOperation("详情")
public ResponseEntity get(@PathVariable("id") Integer id) {
ShopPrinterDTO data = shopPrinterService.get(id);
return ResponseEntity.ok().body(data);
}
@PostMapping
@ApiOperation("保存")
public ResponseEntity save(@RequestBody ShopPrinterDTO dto) {
shopPrinterService.save(dto);
return new ResponseEntity<>(HttpStatus.OK);
}
@PutMapping
@ApiOperation("修改")
public ResponseEntity update(@RequestBody ShopPrinterDTO dto) {
shopPrinterService.update(dto);
return new ResponseEntity<>(HttpStatus.OK);
}
@DeleteMapping("{id}")
@ApiOperation("删除")
public ResponseEntity delete(@PathVariable("id") Integer id) {
shopPrinterService.delete(id);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("update-status")
@ApiOperation("停用或启用")
public ResponseEntity updateStatus(@RequestBody ShopPrinterDTO dto) {
shopPrinterService.updateStatus(dto.getId(), dto.getStatus());
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@ -1,6 +1,5 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.annotation.rest.AnonymousPostMapping;
import cn.ysk.cashier.dto.ShopSummaryDto;
import cn.ysk.cashier.service.SummaryService;
import cn.ysk.cashier.vo.TbOrderPayCountVo;
@ -42,8 +41,10 @@ public class SummaryByDayController {
}
@GetMapping(value = "count")
public List<TbOrderPayCountVo> summaryCount(ShopSummaryDto summaryDto) {
return summaryService.summaryCount(summaryDto);
public List<TbOrderPayCountVo> summaryCount(@RequestParam String shopId,
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
return summaryService.summaryCount(shopId, startTime, endTime);
}
}

View File

@ -2,10 +2,13 @@ package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.annotation.rest.AnonymousGetMapping;
import cn.ysk.cashier.annotation.rest.AnonymousPostMapping;
import cn.ysk.cashier.dto.shop.ShopTableSaleInfoDto;
import cn.ysk.cashier.dto.ShopSummaryDto;
import cn.ysk.cashier.dto.shop.ShopTableSeleInfoDto;
import cn.ysk.cashier.service.SummaryService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -63,8 +66,8 @@ public class SummaryController {
}
@PostMapping("/table/download")
private void downloadShopSummaryTable(HttpServletResponse response, @RequestBody ShopTableSaleInfoDto exportRequest) throws IOException {
summaryService.downloadTableSaleInfo(exportRequest, response);
private void downloadShopSummaryTable(HttpServletResponse response, @RequestBody ShopTableSeleInfoDto exportRequest) throws IOException {
summaryService.downloadTableSeleInfo(exportRequest, response);
}
}

View File

@ -50,8 +50,8 @@ public class TbDeviceStockController {
throw new RuntimeException("请先添加台桌");
}
if (downloadDto.getCount() > 500) {
throw new RuntimeException("最多可获取500个");
if (downloadDto.getCount() > (shopTables.size() * 2)) {
throw new RuntimeException("最多可获取台桌数量的2倍");
}
TbDeviceStock lastRecord = tbDeviceStockService.findLastRecord();

View File

@ -1,20 +1,18 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.dto.shop.TbPlussShopStaffQueryCriteria;
import cn.ysk.cashier.pojo.shop.TbPlussShopStaff;
import cn.ysk.cashier.service.shop.TbPlussShopStaffService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import cn.ysk.cashier.dto.shop.TbPlussShopStaffQueryCriteria;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.*;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
/**
* @website https://eladmin.vip
@ -88,4 +86,4 @@ public class TbPlussShopStaffController {
// log.info("修改商户密码成功。");
// return new ResponseEntity<>(HttpStatus.OK);
// }
}
}

View File

@ -1,39 +0,0 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.dto.shop.TbShopAdDto;
import cn.ysk.cashier.mybatis.service.TbShopAdService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* @author GYJ
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/ad")
public class TbShopAdController {
final private TbShopAdService tbShopAdService;
@PostMapping
public ResponseEntity<Object> createTbShopAd(@RequestBody TbShopAdDto adDto) {
return tbShopAdService.createTbShopAd(adDto);
}
@PutMapping
public ResponseEntity<Object> updateTbShopAd(@RequestBody TbShopAdDto adDto) {
return tbShopAdService.updateTbShopAd(adDto);
}
@DeleteMapping("/{adId}")
public ResponseEntity<Object> deleteTbShopAd(@PathVariable Integer adId) {
return tbShopAdService.deleteTbShopAd(adId);
}
@GetMapping
public ResponseEntity<Object> getTbShopAd(@RequestParam Map<String, Object> params) {
return tbShopAdService.getTbShopAd(params);
}
}

View File

@ -1,9 +1,12 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.annotation.rest.AnonymousDeleteMapping;
import cn.ysk.cashier.annotation.rest.AnonymousGetMapping;
import cn.ysk.cashier.annotation.rest.AnonymousPostMapping;
import cn.ysk.cashier.annotation.rest.AnonymousPutMapping;
import cn.ysk.cashier.mybatis.entity.TbShopExtend;
import cn.ysk.cashier.mybatis.service.TbShopExtendService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus;
@ -32,37 +35,38 @@ public class TbShopExtendController {
@GetMapping
@ApiOperation("分页查询")
@AnonymousGetMapping
public ResponseEntity<Object> selectAll(TbShopExtendQueryCriteria criteria) {
return new ResponseEntity<>(tbShopExtendService.queryAll(criteria), HttpStatus.OK);
}
@GetMapping("{id}")
@ApiOperation("通过Id查询详情")
@AnonymousGetMapping
public TbShopExtend selectOne(@PathVariable Serializable id) {
return tbShopExtendService.getById(id);
}
@PostMapping
@ApiOperation("新增")
@AnonymousPostMapping
public ResponseEntity<Object> insert(@RequestBody TbShopExtend tbShopExtend) {
tbShopExtend.setCreateTime(new Date());
tbShopExtendService.saveInfo(tbShopExtend);
return new ResponseEntity<>(HttpStatus.CREATED);
return new ResponseEntity<>(tbShopExtendService.save(tbShopExtend), HttpStatus.CREATED);
}
@PutMapping
@ApiOperation("通过id修改")
@AnonymousPutMapping
public ResponseEntity<Object> update(@RequestBody TbShopExtend tbShopExtend) {
if (tbShopExtend.getId() != null) {
tbShopExtendService.updateById(tbShopExtend);
} else {
tbShopExtendService.saveInfo(tbShopExtend);
}
tbShopExtend.setUpdateTime(new Date());
tbShopExtendService.updateById(tbShopExtend);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@DeleteMapping
@ApiOperation("删除")
@AnonymousDeleteMapping
public ResponseEntity<Object> delete(@RequestParam("idList") List<Long> idList) {
tbShopExtendService.removeByIds(idList);
return new ResponseEntity<>(HttpStatus.OK);

View File

@ -1,58 +0,0 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.dto.shop.TbShopPermissionDto;
import cn.ysk.cashier.service.TbShopPermissionService;
import cn.ysk.cashier.service.TbShopStaffPermissionService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequiredArgsConstructor
@Api(tags = "歌曲管理")
@RequestMapping("/api/tbShopPermission")
public class TbShopPermissionController {
private final TbShopPermissionService shopPermissionService;
private final TbShopStaffPermissionService shopStaffPermissionService;
@PostMapping()
@Log("新增店铺权限:#permissionDto.label")
public ResponseEntity<Object> insertShopPermission(@RequestBody TbShopPermissionDto permissionDto) {
return shopPermissionService.insert(permissionDto);
}
@PutMapping()
@Log("修改店铺权限:#permissionDto.label")
public ResponseEntity<Object> updateShopPermission(@RequestBody TbShopPermissionDto permissionDto) {
return shopPermissionService.update(permissionDto);
}
@DeleteMapping("/{id}")
@Log("删除店铺权限:#id")
public ResponseEntity<Object> deleteShopPermission(@PathVariable Integer id) {
return shopPermissionService.delete(id);
}
@GetMapping("/list")
public ResponseEntity<Object> getShopPermissionList() {
List<TbShopPermissionDto> permissionList = shopPermissionService.getShopPermissionList();
return ResponseEntity.ok(permissionList);
}
@GetMapping("/hasPermission")
public ResponseEntity<Object> hasPermission(Integer userId, String code) {
boolean hasPermission = shopStaffPermissionService.userHasPermission(userId, code);
return ResponseEntity.ok(hasPermission);
}
@GetMapping("/staffPermissionList")
public ResponseEntity<Object> getStaffPermissionList(Integer userId) {
return ResponseEntity.ok(shopStaffPermissionService.getStaffPermissionList(userId));
}
}

View File

@ -16,12 +16,10 @@
package cn.ysk.cashier.controller.shop;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.dto.shoptable.AddCartDTO;
import cn.ysk.cashier.dto.shoptable.ClearCartDTO;
import cn.ysk.cashier.dto.shoptable.RemoveCartDTO;
import cn.ysk.cashier.pojo.shop.TbShopTable;
import cn.ysk.cashier.service.shop.TbShopTableService;
import cn.ysk.cashier.dto.shop.TbShopTableQueryCriteria;
import org.springframework.data.domain.Pageable;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -86,7 +84,4 @@ public class TbShopTableController {
tbShopTableService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
}
}

View File

@ -8,7 +8,6 @@ import cn.ysk.cashier.dto.shop.TbShopRechargeListDto;
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.mybatis.service.TbMShopUserService;
import cn.ysk.cashier.mybatis.service.TbShopUserFlowService;
import cn.ysk.cashier.pojo.shop.TbShopUser;
import cn.ysk.cashier.service.shop.TbShopUserService;
import io.swagger.annotations.Api;
@ -22,7 +21,6 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
/**
* @author lyf
@ -38,9 +36,6 @@ public class TbShopUserController {
private final TbShopUserService tbShopUserService;
private final TbMShopUserService tbMShopUserService;
private final TbShopUserFlowService tbShopUserFlowService;
@ApiOperation("导出数据")
@GetMapping(value = "/download")
public void exportTbShopUser(HttpServletResponse response, TbShopUserQueryCriteria criteria) throws IOException {
@ -55,6 +50,7 @@ public class TbShopUserController {
@GetMapping("queryAllShopUser")
@ApiOperation("查询商家用户")
@AnonymousGetMapping
public ResponseEntity<Object> queryAllShopUser(TbShopUserQueryCriteria criteria) {
return new ResponseEntity<>(tbShopUserService.queryShopUser(criteria), HttpStatus.OK);
}
@ -100,18 +96,4 @@ public class TbShopUserController {
public void rechargeListDownload(HttpServletResponse response, @RequestBody TbShopRechargeListDto criteria) throws IOException {
tbShopUserService.rechargeListDownload(response, criteria);
}
@PostMapping("midfiyAccount")
@ApiOperation("增加扣减会员余额")
public ResponseEntity<Object> midfiyAccount(@RequestBody Map<String,Object> map){
tbShopUserService.modfiyAccount(map);
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("queryShopUserFlow")
public ResponseEntity<Object> queryShopUserFlow(@RequestParam("userId") Integer userId,@RequestParam("page") Integer page,@RequestParam("pageSize") Integer pageSize){
return new ResponseEntity<>( tbShopUserFlowService.selectByUserId(userId, page, pageSize),HttpStatus.OK);
}
}

View File

@ -1,10 +0,0 @@
package cn.ysk.cashier.dto;
import lombok.Data;
@Data
public class ScanPayDTO {
private Integer shopId;
private Integer orderId;
private String authCode;
}

View File

@ -19,9 +19,7 @@ public class ShopSummaryDto {
}
public void setCateId(String cateId) {
if(StringUtils.isNotBlank(cateId)){
this.cateId = cateId;
}
this.cateId = cateId;
}
public String getShopId() {

View File

@ -1,30 +0,0 @@
package cn.ysk.cashier.dto;
import java.util.Date;
import lombok.Data;
/**
* 活动赠送商品表(TbActivateProduct)表查询类
*
* @author ww
* @since 2024-08-20 11:27:40
*/
@Data
public class TbActivateProductQueryCriteria {
private Integer id;
//活动Id
private Integer activateId;
//商品id
private Integer productId;
//数量
private Integer num;
private Date createTime;
private Date updateTime;
private long page;
private long size;
}

View File

@ -1,22 +0,0 @@
package cn.ysk.cashier.dto;
import lombok.Data;
import java.util.Date;
/**
* @author GYJ
*/
@Data
public class TbMiniAppPagesDto {
private Integer id;
private Integer shopId;
private String name;
private String path;
private String icon;
private String description;
private Integer sort;
private Integer status;
private Date createTime;
private Date updateTime;
}

View File

@ -14,7 +14,7 @@ public class TbVersionDto implements Serializable {
private Integer id;
/** PC;APP; */
/** LDBL_APP;WX; */
private String source;
/** ios;android; */
@ -22,12 +22,9 @@ public class TbVersionDto implements Serializable {
/** 版本号 */
private String version;
/** 下载地址 */
private String url;
/** 是否强制更新 0否 1 */
/** 0不更新1更新 */
private Integer isUp;
private Integer sel;
/** 更新提示内容 */
private String message;

View File

@ -12,7 +12,7 @@ import lombok.Data;
public class TbVersionQueryCriteria{
@Query
/** PCAPP; */
/** LDBL-APP;WX; */
private String source;
@Query
/** ios;android; */
@ -21,7 +21,7 @@ public class TbVersionQueryCriteria{
/** 版本号 */
private String version;
@Query
/** 是否强制更新 0否 1*/
/** 0不更新1更新 */
private Integer isUp;
private Integer pageSize;

View File

@ -59,7 +59,4 @@ public class TbOrderDetailDto implements Serializable {
/** 打包费 */
private BigDecimal packAmount;
private Integer isVip;
}

View File

@ -70,8 +70,6 @@ public class TbOrderInfoQueryCriteria{
@Query(type = Query.Type.BETWEEN)
private List<Long> createdAt;
private Integer userId;
@Query
private String tableName;
@ -81,18 +79,4 @@ public class TbOrderInfoQueryCriteria{
public void setProductName(String productName) {
if(StringUtils.isNotBlank(productName)) this.productName = productName;
}
public Integer getPage() {
if (page == null) {
return 0;
}
return page;
}
public Integer getPageSize() {
if (pageSize == null) {
return 10;
}
return pageSize;
}
}

View File

@ -9,15 +9,12 @@ import javax.persistence.Id;
public class StockCountDTO {
private String shopId;
@Id
private Long skuId;
private Long proId;
private String proName;
private Integer isStock;
private String skuName;
private String unitName;
// 消耗数
private Integer stockCount;
// 当前库存
private Integer stockNumber;
private String specSnap;
}

View File

@ -1,6 +1,5 @@
package cn.ysk.cashier.dto.product;
import cn.ysk.cashier.annotation.Query;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
@ -12,7 +11,6 @@ public class StockQueryDto {
private Double num;
private Integer isStock;
private String categoryId;
private String sort;
public void setName(String name) {
if (StringUtils.isNotBlank(name)) {

View File

@ -1,10 +1,22 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.ysk.cashier.dto.product;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
@ -48,10 +60,4 @@ public class TbProductGroupDto implements Serializable {
private Long createdAt;
private Long updatedAt;
private Integer useTime;
private String saleStartTime;
private String saleEndTime;
}

View File

@ -1,13 +0,0 @@
package cn.ysk.cashier.dto.rabbit;
import lombok.Data;
@Data
public class StockRecordMsg {
private Integer shopId;
private Integer skuId;
private Integer productId;
private String type;
private Integer subType;
private Integer number;
}

View File

@ -1,18 +0,0 @@
package cn.ysk.cashier.dto.shop;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @author yijiegong
*/
@Data
public class ExportTableStsDataDto {
private String dateStr;
private List<Map<String, Object>> data;
private List<List<Integer>> mergeCells;
}

View File

@ -1,22 +0,0 @@
package cn.ysk.cashier.dto.shop;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
public class ShopInfoUpdateDTO {
@NotNull
private Integer shopId;
@NotNull
private String openId;
private String note;
@Range(min = 0, max = 1)
private Integer state;
private Integer type;
private String nickName;
private String avatar;
}

View File

@ -1,14 +0,0 @@
package cn.ysk.cashier.dto.shop;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
public class ShopMsgRemoveDTO {
@NotNull
private Integer shopId;
@NotBlank
private String openId;
}

View File

@ -1,15 +0,0 @@
package cn.ysk.cashier.dto.shop;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotNull;
@Data
public class ShopMsgStateDTO {
@NotNull
private Integer shopId;
@Range(min = 0, max = 1)
private Integer state;
private Integer type;
}

View File

@ -1,152 +0,0 @@
package cn.ysk.cashier.dto.shop;
import lombok.Data;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 店铺打印机配置
*
* @author tankaikai
* @since 2024-09-24 17:13
*/
@Data
public class ShopPrinterDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Integer id;
/**
* 名称
*/
private String name;
/**
* 冗余/遗留字段
*/
private String type;
/**
* 打印机类型本地打印机-local USB打印机-USB 云打印机-network
*/
private String connectionType;
/**
* 打印机编号/IP地址
*/
private String address;
/**
* 打印机密钥/端口
*/
private String port;
/**
* 打印类型 标签-label 出品-kitchen 小票-cash
*/
private String subType;
/**
* 启用状态 0-启用 1-停用
*/
private Integer status;
/**
* 店铺id
*/
private String shopId;
/**
* 冗余/遗留字段
*/
private String categoryIds;
/**
* 打印机品牌
* 云想印 = yxyPrinter
* 飞鹅 = fePrinter
* 本地 = local
* USB = printer
*/
private String contentType;
/**
* 创建时间
*/
private String createdAt;
/**
* 更新时间
*/
private String updatedAt;
/**
* 排序码 从小到大升序排列
*/
private Integer sort;
/**
* 冗余/遗留字段
*/
private String vendorId;
/**
* 冗余/遗留字段
*/
private String productId;
/**
* 冗余/遗留字段打印机个性化配置存储JSON数据
*/
private String config;
/**
* 小票尺寸 58mm 80mm
*/
private String receiptSize;
/**
* 分类打印 0-所以 1-部分分类 2-部分商品
*/
private String classifyPrint;
/**
* 桌台打印 0-所有 1-部分
*/
private String tablePrint;
/**
* 打印数量 c1m1^2=顾客+商家[2张] m1^1=商家[1张] c1^1顾客[1张] c2m1^3顾客2+商家1[3张]
*/
private String printQty;
/**
* 打印方式 1-普通 2-单个菜
*/
private String printMethod;
/**
* 打印类型JSON数组 1-确认退款单 2-交班单 3-排队取号
*/
private String printType;
/**
* 打印单据 0-全部打印 1-仅厨房 2-仅前台
*/
private String printReceipt;
public String getCreatedAt() {
if ("".equals(createdAt) || createdAt == null) {
return "";
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(new Date(Long.valueOf(createdAt)));
}
public String getUpdatedAt() {
if ("".equals(updatedAt) || updatedAt == null) {
return "";
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(new Date(Long.valueOf(updatedAt)));
}
}

View File

@ -9,7 +9,7 @@ import java.util.Date;
* @author GYJ
*/
@Data
public class ShopTableSaleInfoDto {
public class ShopTableSeleInfoDto {
private Integer shopId;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;

View File

@ -1,13 +0,0 @@
package cn.ysk.cashier.dto.shop;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class ShopTypeDTO {
@NotNull
private Integer shopId;
@NotNull
private Integer type;
}

View File

@ -1,15 +0,0 @@
package cn.ysk.cashier.dto.shop;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class ShopUserMsgState {
@NotNull
private Integer state;
@NotNull
private Integer shopId;
@NotNull
private Integer id;
}

View File

@ -16,7 +16,6 @@
package cn.ysk.cashier.dto.shop;
import lombok.Data;
import java.io.Serializable;
/**
@ -55,6 +54,4 @@ public class TbMerchantThirdApplyDto implements Serializable {
/** shopId */
private Integer shopId;
private String alipaySmallAppid;
}

View File

@ -23,7 +23,6 @@ import lombok.Data;
import javax.persistence.Column;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.List;
import java.util.Set;
/**
@ -50,8 +49,6 @@ public class TbPlussShopStaffDto implements Serializable {
/** 密码 */
private String password;
private String discountType;
/** 最大优惠金额 */
private BigDecimal maxDiscountAmount;
@ -85,6 +82,4 @@ public class TbPlussShopStaffDto implements Serializable {
private Long updatedAt;
private String type;
private List<TbShopPermissionDto> permissions;
}
}

View File

@ -1,40 +0,0 @@
package cn.ysk.cashier.dto.shop;
import cn.ysk.cashier.mybatis.entity.TbShopAd;
import lombok.Data;
import java.util.Date;
/**
* @author GYJ
*/
@Data
public class TbShopAdDto {
private Integer id;
private Integer shopId;
private String imgUrl;
private String linkPath;
private Integer borderRadius;
private String showPosition;
private String frequency;
private Integer status;
private Integer sort;
private Date createTime;
private Date updateTime;
public TbShopAd convertToTbShopAd() {
TbShopAd tbShopAd = new TbShopAd();
tbShopAd.setId(this.id);
tbShopAd.setShopId(this.shopId);
tbShopAd.setImgUrl(this.imgUrl);
tbShopAd.setLinkPath(this.linkPath);
tbShopAd.setBorderRadius(this.borderRadius);
tbShopAd.setShowPosition(this.showPosition);
tbShopAd.setFrequency(this.frequency);
tbShopAd.setStatus(this.status);
tbShopAd.setSort(this.sort);
tbShopAd.setCreateTime(this.createTime);
tbShopAd.setUpdateTime(this.updateTime);
return tbShopAd;
}
}

View File

@ -186,10 +186,4 @@ public class TbShopInfoDto implements Serializable {
private String districts;
private String cities;
private String isCustom;
private String isReturn;
private String isMemberIn;
private String isMemberReturn;
}

View File

@ -1,28 +0,0 @@
package cn.ysk.cashier.dto.shop;
import lombok.Data;
import java.util.List;
@Data
public class TbShopPermissionDto {
private Integer id;
//权限类型staff 员工
private String type;
//权限名称
private String label;
//权限code为了区分采用汉语拼音
private String code;
//层级
private Integer level;
//上级ID
private Integer parentId;
//是否重要 重要对应页面红色
private Integer isImportant;
//排序
private Integer sort;
private Integer hasPermission;
private List<TbShopPermissionDto> children;
}

View File

@ -1,28 +0,0 @@
package cn.ysk.cashier.dto.shoptable;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class AddCartDTO {
@NotEmpty
private String masterId;
private Integer vipUserId;
@NotNull
private Integer productId;
@NotNull
private Integer skuId;
@NotNull
private Integer shopId;
@NotEmpty
private String tableId;
@NotNull
@Min(0)
private Integer num;
private boolean isPack;
private boolean isGift;
private Integer cartId;
}

View File

@ -1,11 +0,0 @@
package cn.ysk.cashier.dto.shoptable;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class CarDTO {
@NotNull
private Integer shopId;
}

View File

@ -1,17 +0,0 @@
package cn.ysk.cashier.dto.shoptable;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class ClearCartDTO {
@NotEmpty
private String masterId;
private Integer vipUserId;
@NotNull
private Long tableId;
@NotNull
private String shopId;
}

View File

@ -1,20 +0,0 @@
package cn.ysk.cashier.dto.shoptable;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class CreateOrderDTO {
@NotEmpty
private String masterId;
private Integer vipUserId;
@NotNull
private Integer shopId;
@NotEmpty
private String tableId;
private String note;
private boolean postPay;
private Integer orderId;
}

View File

@ -1,9 +0,0 @@
package cn.ysk.cashier.dto.shoptable;
import lombok.Data;
@Data
public class DeleteOrderDTO {
private Integer shopId;
private Integer orderId;
}

View File

@ -1,21 +0,0 @@
package cn.ysk.cashier.dto.shoptable;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class PackCartDTO {
@NotEmpty
private String masterId;
private Integer vipUserId;
@NotNull
private Integer shopId;
@NotEmpty
private String tableId;
@NotNull
@Range(min = 0, max = 1)
private Integer state;
}

View File

@ -1,23 +0,0 @@
package cn.ysk.cashier.dto.shoptable;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class PayDTO {
@NotNull
private Integer shopId;
@NotNull
private Integer orderId;
@NotEmpty
private String payType;
@Min(0)
@Max(1)
private Double discount;
private Integer vipUserId;
private String code;
}

View File

@ -1,20 +0,0 @@
package cn.ysk.cashier.dto.shoptable;
import lombok.Data;
import org.bouncycastle.asn1.cmc.PendInfo;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class PendingDTO {
private String masterId;
@NotNull
private Integer shopId;
private String tableId;
private Integer vipUserId;
@NotNull
private Boolean isPending;
private Integer orderId;
private String note;
}

View File

@ -1,16 +0,0 @@
package cn.ysk.cashier.dto.shoptable;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class RemoveCartDTO {
@NotNull
private Integer cartId;
@NotNull
private Integer shopId;
@NotNull
private Long tableId;
}

View File

@ -1,23 +0,0 @@
package cn.ysk.cashier.dto.shoptable;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class UpdateCartDTO {
@NotNull
private Integer cartId;
@NotNull
private Integer skuId;
@NotNull
private Integer productId;
@NotNull
private Integer shopId;
@NotNull
@Min(0)
private Integer num;
}

View File

@ -1,22 +0,0 @@
package cn.ysk.cashier.dto.shoptable;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class UpdateVipDTO {
@NotNull
private Integer shopId;
@NotEmpty
private String tableId;
@NotNull
private String masterId;
private Integer vipUserId;
@NotNull
@Range(min = 0, max = 1)
private Integer type;
}

View File

@ -1,119 +0,0 @@
package cn.ysk.cashier.entity;
import java.util.Date;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
/**
* (TbShopPermission)表实体类
*
* @author makejava
* @since 2024-09-14 10:53:11
*/
@SuppressWarnings("serial")
public class TbShopPermission extends Model<TbShopPermission> {
private Integer id;
//权限类型staff 员工
private String type;
//权限名称
private String label;
//权限code为了区分采用汉语拼音
private String code;
//层级
private Integer level;
//上级ID
private Integer parentId;
//是否重要 重要对应页面红色
private Integer isImportant;
//排序
private Integer sort;
private Date createTime;
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public Integer getIsImportant() {
return isImportant;
}
public void setIsImportant(Integer isImportant) {
this.isImportant = isImportant;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -1,67 +0,0 @@
package cn.ysk.cashier.entity;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
/**
* 店铺员工权限关联表(TbShopStaffPermission)表实体类
*
* @author makejava
* @since 2024-09-14 10:54:00
*/
@SuppressWarnings("serial")
public class TbShopStaffPermission extends Model<TbShopStaffPermission> {
private Integer id;
//权限ID
private Integer permissionId;
//员工ID
private Integer staffId;
//店铺ID
private Integer shopId;
//用户ID
private Integer userId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getPermissionId() {
return permissionId;
}
public void setPermissionId(Integer permissionId) {
this.permissionId = permissionId;
}
public Integer getStaffId() {
return staffId;
}
public void setStaffId(Integer staffId) {
this.staffId = staffId;
}
public Integer getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
}

View File

@ -1,17 +0,0 @@
package cn.ysk.cashier.enums;
public enum ShopWxMsgTypeEnum {
ALL_MSG(-1),
STOCK_MSG(0),
CONSUMABLES_MSG(1),
OPERATION_MSG(2);
private final Integer type;
ShopWxMsgTypeEnum(Integer type) {
this.type = type;
}
public Integer getType() {
return type;
}
}

View File

@ -1,15 +0,0 @@
package cn.ysk.cashier.enums;
public enum TableStateEnum {
IDLE("idle"),
CLOSED("closed"), PAYING("paying"), PENDING("pending"), USING("using");
private String state = "closed";
TableStateEnum(String state) {
this.state = state;
}
public String getState() {
return state;
}
}

View File

@ -1,22 +0,0 @@
package cn.ysk.cashier.mybatis.Handler;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import java.util.Date;
@Component
public class MyMetaObjectHandler implements MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
this.strictInsertFill(metaObject, "createTime", Date.class, new Date());
}
@Override
public void updateFill(MetaObject metaObject) {
this.strictUpdateFill(metaObject, "updateTime", Date.class, new Date());
}
}

View File

@ -1,7 +1,6 @@
package cn.ysk.cashier.mybatis.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
@ -9,7 +8,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@ -24,8 +22,4 @@ public class Activate extends Model<Activate> {
private BigDecimal handselNum;
private String handselType;
private String isDel;
//是否赠送商品 0否 1是
private Integer isGiftPro;
@TableField(exist = false)
private List<TbActivateProduct> products;
}

View File

@ -2,8 +2,6 @@ package cn.ysk.cashier.mybatis.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
@ -14,7 +12,6 @@ import java.io.Serializable;
@SuppressWarnings("serial")
public class TagProductDepts extends Model<TagProductDepts> {
//标签id
@TableId(value = "tagId", type = IdType.NONE)
private Integer tagId;
//商品id
private Integer productId;

View File

@ -1,44 +0,0 @@
package cn.ysk.cashier.mybatis.entity;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
@Getter
@Setter
@Entity
@Table(name = "tb_activate")
public class TbActivate {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", nullable = false)
private Integer id;
@Column(name = "shop_id")
private Integer shopId;
@Column(name = "min_num")
private Integer minNum;
@Column(name = "max_num")
private Integer maxNum;
@Column(name = "handsel_num", precision = 10, scale = 2)
private BigDecimal handselNum;
@Size(max = 20)
@Column(name = "handsel_type", length = 20)
private String handselType;
@Size(max = 20)
@Column(name = "is_del", length = 20)
private String isDel;
@Size(max = 255)
@Column(name = "is_user")
private String isUser;
}

View File

@ -1,119 +0,0 @@
package cn.ysk.cashier.mybatis.entity;
import java.util.Date;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
/**
* 活动商品赠送表(TbActivateInRecord)表实体类
*
* @author ww
* @since 2024-08-22 14:50:16
*/
@SuppressWarnings("serial")
public class TbActivateInRecord extends Model<TbActivateInRecord> {
private Integer id;
//会员id
private Integer vipUserId;
//商品id
private Integer proId;
//赠送数量
private Integer num;
//未使用数量
private Integer overNum;
//店铺id
private Integer shopId;
//来源活动id
private Integer sourceActId;
private Integer sourceFlowId;
private Date createTime;
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getVipUserId() {
return vipUserId;
}
public void setVipUserId(Integer vipUserId) {
this.vipUserId = vipUserId;
}
public Integer getProId() {
return proId;
}
public void setProId(Integer proId) {
this.proId = proId;
}
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public Integer getOverNum() {
return overNum;
}
public void setOverNum(Integer overNum) {
this.overNum = overNum;
}
public Integer getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public Integer getSourceActId() {
return sourceActId;
}
public void setSourceActId(Integer sourceActId) {
this.sourceActId = sourceActId;
}
public Integer getSourceFlowId() {
return sourceFlowId;
}
public void setSourceFlowId(Integer sourceFlowId) {
this.sourceFlowId = sourceFlowId;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -1,109 +0,0 @@
package cn.ysk.cashier.mybatis.entity;
import java.util.Date;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
/**
* 活动赠送商品使用记录表(TbActivateOutRecord)表实体类
*
* @author ww
* @since 2024-08-22 14:53:52
*/
@SuppressWarnings("serial")
public class TbActivateOutRecord extends Model<TbActivateOutRecord> {
private Integer id;
//商品赠送Id
private Integer giveId;
//商品id
private Integer proId;
//未使用数量
private Integer useNum;
//退单量
private Integer refNum;
//订单id
private String orderId;
//新建 create 完成 closed, 取消cancel,
private String status;
private Date createTime;
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getGiveId() {
return giveId;
}
public void setGiveId(Integer giveId) {
this.giveId = giveId;
}
public Integer getProId() {
return proId;
}
public void setProId(Integer proId) {
this.proId = proId;
}
public Integer getUseNum() {
return useNum;
}
public void setUseNum(Integer useNum) {
this.useNum = useNum;
}
public Integer getRefNum() {
return refNum;
}
public void setRefNum(Integer refNum) {
this.refNum = refNum;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -1,83 +0,0 @@
package cn.ysk.cashier.mybatis.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
/**
* 活动赠送商品表(TbActivateProduct)表实体类
*
* @author ww
* @since 2024-08-20 11:27:40
*/
@SuppressWarnings("serial")
public class TbActivateProduct extends Model<TbActivateProduct> {
private Integer id;
//活动Id
private Integer activateId;
//商品id
private Integer productId;
//数量
private Integer num;
@TableField(fill = FieldFill.INSERT)
private Date createTime;
@TableField(fill = FieldFill.UPDATE)
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getActivateId() {
return activateId;
}
public void setActivateId(Integer activateId) {
this.activateId = activateId;
}
public Integer getProductId() {
return productId;
}
public void setProductId(Integer productId) {
this.productId = productId;
}
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -2,6 +2,8 @@ package cn.ysk.cashier.mybatis.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
@ -12,7 +14,7 @@ import lombok.Data;
*/
@Table(name="tb_shop_user")
@Data
public class TbShopUser implements Serializable {
public class TbMShopUser implements Serializable {
/**
* (随机)
*/
@ -80,7 +82,7 @@ public class TbShopUser implements Serializable {
private String name;
/**
*
*
*/
private String head_img;
@ -140,12 +142,12 @@ public class TbShopUser implements Serializable {
private Integer sort;
/**
*
*
*/
private Long created_at;
/**
*
*
*/
private Long updated_at;
@ -172,7 +174,7 @@ public class TbShopUser implements Serializable {
if (getClass() != that.getClass()) {
return false;
}
TbShopUser other = (TbShopUser) that;
TbMShopUser other = (TbMShopUser) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
&& (this.getCredit_amount() == null ? other.getCredit_amount() == null : this.getCredit_amount().equals(other.getCredit_amount()))
@ -279,4 +281,4 @@ public class TbShopUser implements Serializable {
sb.append("]");
return sb.toString();
}
}
}

View File

@ -1,26 +0,0 @@
package cn.ysk.cashier.mybatis.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* @author GYJ
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("tb_mini_app_pages")
public class TbMiniAppPages extends Model<TbMiniAppPages> {
private Integer id;
private String icon;
private String name;
private String path;
private String description;
private Integer status;
private Integer sort;
private Date createTime;
private Date updateTime;
}

View File

@ -1,28 +0,0 @@
package cn.ysk.cashier.mybatis.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* @author GYJ
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("tb_shop_ad")
public class TbShopAd extends Model<TbShopAd> {
private Integer id;
private Integer shopId;
private String imgUrl;
private String linkPath;
private Integer borderRadius;
private String showPosition;
private String frequency;
private Integer status;
private Integer sort;
private Date createTime;
private Date updateTime;
}

View File

@ -3,7 +3,6 @@ package cn.ysk.cashier.mybatis.entity;
import java.util.Date;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import org.apache.commons.lang3.StringUtils;
/**
@ -19,13 +18,11 @@ public class TbShopExtend extends Model<TbShopExtend> {
//商户Id
private Integer shopId;
//img:图片text:文本
private String name;
private String type;
//自定义key
private String autokey;
//
private String value;
private String detail;
//更新时间
private Date updateTime;
//创建时间
@ -56,14 +53,6 @@ public class TbShopExtend extends Model<TbShopExtend> {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAutokey() {
return autokey;
}
@ -95,51 +84,5 @@ public class TbShopExtend extends Model<TbShopExtend> {
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
/**
* index_bg店铺首页背景图
* my_bg 我的页面背景图
* member_bg会员卡页面背景图
* shopinfo_bg商品列表顶部背景图
* @param autokey
*/
public void initAutoKey(String autokey,Integer shopId) {
if (StringUtils.isBlank(name)) {
switch (autokey) {
case "index_bg":
this.name = "店铺首页背景图";
this.detail="建议尺寸: 375*600 ";
this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png";
break;
case "my_bg":
this.name = "我的页面背景图";
this.detail="建议尺寸: 375*200";
this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/myTopBack.png";
break;
case "member_bg":
this.name = "会员卡页面背景图";
this.detail="建议尺寸: 315*152";
this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/member_bg.png";
break;
case "shopinfo_bg":
this.name = "商品列表顶部背景图";
this.detail="建议尺寸: 375*120";
this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/shopDetails/topBanner.png";
break;
}
}
this.type="img";
this.shopId=shopId;
this.autokey = autokey;
}
}

View File

@ -1,34 +0,0 @@
package cn.ysk.cashier.mybatis.entity;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import java.time.Instant;
@Getter
@Setter
@Entity
@Table(name = "tb_shop_msg_state")
public class TbShopMsgState {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", nullable = false)
private Integer id;
@Column(name = "shop_id")
private Integer shopId;
@Column(name = "type")
private Integer type;
@Column(name = "state")
private Integer state;
@Column(name = "create_time")
private Instant createTime;
@Column(name = "update_time")
private Instant updateTime;
}

View File

@ -1,51 +1,59 @@
package cn.ysk.cashier.mybatis.entity;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.time.LocalDateTime;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.*;
import javax.validation.constraints.Size;
import java.time.Instant;
@Getter
@Setter
@Entity
@Table(name = "tb_shop_open_id")
public class TbShopOpenId {
/**
* 商家openid信息表
* @TableName tb_shop_open_id
*/
@Table(name="tb_shop_open_id")
@Data
@EqualsAndHashCode
public class TbShopOpenId implements Serializable {
/**
*
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", nullable = false)
private Integer id;
@Column(name = "shop_id")
/**
* 店铺id
*/
private Integer shopId;
@Size(max = 5000)
@Column(name = "open_id", length = 5000)
/**
* 已经订阅消息的商家微信号
*/
private String openId;
@Column(name = "status")
/**
*
*/
private Integer status;
@Column(name = "create_time")
private Instant createTime;
/**
*
*/
private LocalDateTime createTime;
@Column(name = "update_time")
private Instant updateTime;
/**
*
*/
private LocalDateTime updateTime;
@Column(name = "type")
/**
* 类型 -1 任意消息 0库存预警
*/
private Integer type;
@Size(max = 255)
@Column(name = "nickname")
private String nickname;
private static final long serialVersionUID = 1L;
@Size(max = 255)
@Column(name = "avatar")
private String avatar;
@Size(max = 255)
@Column(name = "note")
private String note;
}

View File

@ -1,86 +1,39 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.ysk.cashier.mybatis.entity;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.*;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;
/**
* @author admin
* @date 2024-09-02
**/
* @author GYJ
*/
@Entity
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("tb_shop_user_flow")
@Table(name="tb_shop_user_flow")
public class TbShopUserFlow implements Serializable {
public class TbShopUserFlow extends Model<TbShopUserFlow> {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "`id`")
@ApiModelProperty(value = "id")
private Integer id;
@Column(name = "`shop_user_id`")
@ApiModelProperty(value = "shopUserId")
private Integer shopUserId;
@Column(name = "`amount`")
@ApiModelProperty(value = "amount")
private BigDecimal amount;
@Column(name = "`balance`")
@ApiModelProperty(value = "balance")
private BigDecimal balance;
@Column(name = "`biz_code`")
@ApiModelProperty(value = "bizCode")
private String bizCode;
@Column(name = "`biz_name`")
@ApiModelProperty(value = "bizName")
private String bizName;
@Column(name = "`create_time`")
@ApiModelProperty(value = "createTime")
private Timestamp createTime;
private Date createTime;
@Column(name = "`type`")
@ApiModelProperty(value = "type")
private String type;
@Column(name = "`is_return`")
@ApiModelProperty(value = "是否退款 1 已退款 0 未退款")
private String isReturn;
@Column(name = "`update_time`")
@ApiModelProperty(value = "updateTime")
private Timestamp updateTime;
@Column(name = "`remark`")
@ApiModelProperty(value = "备注")
private String remark;
public void copy(TbShopUserFlow source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}
}

View File

@ -1,6 +1,7 @@
package cn.ysk.cashier.mybatis.mapper;
import cn.ysk.cashier.mybatis.entity.Activate;
import cn.ysk.cashier.mybatis.entity.TbUserStorage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface ActivateMapper extends BaseMapper<Activate> {

View File

@ -1,7 +0,0 @@
package cn.ysk.cashier.mybatis.mapper;
import cn.ysk.cashier.mybatis.entity.TbOrderPayment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface MpOrderPaymentMapper extends BaseMapper<TbOrderPayment> {
}

View File

@ -1,7 +0,0 @@
package cn.ysk.cashier.mybatis.mapper;
import cn.ysk.cashier.pojo.shop.TbShopTable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface MpShopTableMapper extends BaseMapper<TbShopTable> {
}

View File

@ -1,7 +0,0 @@
package cn.ysk.cashier.mybatis.mapper;
import cn.ysk.cashier.pojo.TbUserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface MpUserInfoMapper extends BaseMapper<TbUserInfo> {
}

View File

@ -13,24 +13,23 @@ import org.apache.ibatis.annotations.Select;
public interface ShopUserMapper extends BaseMapper<TbShopUser> {
@Select("<script>" +
"SELECT su.id as id, su.user_id as user_id, su.head_img as headImg, su.name as nickName, su.sex as sex, " +
"su.amount as amount, 0 as totalScore, su.telephone as telephone, u.last_log_in_at as lastLoginAt, " +
"su.birth_day as birthDay, su.is_vip as isVip, su.created_at as createAt " +
"SELECT su.id as id, u.head_img as headImg, u.nick_name as nickName, u.sex as sex, " +
"su.amount as amount, u.total_score as totalScore, u.telephone as telephone, " +
"u.birth_day as birthDay, su.is_vip as isVip, su.created_at as createAt, u.last_log_in_at as lastLoginAt " +
"FROM tb_shop_user su " +
"left join tb_user_info u on u.id = su.user_id " +
"LEFT JOIN tb_user_info u ON su.user_id = u.id " +
"<where> " +
"<if test='param.shopId != null and param.shopId != &quot;&quot; and param.shopId != 1'>" +
"AND su.shop_id = #{param.shopId} " +
"</if>" +
"<if test='param.name != null and param.name != &quot;&quot;'>" +
"AND (su.name like concat('%', #{param.name}, '%') or su.name LIKE concat( '%', #{param.name}, '%' ) " +
" or su.telephone like concat('%', #{param.name}, '%') or su.telephone like concat('%', #{param.name}, '%'))" +
"AND (u.nick_name like concat('%', #{param.name}, '%') or su.name LIKE concat( '%', #{param.name}, '%' ) " +
" or u.telephone like concat('%', #{param.name}, '%') or su.telephone like concat('%', #{param.name}, '%'))" +
"</if>" +
"<if test='isVip != null'>" +
"AND su.is_vip=#{isVip} " +
"AND su.is_vip=#{isVip}" +
"</if>" +
"</where>" +
"order by su.created_at" +
"</script>")
IPage<ShopUserInfoVo> queryUser(TbShopUserQueryCriteria param, Integer isVip, Page pageInfo);

Some files were not shown because too many files have changed in this diff Show More