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();