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

This commit is contained in:
牛叉闪闪
2024-07-15 15:28:00 +08:00

View File

@@ -119,10 +119,6 @@ public class ConsMsgConsumer {
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->{
String key=RedisCst.ORDER_MESSAGE.concat(tbConsInfo.getShopId().toString()).concat("#").concat(tbConsInfo.getId().toString()).concat("#").concat(tbUserShopMsg.getOpenId()); String key=RedisCst.ORDER_MESSAGE.concat(tbConsInfo.getShopId().toString()).concat("#").concat(tbConsInfo.getId().toString()).concat("#").concat(tbUserShopMsg.getOpenId());
String value = redisUtil.getMessage(key); String value = redisUtil.getMessage(key);
@@ -150,7 +146,7 @@ public class ConsMsgConsumer {
JSONObject thing7 = new JSONObject(); JSONObject thing7 = new JSONObject();
thing7.put("value", tbConsInfo.getStockNumber().subtract(tbConsInfo.getStockConsume()).toPlainString()); thing7.put("value", tbConsInfo.getStockNumber().subtract(tbConsInfo.getStockConsume()).setScale(2,BigDecimal.ROUND_DOWN).toPlainString());
data.put("thing1", thing1); data.put("thing1", thing1);
data.put("thing6", thing6); data.put("thing6", thing6);
@@ -163,7 +159,7 @@ public class ConsMsgConsumer {
object1.put("lang", "zh_CN"); object1.put("lang", "zh_CN");
String response = HttpRequest.post("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=".concat(accessToken)).body(object1.toString()).execute().body(); String response = HttpRequest.post("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=".concat(accessToken)).body(object1.toString()).execute().body();
log.info("openId:{},返回结果:{}",tbUserShopMsg.getOpenId(), response); log.info("openId:{},请求参数:{},返回结果:{}",tbUserShopMsg.getOpenId(),object1.toString(), response);
JSONObject resObj = JSONObject.parseObject(response); JSONObject resObj = JSONObject.parseObject(response);
if (ObjectUtil.isNotEmpty(resObj) && ObjectUtil.isNotNull(resObj) && "0".equals(String.valueOf(resObj.get("errcode")))) { if (ObjectUtil.isNotEmpty(resObj) && ObjectUtil.isNotNull(resObj) && "0".equals(String.valueOf(resObj.get("errcode")))) {
log.info("写入redis:{}",key); log.info("写入redis:{}",key);