Browse Source

修复登录通知异常,修复跳转url参数异常问题

fuyuchuan 1 week ago
parent
commit
8720bfdc13

+ 1 - 1
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/constant/constant.java

@@ -28,7 +28,7 @@ public class constant {
     // 微信公众号的消息回调地址(这儿可根据业务需求自定义动作,可选)
     public static final String WE_CHAT_CUSTOMER_CALL_URL = "https://manager.usky.cn/mobile/#/pages/common/appMessage/index?type=%s&typeName=%s&id=%s";
     public static final String WE_CHAT_CUSTOMER_CALL_URL1 = "https://manager.usky.cn/mobile/#/pages/common/appMessage/index?type=%s&id=%s";
-    public static final String WE_CHAT_CUSTOMER_CALL_URL3 = "https://manager.usky.cn/mobile/#/pages/common/appMessage/index?type=%s&typeName=%s&id=%s&oaType%s&instanceId%s";
+    public static final String WE_CHAT_CUSTOMER_CALL_URL3 = "https://manager.usky.cn/mobile/#/pages/common/appMessage/index?type=%s&typeName=%s&id=%s&oaType=%s";
     // 微信公众号的主题颜色
     public static final String WE_CHAT_TOP_COLOR = "#A349A4";
     // 微信公众号微信用户授权地址

+ 3 - 0
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/MceContentServiceImpl.java

@@ -73,6 +73,9 @@ public class MceContentServiceImpl extends AbstractCrudService<MceContentMapper,
             jsonObject1.addProperty("moduleId", mceReceiveVO.getId());
             jsonObject.addProperty("cids", cids);
             jsonObject.addProperty("title", mceReceiveVO.getInfoTitle());
+            if ("3".equals(mceReceiveVO.getInfoType())){
+                jsonObject.addProperty("content", mceReceiveVO.getInfoContent().split("-")[0]);
+            }
             jsonObject.addProperty("content", mceReceiveVO.getInfoContent());
             jsonObject.add("payload", jsonObject1);
             String resultString = HttpClientUtils.doPostJson(appUrl, jsonObject.toString());

+ 12 - 6
base-modules/service-system/service-system-biz/src/main/java/com/usky/system/service/impl/MceMbuserServiceImpl.java

@@ -76,6 +76,10 @@ public class MceMbuserServiceImpl extends AbstractCrudService<MceMbuserMapper, M
         String infoContent = requestVO.getInfoContent();
         Integer infoId = requestVO.getInfoId();
         String openId = requestVO.getOpenId();
+        String infoType = requestVO.getInfoType();
+        String infoTypeName = requestVO.getInfoTypeName();
+        String oaType = requestVO.getOaType();
+        String instanceId = requestVO.getInstanceId();
 
         // access_token时效校验,判断获取access_token获取时间是否超过有效时间,超过就调用更新,保证一直有效
         if (!redisHelper.hasKey("access_key")) {
@@ -188,20 +192,22 @@ public class MceMbuserServiceImpl extends AbstractCrudService<MceMbuserMapper, M
                 break;
         }
 
+        log.info("oaType:{}",oaType);
+        log.info("instanceId:{}",instanceId);
         // 回调地址
-        if (Objects.nonNull(requestVO.getInfoTypeName()) && "3".equals(requestVO.getInfoType())) {
-            tUrl = String.format(constant.WE_CHAT_CUSTOMER_CALL_URL3, requestVO.getInfoType(), requestVO.getInfoTypeName(), infoId, requestVO.getOaType(), requestVO.getInstanceId());
-        } else if (Objects.nonNull(requestVO.getInfoTypeName())) {
-            tUrl = String.format(constant.WE_CHAT_CUSTOMER_CALL_URL, requestVO.getInfoType(), requestVO.getInfoTypeName(), infoId);
+        if ("3".equals(requestVO.getInfoType())) {
+            tUrl = String.format(constant.WE_CHAT_CUSTOMER_CALL_URL3, infoType, infoTypeName, infoId, oaType, instanceId);
+        } else if (Objects.nonNull(infoTypeName)) {
+            tUrl = String.format(constant.WE_CHAT_CUSTOMER_CALL_URL, infoType, infoTypeName, infoId);
         } else {
-            tUrl = String.format(constant.WE_CHAT_CUSTOMER_CALL_URL1, requestVO.getInfoType(), infoId);
+            tUrl = String.format(constant.WE_CHAT_CUSTOMER_CALL_URL1, infoType, infoId);
         }
 
         String token = obj.toString();
         String requestUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + token;
         Map<String, Object> content = new HashMap<>();
         content.put("touser", openId);
-        if (StringUtils.isNotBlank(tUrl)) {
+        if (!"0".equals(requestVO.getInfoType())) {
             content.put("url", tUrl);
         }
         if (StringUtils.isNotBlank(templateId)) {