From 11207b100143e4f45529d183e9275806dcb94a57 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Tue, 20 Aug 2024 11:53:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1227396521361408]通知策略接口报错 http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947543040/939050947543057/1227396521361408 --- .../module/tenant/api/notify/NotifyPolicyGetApi.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/neatlogic/module/tenant/api/notify/NotifyPolicyGetApi.java b/src/main/java/neatlogic/module/tenant/api/notify/NotifyPolicyGetApi.java index 5e42f72d..c5de6093 100644 --- a/src/main/java/neatlogic/module/tenant/api/notify/NotifyPolicyGetApi.java +++ b/src/main/java/neatlogic/module/tenant/api/notify/NotifyPolicyGetApi.java @@ -87,8 +87,13 @@ public class NotifyPolicyGetApi extends PrivateApiComponentBase { //TODO 没有兼容多模块 Map userTypeVoMap = UserTypeFactory.getUserTypeMap(); UserTypeVo UsertypeVo = userTypeVoMap.get("process"); - Map processUserType = UsertypeVo.getValues(); - + Map processUserType = null; + if (UsertypeVo != null) { + processUserType = UsertypeVo.getValues(); + } + if (processUserType == null) { + processUserType = new HashMap<>(); + } NotifyPolicyConfigVo config = notifyPolicyVo.getConfig(); List triggerList = config.getTriggerList(); List notifyTriggerList = notifyPolicyHandler.getNotifyTriggerList(); -- Gitee From a6c999a3424bd42b8cd7043ad7fe5280df3e64db Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Tue, 20 Aug 2024 12:09:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1227396521361408]通知策略接口报错 http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947543040/939050947543057/1227396521361408 --- .../module/tenant/api/notify/NotifyPolicyGetApi.java | 9 +++------ .../tenant/api/notify/NotifyPolicyTriggerListApi.java | 10 +++++----- .../api/notify/job/NotifyJobAuditSearchApi.java | 11 ++++++++++- .../tenant/api/notify/job/NotifyJobSearchApi.java | 11 ++++++++++- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/main/java/neatlogic/module/tenant/api/notify/NotifyPolicyGetApi.java b/src/main/java/neatlogic/module/tenant/api/notify/NotifyPolicyGetApi.java index c5de6093..b4e923b5 100644 --- a/src/main/java/neatlogic/module/tenant/api/notify/NotifyPolicyGetApi.java +++ b/src/main/java/neatlogic/module/tenant/api/notify/NotifyPolicyGetApi.java @@ -87,12 +87,9 @@ public class NotifyPolicyGetApi extends PrivateApiComponentBase { //TODO 没有兼容多模块 Map userTypeVoMap = UserTypeFactory.getUserTypeMap(); UserTypeVo UsertypeVo = userTypeVoMap.get("process"); - Map processUserType = null; - if (UsertypeVo != null) { - processUserType = UsertypeVo.getValues(); - } - if (processUserType == null) { - processUserType = new HashMap<>(); + final Map processUserType = new HashMap<>(); + if (UsertypeVo != null && UsertypeVo.getValues() != null) { + processUserType.putAll(UsertypeVo.getValues()); } NotifyPolicyConfigVo config = notifyPolicyVo.getConfig(); List triggerList = config.getTriggerList(); diff --git a/src/main/java/neatlogic/module/tenant/api/notify/NotifyPolicyTriggerListApi.java b/src/main/java/neatlogic/module/tenant/api/notify/NotifyPolicyTriggerListApi.java index bf0632c4..5cc711a8 100644 --- a/src/main/java/neatlogic/module/tenant/api/notify/NotifyPolicyTriggerListApi.java +++ b/src/main/java/neatlogic/module/tenant/api/notify/NotifyPolicyTriggerListApi.java @@ -41,10 +41,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; @Service @@ -104,7 +101,10 @@ public class NotifyPolicyTriggerListApi extends PrivateApiComponentBase { //TODO 没有兼容多模块 Map userTypeVoMap = UserTypeFactory.getUserTypeMap(); UserTypeVo UsertypeVo = userTypeVoMap.get("process"); - Map processUserType = UsertypeVo.getValues(); + final Map processUserType = new HashMap<>(); + if (UsertypeVo != null && UsertypeVo.getValues() != null) { + processUserType.putAll(UsertypeVo.getValues()); + } NotifyPolicyConfigVo config = notifyPolicyVo.getConfig(); List triggerList = config.getTriggerList(); diff --git a/src/main/java/neatlogic/module/tenant/api/notify/job/NotifyJobAuditSearchApi.java b/src/main/java/neatlogic/module/tenant/api/notify/job/NotifyJobAuditSearchApi.java index 844b548e..8def4d2d 100644 --- a/src/main/java/neatlogic/module/tenant/api/notify/job/NotifyJobAuditSearchApi.java +++ b/src/main/java/neatlogic/module/tenant/api/notify/job/NotifyJobAuditSearchApi.java @@ -20,6 +20,7 @@ import neatlogic.framework.common.util.PageUtil; import neatlogic.framework.dao.mapper.RoleMapper; import neatlogic.framework.dao.mapper.TeamMapper; import neatlogic.framework.dao.mapper.UserMapper; +import neatlogic.framework.dto.UserTypeVo; import neatlogic.framework.notify.constvalue.NotifyRecipientType; import neatlogic.framework.notify.core.INotifyContentHandler; import neatlogic.framework.notify.core.INotifyHandler; @@ -45,7 +46,9 @@ import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.HashMap; import java.util.List; +import java.util.Map; @Service @@ -127,6 +130,12 @@ public class NotifyJobAuditSearchApi extends PrivateApiComponentBase { List toList = notifyJobMapper.getToListByJobId(Long.valueOf(vo.getJobUuid())); JSONArray toArray = new JSONArray(); if(CollectionUtils.isNotEmpty(toList)){ + Map userTypeVoMap = UserTypeFactory.getUserTypeMap(); + UserTypeVo UsertypeVo = userTypeVoMap.get("process"); + final Map processUserType = new HashMap<>(); + if (UsertypeVo != null && UsertypeVo.getValues() != null) { + processUserType.putAll(UsertypeVo.getValues()); + } for(NotifyJobReceiverVo receiverVo : toList){ if(NotifyRecipientType.USER.getValue().equals(receiverVo.getType())){ toArray.add(userMapper.getUserBaseInfoByUuidWithoutCache(receiverVo.getReceiver())); @@ -146,7 +155,7 @@ public class NotifyJobAuditSearchApi extends PrivateApiComponentBase { toArray.add(new JSONObject(){ { this.put("initType",NotifyRecipientType.PROCESSUSERTYPE.getValue()); - this.put("name", UserTypeFactory.getUserTypeMap().get("process").getValues().get(receiverVo.getReceiver())); + this.put("name", processUserType.get(receiverVo.getReceiver())); } }); } diff --git a/src/main/java/neatlogic/module/tenant/api/notify/job/NotifyJobSearchApi.java b/src/main/java/neatlogic/module/tenant/api/notify/job/NotifyJobSearchApi.java index beb0775a..f80a2bd9 100644 --- a/src/main/java/neatlogic/module/tenant/api/notify/job/NotifyJobSearchApi.java +++ b/src/main/java/neatlogic/module/tenant/api/notify/job/NotifyJobSearchApi.java @@ -21,6 +21,7 @@ import neatlogic.framework.common.util.PageUtil; import neatlogic.framework.dao.mapper.RoleMapper; import neatlogic.framework.dao.mapper.TeamMapper; import neatlogic.framework.dao.mapper.UserMapper; +import neatlogic.framework.dto.UserTypeVo; import neatlogic.framework.notify.constvalue.NotifyRecipientType; import neatlogic.framework.notify.core.INotifyContentHandler; import neatlogic.framework.notify.core.INotifyHandler; @@ -45,7 +46,9 @@ import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.HashMap; import java.util.List; +import java.util.Map; @Service @@ -123,6 +126,12 @@ public class NotifyJobSearchApi extends PrivateApiComponentBase { List toList = notifyJobMapper.getToListByJobId(job.getId()); JSONArray toArray = new JSONArray(); if(CollectionUtils.isNotEmpty(toList)){ + Map userTypeVoMap = UserTypeFactory.getUserTypeMap(); + UserTypeVo UsertypeVo = userTypeVoMap.get("process"); + final Map processUserType = new HashMap<>(); + if (UsertypeVo != null && UsertypeVo.getValues() != null) { + processUserType.putAll(UsertypeVo.getValues()); + } for(NotifyJobReceiverVo receiverVo : toList){ if(NotifyRecipientType.USER.getValue().equals(receiverVo.getType())){ toArray.add(userMapper.getUserBaseInfoByUuidWithoutCache(receiverVo.getReceiver())); @@ -142,7 +151,7 @@ public class NotifyJobSearchApi extends PrivateApiComponentBase { { //TODO 没有兼容多模块 this.put("initType",NotifyRecipientType.PROCESSUSERTYPE.getValue()); - this.put("name",UserTypeFactory.getUserTypeMap().get("process").getValues().get(receiverVo.getReceiver())); + this.put("name",processUserType.get(receiverVo.getReceiver())); } }); } -- Gitee