refactor: 字典重构完成

This commit is contained in:
ray
2024-10-05 23:42:44 +08:00
parent 3f2a5a28df
commit 5d67ab0b62
11 changed files with 711 additions and 671 deletions

View File

@@ -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();
}
}

View File

@@ -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);