Kaynağa Gözat

修改获取openlink方式

hanzhiwei 2 yıl önce
ebeveyn
işleme
e2e8c20516

+ 15 - 21
zd-modules/zd-base/src/main/java/com/zd/base/message/service/impl/WechatMsgSendServiceImpl.java

@@ -290,27 +290,21 @@ public class WechatMsgSendServiceImpl implements IWechatMsgSendService {
         String accessToken = getAccessToken();
         log.info("获取的token = {}",accessToken);
         String url = weChatProperties.getUrlScheme()+accessToken;
-        //查询是否还有缓存
-        BoundValueOperations<String, String> ops = redisTemplate.boundValueOps("URL_Scheme");
-        //缓存时长
-        if (StringUtils.isBlank(ops.get())) {
-            JSONObject body = new JSONObject();
-            JSONObject jumpWxa = new JSONObject();
-            jumpWxa.put("path","/pages/earlyWarningManage/earlyWarningDetail");
-            jumpWxa.put("query","id="+id);
-            body.put("jump_wxa", jumpWxa);
-            String respData = HttpUtil.post(url,JSON.toJSONString(body));
-            log.info("UrlScheme 返回参数=====》{}", respData);
-            JSONObject json = JSON.parseObject(respData);
-            if (json.getInteger("errcode") == 0) {
-                String openlink = json.getString("openlink");
-                ops.set(json.getString("openlink"));
-                ops.expire(7100, TimeUnit.SECONDS);
-                return openlink;
-            }
-            log.info("调用微信未生成URL_Scheme");
-            return "";
+        JSONObject body = new JSONObject();
+        JSONObject jumpWxa = new JSONObject();
+        jumpWxa.put("path","/pages/earlyWarningManage/earlyWarningDetail");
+        jumpWxa.put("query","id="+id);
+        body.put("jump_wxa", jumpWxa);
+        body.put("expire_type", "1");
+        body.put("expire_interval", "30");
+        String respData = HttpUtil.post(url,JSON.toJSONString(body));
+        log.info("UrlScheme 返回参数=====》{}", respData);
+        JSONObject json = JSON.parseObject(respData);
+        if (json.getInteger("errcode") == 0) {
+            String openlink = json.getString("openlink");
+            return openlink;
         }
-        return ops.get();
+        log.info("生成openlink失败!");
+        return "";
     }
 }

+ 1 - 1
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabMessageUserMapper.xml

@@ -283,7 +283,7 @@
     SELECT x1.* FROM (
 
      SELECT t1.* FROM (SELECT ur.`join_user_id` AS send_user_id,
-            ifnull(su.nick_name,SYSTEM) AS send_name,
+            su.nick_name AS send_name,
                 sd.dept_name AS dept_name,
                 dc.create_time AS new_message_date,
                 dc.content AS new_message,