|
|
@@ -121,6 +121,13 @@ public class NoticeManage { |
|
|
|
noticeService.updateById(notice); |
|
|
|
} |
|
|
|
|
|
|
|
public PageVo<NoticeListItemVO> list(Integer limit, Integer type) { |
|
|
|
NoticeListReq req = new NoticeListReq(); |
|
|
|
req.setPageSize(limit); |
|
|
|
req.setEnabled(true); |
|
|
|
req.setType(type); |
|
|
|
return listByManagerByPermission(req); |
|
|
|
} |
|
|
|
|
|
|
|
public PageVo<NoticeListItemVO> dashboardList(Integer limit, Integer type) { |
|
|
|
NoticeListReq req = new NoticeListReq(); |
|
|
@@ -154,6 +161,30 @@ public class NoticeManage { |
|
|
|
return PageVo.of(tempDataList, page.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
public PageVo<NoticeListItemVO> listByManagerByPermission(NoticeListReq req) { |
|
|
|
LambdaQueryWrapper<Notice> wrapper = Wrappers.lambdaQuery(Notice.class) |
|
|
|
.eq(req.getEnabled() != null, Notice::getEnabled, req.getEnabled()) |
|
|
|
.like(StrUtil.isNotBlank(req.getTitle()), Notice::getTitle, req.getTitle()) |
|
|
|
.eq(req.getType() != null, Notice::getType, req.getType()) |
|
|
|
.orderByDesc(Notice::getToppedTime, Notice::getUpdateOn); |
|
|
|
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); |
|
|
|
permissionsWrapper(wrapper,user); |
|
|
|
Page<Notice> page = noticeService.page(req.page(), wrapper); |
|
|
|
if (page.getTotal() == 0) { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
List<NoticeListItemVO> tempDataList = CollUtils.convert(page.getRecords(), w -> NoticeListItemVO |
|
|
|
.builder() |
|
|
|
.id(w.getId()) |
|
|
|
.type(w.getType()) |
|
|
|
.title(w.getTitle()) |
|
|
|
.enabled(w.getEnabled()) |
|
|
|
.createOn(w.getCreateOn()) |
|
|
|
.topped(w.getToppedTime() != null) |
|
|
|
.build()); |
|
|
|
return PageVo.of(tempDataList, page.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
public Map<String,List<NoticeListItemVO>> listToMapByManager(NoticeListReq req,UserFullInfoDTO user) { |
|
|
|
LambdaQueryWrapper<Notice> wrapper = Wrappers.lambdaQuery(Notice.class) |
|
|
|
.eq(req.getEnabled() != null, Notice::getEnabled, req.getEnabled()) |
|
|
|