浏览代码

测试部署

tags/24080901
PoffyZhang 1年前
父节点
当前提交
1b73033c3c
共有 2 个文件被更改,包括 6 次插入5 次删除
  1. +5
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java

+ 5
- 4
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<Notice> 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<String,List<NoticeListItemVO>> listToMapByManager(NoticeListReq req) {
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())
.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<Notice> records = noticeService.list(wrapper);
return CollUtils.convert(records, w -> NoticeListItemVO
.builder()
@@ -323,7 +324,7 @@ public class NoticeManage {
* 列表查询 权限体现
* @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())
.or(q1 -> q1.eq(Notice::getPermissions,NoticePermissionsEnum.REGION.getCode())
.eq(Notice::getPermissionsValue,user.getRegionCode()))


+ 1
- 1
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();



正在加载...
取消
保存