消息地址为空校验

This commit is contained in:
zengweihai 2024-07-26 14:18:27 +08:00
parent feaa8897b8
commit 285d72d984
1 changed files with 19 additions and 12 deletions

View File

@ -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<Map<String, Object>> requestBodyList = getRequestBodyList2(message);
log.info("推送消息通知内容:{}", requestBodyList);
Map resultMap;
for (Iterator var6 = requestBodyList.iterator(); var6.hasNext(); resultMap.get("code")) {
Map<String, Object> 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<String, Object> 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<String,Object> map) {
@ -159,7 +164,6 @@ public class MessageListen extends AbstractMessageServiceHandler {
List<Map<String, Object>> requestBodyList = getRequestBodyList3(map);
log.info("推送消息通知内容:{}", requestBodyList);
Map resultMap;
for (Iterator var6 = requestBodyList.iterator(); var6.hasNext(); resultMap.get("code")) {
Map<String, Object> 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<Long> userIds = message.getUserIds();
List<String> userMobiles = new ArrayList();