Commit f1b33f6e807d8f5a27ef2747fbe1e5188a54993f

Authored by 云中非
1 parent 1afb808c

refactor: 通知状态和接收者类型从字符串改为数值型

@@ -72,14 +72,14 @@ public interface FastIotConstants { @@ -72,14 +72,14 @@ public interface FastIotConstants {
72 } 72 }
73 73
74 interface ReceiverType { 74 interface ReceiverType {
75 - String PERSONAL = "3";  
76 - String DEPARTMENT = "2";  
77 - String ORGANIZATION = "1";  
78 - String ALL = "0"; 75 + int PERSONAL = 3;
  76 + int DEPARTMENT = 2;
  77 + int ORGANIZATION = 1;
  78 + int ALL = 0;
79 } 79 }
80 80
81 interface DraftStatus { 81 interface DraftStatus {
82 - String PUBLISHED = "1";  
83 - String DRAFT = "0"; 82 + int PUBLISHED = 1;
  83 + int DRAFT = 0;
84 } 84 }
85 } 85 }
@@ -31,13 +31,13 @@ public class SysNoticeDTO extends TenantDTO { @@ -31,13 +31,13 @@ public class SysNoticeDTO extends TenantDTO {
31 private String content; 31 private String content;
32 32
33 @ApiModelProperty(value = "接收者(字典值receiver_type) 0:全部 1:组织 2:部门 3:个人",required = true) 33 @ApiModelProperty(value = "接收者(字典值receiver_type) 0:全部 1:组织 2:部门 3:个人",required = true)
34 - private String receiverType; 34 + private Integer receiverType;
35 35
36 @ApiModelProperty(value = "根据receiverType不同变化,0:传null,1:组织id,2:部门id,3:用户id",required = true) 36 @ApiModelProperty(value = "根据receiverType不同变化,0:传null,1:组织id,2:部门id,3:用户id",required = true)
37 private String pointId; 37 private String pointId;
38 38
39 @ApiModelProperty(value = "发送状态(字典值draft_status) 0:草稿 1:已发布") 39 @ApiModelProperty(value = "发送状态(字典值draft_status) 0:草稿 1:已发布")
40 - private String status; 40 + private Integer status;
41 41
42 @ApiModelProperty(value = "发送者") 42 @ApiModelProperty(value = "发送者")
43 private String senderName; 43 private String senderName;
@@ -27,9 +27,9 @@ public class SysNotice extends TenantBaseEntity { @@ -27,9 +27,9 @@ public class SysNotice extends TenantBaseEntity {
27 /** 内容 */ 27 /** 内容 */
28 private String content; 28 private String content;
29 /** 接收者(字典值receiver_type) 0:全部 1:组织 2:部门 3:个人 */ 29 /** 接收者(字典值receiver_type) 0:全部 1:组织 2:部门 3:个人 */
30 - private String receiverType; 30 + private int receiverType;
31 /** 发送状态(字典值draft_status) 0:草稿 1:已发布 */ 31 /** 发送状态(字典值draft_status) 0:草稿 1:已发布 */
32 - private String status; 32 + private int status;
33 /** 发送者 */ 33 /** 发送者 */
34 private String senderName; 34 private String senderName;
35 /** 发送时间 */ 35 /** 发送时间 */
@@ -30,5 +30,5 @@ public class SysNoticeUser extends TenantBaseEntity { @@ -30,5 +30,5 @@ public class SysNoticeUser extends TenantBaseEntity {
30 /** 阅读时间 */ 30 /** 阅读时间 */
31 private LocalDateTime readDate; 31 private LocalDateTime readDate;
32 /** 通知用户状态: 0 草稿 1已发布 */ 32 /** 通知用户状态: 0 草稿 1已发布 */
33 - private String status; 33 + private Integer status;
34 } 34 }
@@ -73,7 +73,7 @@ public class SysNoticeUserServiceImpl @@ -73,7 +73,7 @@ public class SysNoticeUserServiceImpl
73 73
74 @Override 74 @Override
75 public void saveSysNoticeUser( 75 public void saveSysNoticeUser(
76 - List<String> userIds, String tenantId, String noticeId, String status) { 76 + List<String> userIds, String tenantId, String noticeId, Integer status) {
77 List<User> userList = userMapper 77 List<User> userList = userMapper
78 .selectList( 78 .selectList(
79 new LambdaQueryWrapper<User>().in(User::getId, userIds)) 79 new LambdaQueryWrapper<User>().in(User::getId, userIds))
@@ -108,8 +108,8 @@ public class SysNoticeUserServiceImpl @@ -108,8 +108,8 @@ public class SysNoticeUserServiceImpl
108 } 108 }
109 109
110 @Override 110 @Override
111 - public boolean updateSysNoticeUsersStatusByNoticeId(String id, String status) {  
112 - if (StringUtils.isAllEmpty(id) || StringUtils.isAllEmpty(status)) { 111 + public boolean updateSysNoticeUsersStatusByNoticeId(String id, Integer status) {
  112 + if (StringUtils.isAllEmpty(id) || status == null) {
113 throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.name()); 113 throw new YtDataValidationException(ErrorMessage.INTERNAL_ERROR.name());
114 } 114 }
115 return baseMapper.updateSysNoticeUsersStatusByNoticeId(id, status); 115 return baseMapper.updateSysNoticeUsersStatusByNoticeId(id, status);
@@ -30,7 +30,7 @@ public interface SysNoticeUserMapper extends BaseMapper<SysNoticeUser> { @@ -30,7 +30,7 @@ public interface SysNoticeUserMapper extends BaseMapper<SysNoticeUser> {
30 */ 30 */
31 SysNoticeUserDTO get(@Param("id") String id, @Param("tenantId") String tenantId); 31 SysNoticeUserDTO get(@Param("id") String id, @Param("tenantId") String tenantId);
32 32
33 - boolean updateSysNoticeUsersStatusByNoticeId(@Param("noticeId")String noticeId, @Param("status")String status); 33 + boolean updateSysNoticeUsersStatusByNoticeId(@Param("noticeId")String noticeId, @Param("status")Integer status);
34 34
35 35
36 } 36 }
@@ -21,11 +21,11 @@ public interface SysNoticeUserService extends BaseService<SysNoticeUser>{ @@ -21,11 +21,11 @@ public interface SysNoticeUserService extends BaseService<SysNoticeUser>{
21 21
22 SysNoticeUserDTO get(String id,String tenantId); 22 SysNoticeUserDTO get(String id,String tenantId);
23 23
24 - void saveSysNoticeUser (List<String> userIds, String tenantId,String noticeId,String status); 24 + void saveSysNoticeUser (List<String> userIds, String tenantId,String noticeId,Integer status);
25 25
26 List<String> getSysNoticeUserIdsByNoticeId(String noticeId); 26 List<String> getSysNoticeUserIdsByNoticeId(String noticeId);
27 27
28 - boolean updateSysNoticeUsersStatusByNoticeId(String noticeId, String status); 28 + boolean updateSysNoticeUsersStatusByNoticeId(String noticeId, Integer status);
29 29
30 boolean deleteNoticUserByNoticeId(List<String> noticeId); 30 boolean deleteNoticUserByNoticeId(List<String> noticeId);
31 } 31 }
@@ -32,15 +32,15 @@ @@ -32,15 +32,15 @@
32 sn.id id, 32 sn.id id,
33 sn.type AS type, 33 sn.type AS type,
34 sn.title title, 34 sn.title title,
35 - sn.content AS content,  
36 - (  
37 - <include refid="dict"/>  
38 - AND sd.dict_code = 'receiver_type' AND sdi.item_value = sn.receiver_type  
39 - ) receiver_type,  
40 - (  
41 - <include refid="dict"/>  
42 - AND sd.dict_code = 'draft_status' AND sdi.item_value = sn.status  
43 - ) status, 35 + sn.content AS content,sn.receiver_type,sn.status,
  36 +<!-- (-->
  37 +<!-- <include refid="dict"/>-->
  38 +<!-- AND sd.dict_code = 'receiver_type' AND sdi.item_value = sn.receiver_type-->
  39 +<!-- ) receiver_type,-->
  40 +<!-- (-->
  41 +<!-- <include refid="dict"/>-->
  42 +<!-- AND sd.dict_code = 'draft_status' AND sdi.item_value = sn.status-->
  43 +<!-- ) status,-->
44 sn.sender_name sender_name, 44 sn.sender_name sender_name,
45 sn.sender_date sender_date, 45 sn.sender_date sender_date,
46 sn.creator creator, 46 sn.creator creator,