refactor: 字典重构完成
This commit is contained in:
@@ -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