diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java index 9e5b34c..89aaf71 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java @@ -136,7 +136,8 @@ public class NoticeManage { .like(StrUtil.isNotBlank(req.getTitle()), Notice::getTitle, req.getTitle()) .eq(req.getType() != null, Notice::getType, req.getType()) .orderByDesc(Notice::getToppedTime, Notice::getUpdateOn); - permissionsWrapper(wrapper,LoginUserUtil.loginUserDetail()); + UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); + permissionsWrapper(wrapper,user); Page page = noticeService.page(req.page(), wrapper); if (page.getTotal() == 0) { return PageVo.empty(); @@ -153,13 +154,13 @@ public class NoticeManage { return PageVo.of(tempDataList, page.getTotal()); } - public Map> listToMapByManager(NoticeListReq req) { + public Map> listToMapByManager(NoticeListReq req,UserFullInfoDTO user) { LambdaQueryWrapper 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); - permissionsWrapper(wrapper,LoginUserUtil.loginUserDetail()); + permissionsWrapper(wrapper,user); List records = noticeService.list(wrapper); return CollUtils.convert(records, w -> NoticeListItemVO .builder() @@ -323,7 +324,7 @@ public class NoticeManage { * 列表查询 权限体现 * @param wrapper */ - private void permissionsWrapper(LambdaQueryWrapper wrapper,UserInfoDetails user) { + private void permissionsWrapper(LambdaQueryWrapper wrapper,UserFullInfoDTO user) { wrapper.eq(Notice::getPermissions,NoticePermissionsEnum.SUPER.getCode()) .or(q1 -> q1.eq(Notice::getPermissions,NoticePermissionsEnum.REGION.getCode()) .eq(Notice::getPermissionsValue,user.getRegionCode())) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java index dc7e426..18c634e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java @@ -76,7 +76,7 @@ public class WorkbenchManage { NoticeListReq noticeListReq = new NoticeListReq(); noticeListReq.setPageNumber(1); noticeListReq.setPageSize(1000); - res.setNoticeList(noticeManage.listToMapByManager(noticeListReq)); + res.setNoticeList(noticeManage.listToMapByManager(noticeListReq,user)); }, ForkJoinPool.commonPool()) ).join();