Просмотр исходного кода

Merge branch 'system-zyj' of uskycloud/usky-cloud into system-165

James 10 месяцев назад
Родитель
Сommit
1aa9eff7cb

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

@@ -20,7 +20,8 @@ public class constant {
     // 微信公众号推送消息模板id
     public static final String WE_CHAT_TEMPLATE_ID = "FmrNuMzgh0E8bWg1j8a2R3zTmRarHYtZ72TSzPrF9Iw";
     // 微信公众号的消息回调地址(这儿可根据业务需求自定义动作,可选)
-    public static final String WE_CHAT_CUSTOMER_CALL_URL = "https://manager.usky.cn/mobile/#/pages/common/appMessage/index?type=%s&id=%s";
+    public static final String WE_CHAT_CUSTOMER_CALL_URL = "https://manager.usky.cn/mobile/#/pages/common/appMessage/index?type=%sname=%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_TOP_COLOR = "#A349A4";
     // 微信公众号微信用户授权地址

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

@@ -27,6 +27,7 @@ import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Objects;
 
 /**
  * <p>
@@ -75,7 +76,7 @@ public class MceMbuserServiceImpl extends AbstractCrudService<MceMbuserMapper, M
     @Override
     public JSONObject sendWeChatMessage(@RequestBody SendWeChatMessageRequestVO requestVO) {
 
-        String infoType = sysDictDataService.selectDictLabel("message_type",requestVO.getInfoType());
+//        String infoTypeName = sysDictDataService.selectDictLabel("message_type",requestVO.getInfoType());
         String infoTitle = requestVO.getInfoTitle();
         String infoContent = requestVO.getInfoContent();
         Integer infoId = requestVO.getInfoId();
@@ -110,10 +111,16 @@ public class MceMbuserServiceImpl extends AbstractCrudService<MceMbuserMapper, M
         TemplateMsgEntityVO messageVo=new TemplateMsgEntityVO();
         messageVo.setTTitle(infoTitle);
         messageVo.setTKeyword1(infoContent);
-        messageVo.setTKeyword2(infoType);
         messageVo.setTKeyword3(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
         messageVo.setTRemark(infoContent);
-        messageVo.setTUrl(String.format(constant.WE_CHAT_CUSTOMER_CALL_URL,infoType,infoId));
+        if(Objects.nonNull(requestVO.getInfoTypeName())){
+            messageVo.setTUrl(String.format(constant.WE_CHAT_CUSTOMER_CALL_URL,requestVO.getInfoType(),requestVO.getInfoTypeName(),infoId));
+            messageVo.setTKeyword2(requestVO.getInfoTypeName());
+        }else{
+            messageVo.setTUrl(String.format(constant.WE_CHAT_CUSTOMER_CALL_URL1,requestVO.getInfoType(),infoId));
+            messageVo.setTKeyword2("");
+        }
+
         messageVo.setTemplateId(constant.WE_CHAT_TEMPLATE_ID);
 
         String requestUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="  + token;

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

@@ -10,7 +10,7 @@ public class SendWeChatMessageRequestVO {
     String infoType;
 
     /**
-     * 消息类型
+     * 消息类型名称
      */
     String infoTypeName;