Browse Source

部门联审 debug

tags/24080901
PoffyZhang 1 year ago
parent
commit
fb92919e0c
3 changed files with 27 additions and 3 deletions
  1. +14
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java
  2. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java
  3. +11
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java

+ 14
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java View File

@@ -7,6 +7,8 @@ import java.util.Objects;
import cn.hutool.core.collection.CollUtil;
import com.google.common.collect.Lists;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
@@ -35,12 +37,17 @@ import com.wflow.workflow.service.ProcessInstanceService;
public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle {

private final IProjectInstService projectInstService;

private final IProjectService projectService;
private final ProcessInstanceService processInstanceService;
private final BuildUserUtils buildUserUtils;
private final ProjectVersionUtil projectVersionUtil;

public DeptUnitedReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils, ProjectVersionUtil projectVersionUtil){
public DeptUnitedReviewHandle(IProjectInstService projectInstService,IProjectService projectService
, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils,
ProjectVersionUtil projectVersionUtil){
this.projectInstService = projectInstService;
this.projectService = projectService;
this.processInstanceService = processInstanceService;
this.buildUserUtils = buildUserUtils;
this.projectVersionUtil = projectVersionUtil;
@@ -49,12 +56,16 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle {
@Override
void businessHandle(Long projectId, List<ProcessDetailVO> processSchedule) {
ProcessDetailVO processDetailVO = new ProcessDetailVO();

//查出历史版本的 所有项目ID
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(projectId);

// 根据项目ID查询出部门联审流程的流程状态
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getProjectId, projectId)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.DEPT_UNITED_REVIEW.getCode())
.orderByDesc(ProjectInst::getCreatOn)
.last("limit 1"));
.last(BizConst.LIMIT_1));
if (Objects.isNull(projectInst)){
processDetailVO.setStepStatus(StepStatusEnum.NOT_START);
processDetailVO.setProcessName(CommonConst.DEPT_UNITED_REVIEW);


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java View File

@@ -17,5 +17,7 @@ public interface IProjectService extends IService<Project> {

public List<Long> getAllVersionProjectId(Project project);

public List<Long> getAllVersionProjectId(Long projectId);

Project getNewProject(Long projectId);
}

+ 11
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java View File

@@ -42,6 +42,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
}

@Override
public List<Long> getAllVersionProjectId(Long projectId) {
Project project = getById(projectId);

if(Objects.isNull(project)){
return null;
}

return getAllVersionProjectId(project);
}

@Override
public Project getNewProject(Long projectId) {
Project project = getById(projectId);



Loading…
Cancel
Save