Browse Source

修复工作台代办项目列表查询用户ID获取空指针异常

tags/24080901
WendyYang 1 year ago
parent
commit
14ef4e9fd7
3 changed files with 14 additions and 9 deletions
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  2. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedReq.java
  3. +10
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

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


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/req/ToBeProcessedReq.java View File

@@ -48,4 +48,7 @@ public class ToBeProcessedReq extends PagePo implements Serializable {

@ApiModelProperty("登录人员工号")
private String employeeCode;

private Long loginUserId;

}

+ 10
- 8
pmapi/src/main/java/com/ningdatech/pmapi/workbench/manage/WorkbenchManage.java View File

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


Loading…
Cancel
Save