1.模板消息负值不推送问题修复

This commit is contained in:
2024-07-25 17:02:14 +08:00
parent 14f9f36ef5
commit 839a7fe3a6
3 changed files with 6 additions and 4 deletions

View File

@@ -97,7 +97,9 @@ public class WxAccountUtil {
throw new RuntimeException(linkedHashMap.getOrDefault(resObj.get("errcode") + "", "未知错误"));
}
public JSONObject sendStockWarnMsg(String shopName, String productName, String stock, String toUserOpenId) {
public JSONObject sendStockWarnMsg(String shopName, String productName, Integer stock, String toUserOpenId) {
stock = stock < 0 ? 0 : stock;
Integer finalStock = stock;
Map<String, Object> data = new HashMap<String, Object>() {{
put("thing22", new HashMap<String, Object>(){{
put("value", shopName);
@@ -106,7 +108,7 @@ public class WxAccountUtil {
put("value", productName);
}});
put("number5", new HashMap<String, Object>(){{
put("value", stock);
put("value", finalStock);
}});
}};
log.info("开始发送库存预警消息, 接收用户openId: {}, 消息数据: {}", toUserOpenId, data);