master:公告列表返回noticeType字段添加;
parent
46d9afaffa
commit
3be17eda0f
|
|
@ -24,6 +24,8 @@ public class NoticeResDTO {
|
|||
private Long id;
|
||||
@ApiModelProperty(value = "公告标题")
|
||||
private String noticeTitle;
|
||||
@ApiModelProperty(value = "公告类型(1通知 2公告)")
|
||||
private Integer noticeType;
|
||||
@ApiModelProperty(value = "公告内容")
|
||||
private String noticeContent;
|
||||
@ApiModelProperty(value = "谁发的公告 1 档口 2 系统")
|
||||
|
|
|
|||
|
|
@ -158,14 +158,15 @@ public class NoticeServiceImpl implements INoticeService {
|
|||
}
|
||||
PageHelper.startPage(pageDTO.getPageNum(), pageDTO.getPageSize());
|
||||
List<Notice> noticeList = this.noticeMapper.selectList(queryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(noticeList)) {
|
||||
List<Long> userIdList = noticeList.stream().map(Notice::getUserId).collect(Collectors.toList());
|
||||
List<SysUser> userList = this.userMapper.selectList(new LambdaQueryWrapper<SysUser>()
|
||||
.in(SysUser::getUserId, userIdList).eq(SysUser::getDelFlag, Constants.UNDELETED));
|
||||
Map<Long, SysUser> userMap = userList.stream().collect(Collectors.toMap(SysUser::getUserId, x -> x));
|
||||
noticeList.forEach(x -> x.setCreateBy(userMap.containsKey(x.getUserId()) ?
|
||||
userMap.get(x.getUserId()).getUserName() : ""));
|
||||
if (CollectionUtils.isEmpty(noticeList)) {
|
||||
return Page.empty(pageDTO.getPageSize(), pageDTO.getPageNum());
|
||||
}
|
||||
List<Long> userIdList = noticeList.stream().map(Notice::getUserId).collect(Collectors.toList());
|
||||
List<SysUser> userList = this.userMapper.selectList(new LambdaQueryWrapper<SysUser>()
|
||||
.in(SysUser::getUserId, userIdList).eq(SysUser::getDelFlag, Constants.UNDELETED));
|
||||
Map<Long, SysUser> userMap = userList.stream().collect(Collectors.toMap(SysUser::getUserId, x -> x));
|
||||
noticeList.forEach(x -> x.setCreateBy(userMap.containsKey(x.getUserId()) ?
|
||||
userMap.get(x.getUserId()).getUserName() : ""));
|
||||
return Page.convert(new PageInfo<>(noticeList), BeanUtil.copyToList(noticeList, NoticeResDTO.class));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue