1.库存预警推送更改未公众号推送

This commit is contained in:
2024-07-25 10:40:09 +08:00
parent b00dc349d6
commit 6c885ab5a1
3 changed files with 126 additions and 4 deletions

View File

@@ -64,6 +64,8 @@ public class OrderService {
@Autowired
RedisUtil redisUtil;
private final WxAccountUtil wxAccountUtil;
@Autowired
RabbitProducer producer;
@@ -79,7 +81,8 @@ public class OrderService {
@Autowired
private ProductService productService;
public OrderService(WechatUtil wechatUtil, TbUserShopMsgMapper tbUserShopMsgMapper, TbShopOpenIdMapper shopOpenIdMapper) {
public OrderService(WxAccountUtil wxAccountUtil, WechatUtil wechatUtil, TbUserShopMsgMapper tbUserShopMsgMapper, TbShopOpenIdMapper shopOpenIdMapper) {
this.wxAccountUtil = wxAccountUtil;
this.wechatUtil = wechatUtil;
this.tbUserShopMsgMapper = tbUserShopMsgMapper;
this.shopOpenIdMapper = shopOpenIdMapper;
@@ -277,9 +280,8 @@ public class OrderService {
) {
List<TbShopOpenId> shopOpenIds = shopOpenIdMapper.selectByShopId(Integer.valueOf(product.getShopId()));
shopOpenIds.forEach(item -> {
wechatUtil.sendStockWarnMsg(shopInfo.getShopName(), product.getName(),
product.getIsDistribute() == 1 ? String.valueOf(product.getStockNumber()-num) : String.valueOf(productSku.getStockNumber() - num),
"商品库存不足,请及时补充。", item.getOpenId());
wxAccountUtil.sendStockWarnMsg(shopInfo.getShopName(), product.getName(),
product.getIsDistribute() == 1 ? String.valueOf(product.getStockNumber()-num) : String.valueOf(productSku.getStockNumber() - num), item.getOpenId());
});
}
}