Merge remote-tracking branch 'origin/dev' into hph

This commit is contained in:
牛叉闪闪 2024-07-31 14:01:00 +08:00
commit 8a0589e384
7 changed files with 22 additions and 13 deletions

View File

@ -116,10 +116,10 @@ public class ConsMsgConsumer {
return; return;
} }
log.info("conwarning:{},stockNumber:{}",tbConsInfo.getConWarning(),tbConsInfo.getStockNumber().subtract(tbConsInfo.getStockConsume()).abs()); log.info("耗材名称: {}, conwarning:{},stockNumber:{}",tbConsInfo.getConName(),
tbConsInfo.getConWarning(),tbConsInfo.getStockNumber().subtract(tbConsInfo.getStockConsume()).abs());
if (N.egt(tbConsInfo.getConWarning(), tbConsInfo.getStockNumber().subtract(tbConsInfo.getStockConsume()).abs())) { if (N.egt(tbConsInfo.getConWarning(), tbConsInfo.getStockNumber().subtract(tbConsInfo.getStockConsume()).abs())) {
List<TbUserShopMsg> tbUserShopMsgs = tbUserShopMsgMapper.selectAllByShopId(tbConsInfo.getShopId()); List<TbUserShopMsg> tbUserShopMsgs = tbUserShopMsgMapper.selectAllByShopId(tbConsInfo.getShopId());
if (Objects.nonNull(tbUserShopMsgs) && tbUserShopMsgs.size()>0) { if (Objects.nonNull(tbUserShopMsgs) && tbUserShopMsgs.size()>0) {
tbUserShopMsgs.parallelStream().forEach(tbUserShopMsg->{ tbUserShopMsgs.parallelStream().forEach(tbUserShopMsg->{

View File

@ -386,9 +386,9 @@ public class DutyService {
redisUtil.seckill(RedisCst.PRODUCT + shopId.toString() + ":" + skuId.toString(), num.toString()); redisUtil.seckill(RedisCst.PRODUCT + shopId.toString() + ":" + skuId.toString(), num.toString());
if (ObjectUtil.isNotEmpty(tbProductSku)) { if (ObjectUtil.isNotEmpty(tbProductSku)) {
if (num > tbProductSku.getStockNumber()) { if (num > tbProductSku.getStockNumber()) {
productSkuMapper.updateStockNum(skuId,num); // productSkuMapper.updateStockNum(skuId,num);
} else { } else {
productSkuMapper.updateByskuIdSub(skuId, num); // productSkuMapper.updateByskuIdSub(skuId, num);
} }
} }
} }

View File

@ -124,6 +124,7 @@ public class LoginService {
accountMap.put("accountId", account.getId()); accountMap.put("accountId", account.getId());
accountMap.put("merchantName", account.getAccount()); accountMap.put("merchantName", account.getAccount());
accountMap.put("loginName", tbPlussShopStaff.getAccount()); accountMap.put("loginName", tbPlussShopStaff.getAccount());
accountMap.put("loginAccount",tbPlussShopStaff.getName());
accountMap.put("clientType", loginReq.getClientType()); accountMap.put("clientType", loginReq.getClientType());
accountMap.put("shopId", account.getShopId()); accountMap.put("shopId", account.getShopId());
accountMap.put("staffId", tbPlussShopStaff.getId()); accountMap.put("staffId", tbPlussShopStaff.getId());

View File

@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.service;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
@ -28,6 +29,7 @@ import java.sql.Timestamp;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import static com.chaozhanggui.system.cashierservice.sign.CodeEnum.CARTEXIST; import static com.chaozhanggui.system.cashierservice.sign.CodeEnum.CARTEXIST;
@ -569,12 +571,17 @@ public class OrderService {
jsonObject.put("type","create"); jsonObject.put("type","create");
producer.cons(jsonObject.toString()); producer.cons(jsonObject.toString());
for (TbCashierCart cashierCart : list) { List<TbCashierCart> finalList = list;
JSONObject objectMsg = new JSONObject(); ThreadUtil.execAsync(() -> {
objectMsg.put("skuId", Integer.valueOf(cashierCart.getSkuId())); ThreadUtil.sleep(5, TimeUnit.SECONDS);
objectMsg.put("shopId", Integer.valueOf(cashierCart.getShopId())); for (TbCashierCart cashierCart : finalList) {
producer.con_msg(objectMsg.toString()); JSONObject objectMsg = new JSONObject();
} objectMsg.put("skuId", Integer.valueOf(cashierCart.getSkuId()));
objectMsg.put("shopId", Integer.valueOf(cashierCart.getShopId()));
producer.con_msg(objectMsg.toString());
}
});
return Result.success(CodeEnum.SUCCESS, orderInfo); return Result.success(CodeEnum.SUCCESS, orderInfo);
} }

View File

@ -987,7 +987,7 @@ public class PayService {
//修改耗材数据 //修改耗材数据
JSONObject jsonObject1=new JSONObject(); JSONObject jsonObject1=new JSONObject();
jsonObject1.put("orderId",orderInfo.getId()); jsonObject1.put("orderId",newOrderInfo.getId());
jsonObject1.put("type","delete"); jsonObject1.put("type","delete");
producer.cons(jsonObject1.toString()); producer.cons(jsonObject1.toString());

View File

@ -115,7 +115,7 @@ public class WxAccountUtil {
try { try {
return sendTemplateMsg(msgTmpId, toUserOpenId, data); return sendTemplateMsg(msgTmpId, toUserOpenId, data);
}catch (Exception e) { }catch (Exception e) {
log.error("发送失败: {}", e.getMessage()); log.error("发送失败, openId:{}, msg: {}", toUserOpenId, e.getMessage());
return null; return null;
} }
} }

View File

@ -76,7 +76,8 @@
toi.STATUS, toi.STATUS,
toi.out_number AS outNumber, toi.out_number AS outNumber,
toi.table_name AS tableName, toi.table_name AS tableName,
toi.remark toi.remark,
toi.master_id as masterId
FROM FROM