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 dea549fb45191662943199c267437f4eb61f5121..bc3e54202c4dbbacc6dbed1da733880ba7ecfddc 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 bf11679a06f3e88ddadf2824a28739f8c16befd0..42d6e5e78ef03e0633d01c8ef6218553d9fc756b 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 b84909e18824c2d425420efb21e2d382ae084140..e956f06554e64db90e2b43dff99e4ec397e57ecf 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(); }