From e6ded464177e027bf1c8752b056034ebcad8ce2e Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 12 Dec 2024 18:13:46 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E4=B8=8B=E8=BD=BD=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1310029125222400]工单中心下载报错 http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947543040/939050947543057/1310029125222400 --- .../form/service/FormServiceImpl.java | 19 ++++++----- .../notify/handler/EmailNotifyHandler.java | 33 +++++++++++-------- .../notify/handler/WechatNotifyHandler.java | 33 +++++++++++-------- 3 files changed, 48 insertions(+), 37 deletions(-) diff --git a/src/main/java/neatlogic/module/framework/form/service/FormServiceImpl.java b/src/main/java/neatlogic/module/framework/form/service/FormServiceImpl.java index dea549fb4..bc3e54202 100644 --- a/src/main/java/neatlogic/module/framework/form/service/FormServiceImpl.java +++ b/src/main/java/neatlogic/module/framework/form/service/FormServiceImpl.java @@ -221,14 +221,7 @@ public class FormServiceImpl implements FormService, IFormCrossoverService { } } else {// 其他,如动态数据源 String matrixUuid = configObj.getString("matrixUuid"); - if (StringUtils.isBlank(matrixUuid)) { - return resultObj; - } JSONObject mappingObj = configObj.getJSONObject("mapping"); - if (MapUtils.isEmpty(mappingObj)) { - return resultObj; - } - ValueTextVo mapping = mappingObj.toJavaObject(ValueTextVo.class); if (dataObj instanceof JSONArray) { JSONArray valueArray = (JSONArray) dataObj; if (CollectionUtils.isNotEmpty(valueArray)) { @@ -249,7 +242,11 @@ public class FormServiceImpl implements FormService, IFormCrossoverService { } else { String value = obj.toString(); valueList.add(value); - String text = getText(matrixUuid, mapping, value); + String text = null; + if (StringUtils.isBlank(matrixUuid) && MapUtils.isNotEmpty(mappingObj)) { + ValueTextVo mapping = mappingObj.toJavaObject(ValueTextVo.class); + text = getText(matrixUuid, mapping, value); + } if (text != null) { textList.add(text); } else { @@ -273,7 +270,11 @@ public class FormServiceImpl implements FormService, IFormCrossoverService { } else { String value = dataObj.toString(); valueList.add(value); - String text = getText(matrixUuid, mapping, value); + String text = null; + if (StringUtils.isBlank(matrixUuid) && MapUtils.isNotEmpty(mappingObj)) { + ValueTextVo mapping = mappingObj.toJavaObject(ValueTextVo.class); + text = getText(matrixUuid, mapping, value); + } if (text != null) { textList.add(text); } else { diff --git a/src/main/java/neatlogic/module/framework/notify/handler/EmailNotifyHandler.java b/src/main/java/neatlogic/module/framework/notify/handler/EmailNotifyHandler.java index bf11679a0..42d6e5e78 100644 --- a/src/main/java/neatlogic/module/framework/notify/handler/EmailNotifyHandler.java +++ b/src/main/java/neatlogic/module/framework/notify/handler/EmailNotifyHandler.java @@ -90,22 +90,27 @@ public class EmailNotifyHandler extends NotifyHandlerBase { private void sendEmail(NotifyVo notifyVo) throws Exception { Set toUserSet = new HashSet<>(); - if (CollectionUtils.isNotEmpty(notifyVo.getToUserUuidList())) { - List userVoList = userMapper.getUserByUserUuidList(notifyVo.getToUserUuidList()); +// if (CollectionUtils.isNotEmpty(notifyVo.getToUserUuidList())) { +// List userVoList = userMapper.getUserByUserUuidList(notifyVo.getToUserUuidList()); +// toUserSet.addAll(userVoList); +// } +// if (CollectionUtils.isNotEmpty(notifyVo.getToTeamUuidList())) { +// for (String teamId : notifyVo.getToTeamUuidList()) { +// List userVoList = userMapper.getActiveUserByTeamId(teamId); +// toUserSet.addAll(userVoList); +// } +// } +// if (CollectionUtils.isNotEmpty(notifyVo.getToRoleUuidList())) { +// for (String roleUuid : notifyVo.getToRoleUuidList()) { +// List userVoList = userService.getUserListByRoleUuid(roleUuid); +// toUserSet.addAll(userVoList); +// } +// } + List userUuidList = userService.getUserUuidListByUserUuidListAndTeamUuidListAndRoleUuidList(notifyVo.getToUserUuidList(), notifyVo.getToTeamUuidList(), notifyVo.getToRoleUuidList()); + if (CollectionUtils.isNotEmpty(userUuidList)) { + List userVoList = userMapper.getUserByUserUuidList(userUuidList); toUserSet.addAll(userVoList); } - if (CollectionUtils.isNotEmpty(notifyVo.getToTeamUuidList())) { - for (String teamId : notifyVo.getToTeamUuidList()) { - List userVoList = userMapper.getActiveUserByTeamId(teamId); - toUserSet.addAll(userVoList); - } - } - if (CollectionUtils.isNotEmpty(notifyVo.getToRoleUuidList())) { - for (String roleUuid : notifyVo.getToRoleUuidList()) { - List userVoList = userService.getUserListByRoleUuid(roleUuid); - toUserSet.addAll(userVoList); - } - } if (CollectionUtils.isEmpty(toUserSet)) { throw new NotifyNoReceiverException(); } diff --git a/src/main/java/neatlogic/module/framework/notify/handler/WechatNotifyHandler.java b/src/main/java/neatlogic/module/framework/notify/handler/WechatNotifyHandler.java index b84909e18..e956f0655 100644 --- a/src/main/java/neatlogic/module/framework/notify/handler/WechatNotifyHandler.java +++ b/src/main/java/neatlogic/module/framework/notify/handler/WechatNotifyHandler.java @@ -92,22 +92,27 @@ public class WechatNotifyHandler extends NotifyHandlerBase { private void sendWechat(NotifyVo notifyVo) { Set toUserSet = new HashSet<>(); - if (CollectionUtils.isNotEmpty(notifyVo.getToUserUuidList())) { - List userVoList = userMapper.getUserByUserUuidList(notifyVo.getToUserUuidList()); +// if (CollectionUtils.isNotEmpty(notifyVo.getToUserUuidList())) { +// List userVoList = userMapper.getUserByUserUuidList(notifyVo.getToUserUuidList()); +// toUserSet.addAll(userVoList); +// } +// if (CollectionUtils.isNotEmpty(notifyVo.getToTeamUuidList())) { +// for (String teamId : notifyVo.getToTeamUuidList()) { +// List userVoList = userMapper.getActiveUserByTeamId(teamId); +// toUserSet.addAll(userVoList); +// } +// } +// if (CollectionUtils.isNotEmpty(notifyVo.getToRoleUuidList())) { +// for (String roleUuid : notifyVo.getToRoleUuidList()) { +// List userVoList = userService.getUserListByRoleUuid(roleUuid); +// toUserSet.addAll(userVoList); +// } +// } + List userUuidList = userService.getUserUuidListByUserUuidListAndTeamUuidListAndRoleUuidList(notifyVo.getToUserUuidList(), notifyVo.getToTeamUuidList(), notifyVo.getToRoleUuidList()); + if (CollectionUtils.isNotEmpty(userUuidList)) { + List userVoList = userMapper.getUserByUserUuidList(userUuidList); toUserSet.addAll(userVoList); } - if (CollectionUtils.isNotEmpty(notifyVo.getToTeamUuidList())) { - for (String teamId : notifyVo.getToTeamUuidList()) { - List userVoList = userMapper.getActiveUserByTeamId(teamId); - toUserSet.addAll(userVoList); - } - } - if (CollectionUtils.isNotEmpty(notifyVo.getToRoleUuidList())) { - for (String roleUuid : notifyVo.getToRoleUuidList()) { - List userVoList = userService.getUserListByRoleUuid(roleUuid); - toUserSet.addAll(userVoList); - } - } if (CollectionUtils.isEmpty(toUserSet)) { throw new NotifyNoReceiverException(); } -- Gitee