From 285d72d984c2892b63d36572c6261266649aa1ee Mon Sep 17 00:00:00 2001 From: zengweihai Date: Fri, 26 Jul 2024 14:18:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=9C=B0=E5=9D=80=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cxkg/integration/MessageListen.java | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/shkd-cosmic-debug/src/main/java/shkd/cosmic/cxkg/integration/MessageListen.java b/shkd-cosmic-debug/src/main/java/shkd/cosmic/cxkg/integration/MessageListen.java index 938fab9..1d74ba6 100644 --- a/shkd-cosmic-debug/src/main/java/shkd/cosmic/cxkg/integration/MessageListen.java +++ b/shkd-cosmic-debug/src/main/java/shkd/cosmic/cxkg/integration/MessageListen.java @@ -22,6 +22,7 @@ import kd.bos.workflow.engine.msg.AbstractMessageServiceHandler; import kd.bos.workflow.engine.msg.ctx.MessageContext; import kd.bos.workflow.engine.msg.info.MessageInfo; import kd.bos.workflow.engine.msg.info.ToDoInfo; +import org.agrona.Strings; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; @@ -139,19 +140,23 @@ public class MessageListen extends AbstractMessageServiceHandler { List> requestBodyList = getRequestBodyList2(message); log.info("推送消息通知内容:{}", requestBodyList); - Map resultMap; - for (Iterator var6 = requestBodyList.iterator(); var6.hasNext(); resultMap.get("code")) { - Map requestBody = (Map) var6.next(); - String jsonStr = this.pushZHData(requestBody); - log.info("传阅结果 jsonStr:" + jsonStr); - resultMap = (Map) JSON.parseObject(jsonStr, Map.class); - resultMap.get("errcode"); - if ("0".equals(resultMap.get("errcode"))) { - log.info("推送已办任务内容成功"); - } else { - log.info("推送已办任务内容失败"); + if (requestBodyList != null){ + Map resultMap; + for (Iterator var6 = requestBodyList.iterator(); var6.hasNext(); resultMap.get("code")) { + Map requestBody = (Map) var6.next(); + String jsonStr = this.pushZHData(requestBody); + log.info("传阅结果 jsonStr:" + jsonStr); + resultMap = (Map) JSON.parseObject(jsonStr, Map.class); + resultMap.get("errcode"); + if ("0".equals(resultMap.get("errcode"))) { + log.info("推送已办任务内容成功"); + } else { + log.info("推送已办任务内容失败"); + } } } + + } public void sendMessage(HashMap map) { @@ -159,7 +164,6 @@ public class MessageListen extends AbstractMessageServiceHandler { List> requestBodyList = getRequestBodyList3(map); log.info("推送消息通知内容:{}", requestBodyList); - Map resultMap; for (Iterator var6 = requestBodyList.iterator(); var6.hasNext(); resultMap.get("code")) { Map requestBody = (Map) var6.next(); @@ -442,6 +446,9 @@ public class MessageListen extends AbstractMessageServiceHandler { String title = message.getTitle(); String content = message.getContent(); String url = message.getContentUrl(); + if (Strings.isEmpty(url) || "null".equals(url)){ + return null; + } // tring taskId = messageContext.get("taskId").toString(); List userIds = message.getUserIds(); List userMobiles = new ArrayList();