|
|
@@ -665,6 +665,9 @@ public class TodoCenterManage { |
|
|
|
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, projectIdList) |
|
|
|
.orderByDesc(ProjectInst::getProjectId)); |
|
|
|
if (projectInstList.isEmpty()) { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
Map<String, Project> projectInfoMap = projectInstList.stream() |
|
|
|
.filter(p -> StringUtils.isNotBlank(p.getInstCode()) && |
|
|
|
!TodoCenterConst.Declared.NULL_INST_CODE.equals(p.getInstCode())) |
|
|
@@ -809,6 +812,9 @@ public class TodoCenterManage { |
|
|
|
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, projectIdList) |
|
|
|
.orderByDesc(ProjectInst::getProjectId)); |
|
|
|
if (projectInstList.isEmpty()) { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
Map<String, Project> projectInfoMap = projectInstList.stream() |
|
|
|
.filter(p -> StringUtils.isNotBlank(p.getInstCode()) && |
|
|
|
!TodoCenterConst.Declared.NULL_INST_CODE.equals(p.getInstCode())) |
|
|
@@ -1514,22 +1520,24 @@ public class TodoCenterManage { |
|
|
|
String userIdStr = String.valueOf(userId); |
|
|
|
// 获取登录用户全量信息 |
|
|
|
// 获取员工浙政钉code |
|
|
|
TodoNumVO todoNumVo = new TodoNumVO(); |
|
|
|
TodoNumVO retTodoNum = new TodoNumVO(); |
|
|
|
|
|
|
|
// 查出项目库项目 |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
|
BeanUtils.copyProperties(param, projectListReq); |
|
|
|
List<Project> projects = projectLibManage.projectList(projectListReq); |
|
|
|
if (CollUtil.isEmpty(projects)) { |
|
|
|
return todoNumVo; |
|
|
|
return retTodoNum; |
|
|
|
} |
|
|
|
// 再查出项目关联的流程实例ID |
|
|
|
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
List<Long> projectIdList = CollUtils.fieldList(projects, Project::getId); |
|
|
|
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) |
|
|
|
.in(ProjectInst::getProjectId, projectIdList) |
|
|
|
.orderByDesc(ProjectInst::getProjectId)); |
|
|
|
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); |
|
|
|
if (projectInstList.isEmpty()) { |
|
|
|
return retTodoNum; |
|
|
|
} |
|
|
|
List<String> instCodes = CollUtils.fieldList(projectInstList, ProjectInst::getInstCode); |
|
|
|
// 查出用户工作流 |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
req.setInstCodes(instCodes); |
|
|
@@ -1547,7 +1555,7 @@ public class TodoCenterManage { |
|
|
|
.reversed()) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
if (CollUtil.isEmpty(list)) { |
|
|
|
return todoNumVo; |
|
|
|
return retTodoNum; |
|
|
|
} |
|
|
|
|
|
|
|
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v)); |
|
|
@@ -1560,22 +1568,22 @@ public class TodoCenterManage { |
|
|
|
.map(d -> projectInfoMap.get(d.getInstanceId())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
if (CollUtil.isNotEmpty(projectList)) { |
|
|
|
todoNumVo.setTotalNum(projectList.size()); |
|
|
|
retTodoNum.setTotalNum(projectList.size()); |
|
|
|
} |
|
|
|
// 筛选出增补项目和非增补项目 |
|
|
|
List<Project> appendProjects = projectList.stream() |
|
|
|
.filter(p -> IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(p.getIsTemporaryAugment())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
if (CollUtil.isNotEmpty(appendProjects)) { |
|
|
|
todoNumVo.setAppendNum(appendProjects.size()); |
|
|
|
retTodoNum.setAppendNum(appendProjects.size()); |
|
|
|
} |
|
|
|
List<Project> notAppendProjects = projectList.stream() |
|
|
|
.filter(p -> IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(p.getIsTemporaryAugment())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
if (CollUtil.isNotEmpty(notAppendProjects)) { |
|
|
|
todoNumVo.setNotAppendNum(notAppendProjects.size()); |
|
|
|
retTodoNum.setNotAppendNum(notAppendProjects.size()); |
|
|
|
} |
|
|
|
return todoNumVo; |
|
|
|
return retTodoNum; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|