Browse Source

微信通知fix

duyj 3 years ago
parent
commit
2119aec843

+ 6 - 6
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/WxController.java

@@ -25,9 +25,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
+import java.util.stream.Collectors;
 
 
 @Api(tags = "企业微信相关API", description = "提供企业微信相关的AP")
@@ -190,14 +189,14 @@ public class WxController extends ApiBaseController {
     private String getOrderFormat(String order, String customerName){
         String templeDetail = configService.selectConfigByKey("wx.notification.order.detail");
 
-        String orderFormat = null;
+        List<String> strList = new ArrayList<>();
         String[] orderArrays = order.split(",");
         for (int i = 0; i < orderArrays.length; i++) {
             String orderStr = orderArrays[i];
             String messageDetail = String.format(templeDetail, orderStr, customerName, orderStr);
-            orderFormat = order.replaceAll(orderStr, messageDetail);
+            strList.add(messageDetail);
         }
-        return orderFormat;
+        return strList.stream().collect(Collectors.joining(","));
     }
 
     @ApiOperation(value = "小吨位审批通过",
@@ -255,6 +254,7 @@ public class WxController extends ApiBaseController {
         Set<String> customerCodes = new HashSet<>();
         customerCodes.add(chain);
         logger.info("收到需要通知的经销商组织代码:"+chain);
+        logger.info("收到需要通知的经销商组织order:"+order);
         Map<String,Map<String,Object>> maps = sysUserService.selectLoginNamesByCostumerCode(customerCodes);
         //消息
         if(customerCodes.size()>0){