Browse Source

优化 撤回处理的代码

master
PoffyZhang 1 year ago
parent
commit
a4de55bbd2
1 changed files with 15 additions and 13 deletions
  1. +15
    -13
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

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

@@ -151,12 +151,13 @@ public class TodoCenterManage {
ProjectListReq projectListReq = new ProjectListReq();
BeanUtils.copyProperties(param, projectListReq);
List<Project> projects = projectLibManage.projectList(projectListReq);
if(CollUtil.isEmpty(projects)){
return PageVo.empty();
}
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v));
// 再查出项目关联的流程实例ID
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList());
if(CollUtil.isEmpty(projectIdList)){
return PageVo.empty();
}

List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
@@ -228,17 +229,18 @@ public class TodoCenterManage {
ProjectListReq projectListReq = new ProjectListReq();
BeanUtils.copyProperties(param, projectListReq);
List<Project> projects = projectLibManage.projectList(projectListReq);
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v));
// 再查出项目关联的流程实例ID
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList());
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p-> projectsMap.get(p.getProjectId())));
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());

List<ProcessTaskVo> userTodoList = Lists.newArrayList();
if (CollUtil.isNotEmpty(instCodes)) {
Map<String, Project> projectInfoMap = Maps.newHashMap();
if (CollUtil.isNotEmpty(projects)) {
Map<Long, Project> projectsMap = projects.stream().collect(Collectors.toMap(Project::getId, v -> v));
// 再查出项目关联的流程实例ID
List<Long> projectIdList = projects.stream().map(Project::getId).collect(Collectors.toList());
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p-> projectsMap.get(p.getProjectId())));
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());

// 查出用户工作流
TodoCenterListReqDTO req = new TodoCenterListReqDTO();
req.setInstCodes(instCodes);


Loading…
Cancel
Save