refactor: 字典重构完成
This commit is contained in:
@@ -53,4 +53,9 @@ public class DictData extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 标签类型
|
||||
*/
|
||||
private String tagType;
|
||||
}
|
||||
@@ -34,4 +34,7 @@ public class DictDataForm {
|
||||
@Schema(description = "状态(1-启用,0-禁用)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "字典类型")
|
||||
private String tagType;
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class NoticePageVO implements Serializable {
|
||||
private Integer publishStatus;
|
||||
|
||||
@Schema(description = "通知类型")
|
||||
private String typeLabel;
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "发布人姓名")
|
||||
private String publisherName;
|
||||
|
||||
@@ -103,7 +103,7 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
|
||||
return this.list(new LambdaQueryWrapper<DictData>()
|
||||
.eq(DictData::getDictCode, dictCode)
|
||||
.eq(DictData::getStatus, 1)
|
||||
).stream().map(item -> new Option<>(item.getValue(), item.getLabel()))
|
||||
).stream().map(item -> new Option<>(item.getValue(), item.getLabel(),item.getTagType()))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,14 +188,21 @@ public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> impleme
|
||||
);
|
||||
|
||||
// 添加新的用户通知数据
|
||||
List<String> targetUserIdList = Arrays.asList(targetUserIds.split(","));
|
||||
List<String> targetUserIdList = null;
|
||||
if (NoticeTargetTypeEnum.SPECIFIED.getValue().equals(targetType)) {
|
||||
targetUserIdList = Arrays.asList(targetUserIds.split(","));
|
||||
}
|
||||
|
||||
List<User> targetUserList = userService.list(
|
||||
new LambdaQueryWrapper<User>()
|
||||
// 如果是指定用户,则筛选出指定用户
|
||||
.in(NoticeTargetTypeEnum.SPECIFIED.getValue().equals(targetType), User::getId, targetUserIdList)
|
||||
.in(
|
||||
NoticeTargetTypeEnum.SPECIFIED.getValue().equals(targetType),
|
||||
User::getId,
|
||||
targetUserIdList
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
List<UserNotice> userNoticeList = targetUserList.stream().map(user -> {
|
||||
UserNotice userNotice = new UserNotice();
|
||||
userNotice.setNoticeId(id);
|
||||
|
||||
Reference in New Issue
Block a user