1.避免重复消息推送

This commit is contained in:
2024-08-14 14:56:39 +08:00
parent dae3a75e0c
commit 8ea20b8394

View File

@@ -104,6 +104,11 @@ public class WxAccountUtil {
}
public JSONObject sendStockWarnMsg(String shopName, String productName, Integer stock, String toUserOpenId, ShopWxMsgTypeEnum typeEnum, Integer shopId) {
TbShopMsgState allState = shopMsgStateMapper.selectByType(ShopWxMsgTypeEnum.ALL_MSG.getType(), shopId);
if (allState == null || allState.getState().equals(0)) {
log.info("店铺未开启全局推送:{}", allState);
return null;
}
TbShopMsgState shopMsgState = shopMsgStateMapper.selectByType(typeEnum.getType(), shopId);
if (shopMsgState == null || shopMsgState.getState().equals(0)) {
log.info("店铺未开启推送:{}", shopMsgState);