1.消息推送校验店铺状态

This commit is contained in:
2024-08-13 09:44:39 +08:00
parent dc291231ee
commit bee86bbb73
5 changed files with 227 additions and 3 deletions

View File

@@ -341,9 +341,9 @@ public class CartService {
shopOpenIds.forEach(item -> {
String message = redisUtil.getMessage(RedisCst.SEND_STOCK_WARN_MSG + product.getId() + ":" + item.getOpenId());
if (message == null) {
WxAccountUtil.sendStockWarnMsg("商品库存不足", product.getName(),
wxAccountUtil.sendStockWarnMsg("商品库存不足", product.getName(),
product.getIsDistribute() == 1 ? product.getStockNumber() - num : (int) (productSku.getStockNumber() - num)
, item.getOpenId());
, item.getOpenId(), ShopWxMsgTypeEnum.STOCK_MSG, shopInfo.getId());
redisUtil.saveMessage(RedisCst.SEND_STOCK_WARN_MSG + product.getId() + ":" + item.getOpenId(), product.getId().toString(), 60 * 30L);
}else {
log.info("{}已在30分钟内推送过消息跳过发送", item.getOpenId());