Commit 503375008b0491c6be2a2f7c12d25d41649ebf7d
1 parent
b6a8d12f
fix: throw exception message not name
Showing
1 changed file
with
5 additions
and
5 deletions
... | ... | @@ -75,7 +75,7 @@ public class SysNoticeServiceImpl extends AbstractBaseService<SysNoticeMapper, S |
75 | 75 | if (sysNoticeDTO.getReceiverType() == null |
76 | 76 | || (!sysNoticeDTO.getReceiverType().equals(FastIotConstants.ReceiverType.ALL) |
77 | 77 | && StringUtils.isEmpty(sysNoticeDTO.getPointId()))) { |
78 | - throw new EntityCreationException(ErrorMessage.SEND_DESTINATION_NOT_FOUND.name()); | |
78 | + throw new EntityCreationException(ErrorMessage.SEND_DESTINATION_NOT_FOUND.getMessage()); | |
79 | 79 | } |
80 | 80 | List<String> userList; |
81 | 81 | switch (sysNotice.getReceiverType()) { |
... | ... | @@ -93,7 +93,7 @@ public class SysNoticeServiceImpl extends AbstractBaseService<SysNoticeMapper, S |
93 | 93 | case FastIotConstants.ReceiverType.ORGANIZATION: |
94 | 94 | // 判断传入的集合id是否为空 |
95 | 95 | if (StringUtils.isEmpty(sysNoticeDTO.getPointId())) { |
96 | - throw new EntityCreationException(ErrorMessage.GET_CURRENT_USER_EXCEPTION.name()); | |
96 | + throw new EntityCreationException(ErrorMessage.GET_CURRENT_USER_EXCEPTION.getMessage()); | |
97 | 97 | } |
98 | 98 | // 获取当前组织下的所有用户 |
99 | 99 | //把拿到的数据用,分割成数组 |
... | ... | @@ -102,10 +102,10 @@ public class SysNoticeServiceImpl extends AbstractBaseService<SysNoticeMapper, S |
102 | 102 | tenantId, sysNoticeDTO.getPointId().split(",")); |
103 | 103 | break; |
104 | 104 | default: |
105 | - throw new EntityCreationException(ErrorMessage.SEND_DESTINATION_NOT_FOUND.name()); | |
105 | + throw new EntityCreationException(ErrorMessage.SEND_DESTINATION_NOT_FOUND.getMessage()); | |
106 | 106 | } |
107 | 107 | if (userList.isEmpty()) { |
108 | - throw new EntityCreationException(ErrorMessage.SEND_DESTINATION_NOT_FOUND.name()); | |
108 | + throw new EntityCreationException(ErrorMessage.SEND_DESTINATION_NOT_FOUND.getMessage()); | |
109 | 109 | } |
110 | 110 | //sysNotice.setPointId(String.join(",", sysNoticeDTO.getPointId())); |
111 | 111 | // 如果为空,则新增 |
... | ... | @@ -119,7 +119,7 @@ public class SysNoticeServiceImpl extends AbstractBaseService<SysNoticeMapper, S |
119 | 119 | List<String> sysNoticeUserList = noticeUserService.getSysNoticeUserIdsByNoticeId(sysNotice.getId()); |
120 | 120 | //更改通知用户的状态 |
121 | 121 | if(null == sysNoticeUserList || sysNoticeUserList.size()<1){ |
122 | - throw new EntityCreationException(ErrorMessage.SEND_DESTINATION_NOT_FOUND.name()); | |
122 | + throw new EntityCreationException(ErrorMessage.SEND_DESTINATION_NOT_FOUND.getMessage()); | |
123 | 123 | } |
124 | 124 | noticeUserService.updateSysNoticeUsersStatusByNoticeId(sysNotice.getId(),sysNotice.getStatus()); |
125 | 125 | baseMapper.updateById(sysNotice); | ... | ... |