From 14ef4e9fd7487b63681cb4d23d91d873e2c226a4 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Tue, 18 Jul 2023 17:40:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=A5=E4=BD=9C=E5=8F=B0?= =?UTF-8?q?=E4=BB=A3=E5=8A=9E=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=94=A8=E6=88=B7ID=E8=8E=B7=E5=8F=96=E7=A9=BA?= =?UTF-8?q?=E6=8C=87=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/todocenter/manage/TodoCenterManage.java | 2 +- .../pmapi/todocenter/model/req/ToBeProcessedReq.java | 3 +++ .../pmapi/workbench/manage/WorkbenchManage.java | 18 ++++++++++-------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index ade0d89..9fbb3c5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -148,7 +148,7 @@ public class TodoCenterManage { String employeeCode = param.getEmployeeCode(); if(StringUtils.isBlank(employeeCode)){ // 获取登录用户ID - Long userId = LoginUserUtil.getUserId(); + Long userId = Optional.of(param.getLoginUserId()).orElseGet(LoginUserUtil::getUserId); // 获取登录用户全量信息 UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); // 获取员工浙政钉code diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedReq.java index c82c28a..588362f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedReq.java @@ -48,4 +48,7 @@ public class ToBeProcessedReq extends PagePo implements Serializable { @ApiModelProperty("登录人员工号") private String employeeCode; + + private Long loginUserId; + } 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 45666be..dc7e426 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 @@ -46,30 +46,32 @@ public class WorkbenchManage { private final ProjectLibManage projectLibManage; - public WorkbenchVO getWorkbenchData(Integer year){ + public WorkbenchVO getWorkbenchData(Integer year) { WorkbenchVO res = new WorkbenchVO(); - UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId()); + Long userId = LoginUserUtil.getUserId(); + UserFullInfoDTO user = userInfoHelper.getUserFullInfo(userId); CompletableFuture.allOf( - CompletableFuture.runAsync(()-> { + CompletableFuture.runAsync(() -> { //1.待办中心数据 TodoCenterStatisticsVO statisticsVO = todoCenterManage.todoCenterStatistics(user.getEmployeeCode()); ToBeProcessedReq toBeProcessedReq = new ToBeProcessedReq(); toBeProcessedReq.setPageNumber(1); toBeProcessedReq.setPageSize(5); + toBeProcessedReq.setLoginUserId(userId); toBeProcessedReq.setEmployeeCode(user.getEmployeeCode()); statisticsVO.setTodoList(todoCenterManage.todoProjectList(toBeProcessedReq).getRecords() .stream().map(WorkbenchConverter::convert).collect(Collectors.toList())); res.setTodoCerter(statisticsVO); }, ForkJoinPool.commonPool()), - CompletableFuture.runAsync(()-> { + CompletableFuture.runAsync(() -> { //2.项目统计数据 - res.setOrgDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectOrgStatistics(year,user))); - if(userInfoHelper.isSuperOrRegionAdmin(user.getUserId())){ - res.setRegionDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectRegionStatistics(year,user))); + res.setOrgDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectOrgStatistics(year, user))); + if (userInfoHelper.isSuperOrRegionAdmin(user.getUserId())) { + res.setRegionDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage.declaredProjectRegionStatistics(year, user))); } }, ForkJoinPool.commonPool()), - CompletableFuture.runAsync(()-> { + CompletableFuture.runAsync(() -> { //3.所有公告按类型分 NoticeListReq noticeListReq = new NoticeListReq(); noticeListReq.setPageNumber(1);