Sfoglia il codice sorgente

测试部署

tags/24080901
PoffyZhang 1 anno fa
parent
commit
1b73033c3c
2 ha cambiato i file con 6 aggiunte e 5 eliminazioni
  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 Vedi File

@@ -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 Vedi File

@@ -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();



Loading…
Annulla
Salva