|
@@ -136,7 +136,8 @@ public class NoticeManage { |
|
|
.like(StrUtil.isNotBlank(req.getTitle()), Notice::getTitle, req.getTitle()) |
|
|
.like(StrUtil.isNotBlank(req.getTitle()), Notice::getTitle, req.getTitle()) |
|
|
.eq(req.getType() != null, Notice::getType, req.getType()) |
|
|
.eq(req.getType() != null, Notice::getType, req.getType()) |
|
|
.orderByDesc(Notice::getToppedTime, Notice::getUpdateOn); |
|
|
.orderByDesc(Notice::getToppedTime, Notice::getUpdateOn); |
|
|
permissionsWrapper(wrapper,LoginUserUtil.loginUserDetail()); |
|
|
|
|
|
|
|
|
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); |
|
|
|
|
|
permissionsWrapper(wrapper,user); |
|
|
Page<Notice> page = noticeService.page(req.page(), wrapper); |
|
|
Page<Notice> page = noticeService.page(req.page(), wrapper); |
|
|
if (page.getTotal() == 0) { |
|
|
if (page.getTotal() == 0) { |
|
|
return PageVo.empty(); |
|
|
return PageVo.empty(); |
|
@@ -153,13 +154,13 @@ public class NoticeManage { |
|
|
return PageVo.of(tempDataList, page.getTotal()); |
|
|
return PageVo.of(tempDataList, page.getTotal()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public Map<String,List<NoticeListItemVO>> listToMapByManager(NoticeListReq req) { |
|
|
|
|
|
|
|
|
public Map<String,List<NoticeListItemVO>> listToMapByManager(NoticeListReq req,UserFullInfoDTO user) { |
|
|
LambdaQueryWrapper<Notice> wrapper = Wrappers.lambdaQuery(Notice.class) |
|
|
LambdaQueryWrapper<Notice> wrapper = Wrappers.lambdaQuery(Notice.class) |
|
|
.eq(req.getEnabled() != null, Notice::getEnabled, req.getEnabled()) |
|
|
.eq(req.getEnabled() != null, Notice::getEnabled, req.getEnabled()) |
|
|
.like(StrUtil.isNotBlank(req.getTitle()), Notice::getTitle, req.getTitle()) |
|
|
.like(StrUtil.isNotBlank(req.getTitle()), Notice::getTitle, req.getTitle()) |
|
|
.eq(req.getType() != null, Notice::getType, req.getType()) |
|
|
.eq(req.getType() != null, Notice::getType, req.getType()) |
|
|
.orderByDesc(Notice::getToppedTime, Notice::getUpdateOn); |
|
|
.orderByDesc(Notice::getToppedTime, Notice::getUpdateOn); |
|
|
permissionsWrapper(wrapper,LoginUserUtil.loginUserDetail()); |
|
|
|
|
|
|
|
|
permissionsWrapper(wrapper,user); |
|
|
List<Notice> records = noticeService.list(wrapper); |
|
|
List<Notice> records = noticeService.list(wrapper); |
|
|
return CollUtils.convert(records, w -> NoticeListItemVO |
|
|
return CollUtils.convert(records, w -> NoticeListItemVO |
|
|
.builder() |
|
|
.builder() |
|
@@ -323,7 +324,7 @@ public class NoticeManage { |
|
|
* 列表查询 权限体现 |
|
|
* 列表查询 权限体现 |
|
|
* @param wrapper |
|
|
* @param wrapper |
|
|
*/ |
|
|
*/ |
|
|
private void permissionsWrapper(LambdaQueryWrapper<Notice> wrapper,UserInfoDetails user) { |
|
|
|
|
|
|
|
|
private void permissionsWrapper(LambdaQueryWrapper<Notice> wrapper,UserFullInfoDTO user) { |
|
|
wrapper.eq(Notice::getPermissions,NoticePermissionsEnum.SUPER.getCode()) |
|
|
wrapper.eq(Notice::getPermissions,NoticePermissionsEnum.SUPER.getCode()) |
|
|
.or(q1 -> q1.eq(Notice::getPermissions,NoticePermissionsEnum.REGION.getCode()) |
|
|
.or(q1 -> q1.eq(Notice::getPermissions,NoticePermissionsEnum.REGION.getCode()) |
|
|
.eq(Notice::getPermissionsValue,user.getRegionCode())) |
|
|
.eq(Notice::getPermissionsValue,user.getRegionCode())) |
|
|