Sfoglia il codice sorgente

fix:微信公众号提醒 拼接移动端供应商跳转路径

sbtjtserver/gw-zhaojq01 1 settimana fa
parent
commit
e974ec1b09

+ 8 - 4
nckd-fi/src/main/java/nckd/fi/er/message/SendMsgToWeChatOA.java

@@ -24,6 +24,7 @@ import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 
 import java.io.IOException;
+import java.net.URLEncoder;
 import java.util.*;
 
 /**
@@ -116,9 +117,13 @@ public class SendMsgToWeChatOA extends AbstractMessageServiceHandler {
             Map<String, String> nckdRes = getResMap(entityNumber, (String) sysCtrlParamMap.get("nckd_res"));
             //拼接移动端供应商跳转路径
             String msgUrl = "http://erp-test.jxctly.com/ierp/mobile.html?"+nckdRes.get("nckd_rescode")+bizDataId +"&accountId="+ RequestContext.get().getAccountId();
-            log.info("供应商跳转路径msgUrl:"+msgUrl);
+            //Url编码
+            String encodeUrl = URLEncoder.encode(msgUrl);
 
-            requestJson.put("url",msgUrl);
+            log.info("供应商跳转路径msgUrl:"+msgUrl+" Url编码:"+encodeUrl);
+
+            String AllUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+"&redirect_uri=" +encodeUrl+"&response_type=code&scope=snsapi_userinfo&state=wxgzh_split_"+appid+"_split_" +appsecret+"#wechat_redirect";
+            requestJson.put("url",AllUrl);
             requestJson.put("client_msg_id",id);
             //组装data参数
             JSONObject dataJson = madeJsonObject(entityNumber,bizDataId);
@@ -159,8 +164,7 @@ public class SendMsgToWeChatOA extends AbstractMessageServiceHandler {
         }else{
             throw new KDBizException("推送公众号消息失败,获取token失败!");
         }
-
-
+        log.info("-----------------------------------------"+"微信公众号发送提醒信息:" +message.getMessageContent().getLocaleValue_zh_CN()+" end--------------------------------------------------");
     }
 
     /**