From fb92919e0c60acd52dd658e2d2b7a6cd3be92698 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 29 May 2023 19:00:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E8=81=94=E5=AE=A1=20debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/handle/DeptUnitedReviewHandle.java | 17 ++++++++++++++--- .../pmapi/projectlib/service/IProjectService.java | 2 ++ .../projectlib/service/impl/ProjectServiceImpl.java | 11 +++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java index 90057aa..2d580e4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java @@ -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 processSchedule) { ProcessDetailVO processDetailVO = new ProcessDetailVO(); + + //查出历史版本的 所有项目ID + List 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); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java index 6b4144d..9c8031d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectService.java @@ -17,5 +17,7 @@ public interface IProjectService extends IService { public List getAllVersionProjectId(Project project); + public List getAllVersionProjectId(Long projectId); + Project getNewProject(Long projectId); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java index 779ddbc..c966ad5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectServiceImpl.java @@ -42,6 +42,17 @@ public class ProjectServiceImpl extends ServiceImpl impl } @Override + public List 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);