From de54cfec416c76c82412f54cce4abdc5c25aa1b0 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Fri, 7 Jul 2023 11:49:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=A4=A7=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/constant/CommonConst.java | 2 + .../pmapi/projectlib/handle/AnnualPlanHandle.java | 4 +- .../pmapi/projectlib/handle/ArchivedHandle.java | 4 +- .../handle/ConstructionPlanReviewHandle.java | 4 +- .../projectlib/handle/DeptUnitedReviewHandle.java | 4 +- .../handle/ProcessExecuteChainHandle.java | 14 ++- .../projectlib/handle/ProjectApprovalHandle.java | 4 +- .../handle/ProjectFinalInspectionHandle.java | 4 +- .../handle/ProjectPreliminaryInspectionHandle.java | 4 +- .../handle/ProvinceUnitedReviewHandle.java | 103 +++++++++++++++++++++ .../projectlib/handle/TenderPurchaseHandle.java | 4 +- 11 files changed, 133 insertions(+), 18 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java index 67df739..238f416 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/CommonConst.java @@ -21,7 +21,9 @@ public interface CommonConst { String PROJECT_DECLARE = "项目申报"; String UNIT_INNER_AUDIT = "单位内部审核"; String PRELIMINARY_PREVIEW = "项目预审"; + String DEPT_UNITED_REVIEW = "部门联审"; + String PROVINCE_UNITED_REVIEW = "省级部门联审"; String ANNUAL_PLAN = "年度计划"; String CONSTRUCTION_PLAN_REVIEW = "建设方案评审"; String PROJECT_APPROVAL = "立项批复"; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AnnualPlanHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AnnualPlanHandle.java index 66b081d..6cd3a9f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AnnualPlanHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/AnnualPlanHandle.java @@ -28,13 +28,13 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; * @author CMM * @since 2023/02/24 14:35 */ -@Order(5) +@Order(6) @Component public class AnnualPlanHandle extends AbstractProcessBusinessHandle { private final INdProjectStatusChangeService projectStatusChangeService; private final IProjectService projectService; - private Integer order = 5; + private Integer order = 6; /** * 项目状态为:年度计划中之前的状态 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java index 62ed5c2..75c2482 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ArchivedHandle.java @@ -24,13 +24,13 @@ import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; * @author CMM * @since 2023/02/24 14:35 */ -@Order(11) +@Order(12) @Component public class ArchivedHandle extends AbstractProcessBusinessHandle { private final IProjectService projectService; private final INdProjectStatusChangeService projectStatusChangeService; - private Integer order = 11; + private Integer order = 12; public ArchivedHandle( IProjectService projectService, INdProjectStatusChangeService projectStatusChangeService){ this.projectService = projectService; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java index c5ac2e7..7aca628 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java @@ -34,7 +34,7 @@ import com.wflow.workflow.service.ProcessInstanceService; * @author CMM * @since 2023/02/24 14:35 */ -@Order(6) +@Order(7) @Component public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle { @@ -44,7 +44,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle private final ProjectVersionUtil projectVersionUtil; private final IProjectService projectService; - private Integer order = 6; + private Integer order = 7; public ConstructionPlanReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils, ProjectVersionUtil projectVersionUtil, IProjectService projectService){ this.projectInstService = projectInstService; 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 7072aae..5ecc257 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 @@ -32,7 +32,7 @@ import com.wflow.workflow.service.ProcessInstanceService; * @author CMM * @since 2023/02/24 14:35 */ -@Order(4) +@Order(5) @Component public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { @@ -43,7 +43,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { private final BuildUserUtils buildUserUtils; private final ProjectVersionUtil projectVersionUtil; - private Integer order = 4; + private Integer order = 5; public DeptUnitedReviewHandle(IProjectInstService projectInstService,IProjectService projectService , ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils, diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProcessExecuteChainHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProcessExecuteChainHandle.java index 30b187b..167c3cc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProcessExecuteChainHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProcessExecuteChainHandle.java @@ -3,8 +3,10 @@ package com.ningdatech.pmapi.projectlib.handle; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.common.constant.ProjectDeclareConst; import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; import com.ningdatech.pmapi.common.statemachine.contants.RegionContant; +import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.wflow.bean.entity.WflowModels; @@ -67,6 +69,8 @@ public class ProcessExecuteChainHandle { processBusinessHandle.setOrder(6); } } + + //建设方案 if(processBusinessHandle instanceof ConstructionPlanReviewHandle){ WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) .eq(WflowModels::getRegionCode, project.getAreaCode()) @@ -77,9 +81,15 @@ public class ProcessExecuteChainHandle { handles.add(processBusinessHandle); } } - continue; + }else if(processBusinessHandle instanceof ProvinceUnitedReviewHandle){ + //省级联审 + if (StateMachineUtils.isCityProject(project) && StateMachineUtils.judgeDeclareAmount(project, + ProjectDeclareConst.Number.DECLARE_AMOUNT_JUDGEMENT)){ + handles.add(processBusinessHandle); + } + }else{ + handles.add(processBusinessHandle); } - handles.add(processBusinessHandle); } handles = handles.stream() diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java index 4005e9b..5645ce5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java @@ -26,14 +26,14 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; * @author CMM * @since 2023/02/24 14:35 */ -@Order(7) +@Order(8) @Component public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { private final INdProjectStatusChangeService projectStatusChangeService; private final IProjectService projectService; private final AnnualPlanLibManage annualPlanLibManage; - private Integer order = 7; + private Integer order = 8; /** * 项目状态为:待立项批复之前的状态 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java index e61217d..b778224 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java @@ -31,7 +31,7 @@ import com.ningdatech.pmapi.common.constant.CommonConst; * @author CMM * @since 2023/02/24 14:35 */ -@Order(10) +@Order(11) @Component public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle { private final IProjectInstService projectInstService; @@ -40,7 +40,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle private final IProjectService projectService; - private Integer order = 10; + private Integer order = 11; public ProjectFinalInspectionHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils,IProjectService projectService){ this.projectInstService = projectInstService; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java index 81d9ed5..e71b0f8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectPreliminaryInspectionHandle.java @@ -29,13 +29,13 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; * @author CMM * @since 2023/02/24 14:35 */ -@Order(9) +@Order(10) @Component public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessHandle { private final INdProjectStatusChangeService projectStatusChangeService; private final IProjectService projectService; - private Integer order = 9; + private Integer order = 10; /** * 项目状态为:建设中及之后的状态 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java new file mode 100644 index 0000000..ed20a86 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProvinceUnitedReviewHandle.java @@ -0,0 +1,103 @@ +package com.ningdatech.pmapi.projectlib.handle; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.pmapi.common.constant.CommonConst; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; +import com.ningdatech.pmapi.projectlib.model.entity.Project; +import com.ningdatech.pmapi.projectlib.model.entity.ProjectStatusChange; +import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; +import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.wflow.workflow.bean.vo.ProcessDetailVO; +import com.wflow.workflow.enums.StepStatusEnum; +import org.apache.commons.lang3.StringUtils; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import java.util.List; +import java.util.Objects; + +/** + * 省级联审审核处理 + * + * @author CMM + * @since 2023/02/24 14:35 + */ +@Order(4) +@Component +public class ProvinceUnitedReviewHandle extends AbstractProcessBusinessHandle { + private final IProjectService projectService; + private final INdProjectStatusChangeService projectStatusChangeService; + + private Integer order = 4; + + public ProvinceUnitedReviewHandle(IProjectService projectService, + INdProjectStatusChangeService projectStatusChangeService){ + this.projectService = projectService; + this.projectStatusChangeService = projectStatusChangeService; + } + + @Override + void businessHandle(Long projectId, List processSchedule) { + ProcessDetailVO processDetailVO = new ProcessDetailVO(); + + //查询项目 + Project project = projectService.getNewProject(projectId); + List allVersionProjectId = projectService.getAllVersionProjectId(projectId); + + // 根据项目ID查询出部门联审流程的流程状态 + if (Objects.isNull(project) || StringUtils.isBlank(project.getSjlsResult())){ + processDetailVO.setStepStatus(StepStatusEnum.NOT_START); + processDetailVO.setProcessName(CommonConst.PROVINCE_UNITED_REVIEW); + processSchedule.add(processDetailVO); + return; + } + + Integer status = project.getStatus(); + if (ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode().equals(status)){ + processDetailVO.setStepStatus(StepStatusEnum.ON_GOING); + ProjectStatusChange startChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) + .in(ProjectStatusChange::getProjectId, allVersionProjectId) + .eq(ProjectStatusChange::getBeforeStatus, ProjectStatusEnum.PENDING_PREQUALIFICATION.getDesc()) + .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS)); + if(Objects.nonNull(startChange)){ + processDetailVO.setFinishTime(startChange.getCreateOn()); + } + } else if(status.compareTo(ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()) > 0){ + processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); + ProjectStatusChange passChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) + .in(ProjectStatusChange::getProjectId, allVersionProjectId) + .eq(ProjectStatusChange::getBeforeStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getDesc()) + .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS_SUCCESS)); + if(Objects.nonNull(passChange)){ + processDetailVO.setFinishTime(passChange.getCreateOn()); + } + }else if(status.compareTo(ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED.getCode()) > 0){ + processDetailVO.setStepStatus(StepStatusEnum.REJECTED); + ProjectStatusChange rejectChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) + .in(ProjectStatusChange::getProjectId, allVersionProjectId) + .eq(ProjectStatusChange::getBeforeStatus, ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getDesc()) + .eq(ProjectStatusChange::getAfterStatus, ProjectStatusEnum.THE_JOINT_REVIEW_OF_PROVINCIAL_DEPARTMENTS_FAILED)); + if(Objects.nonNull(rejectChange)){ + processDetailVO.setFinishTime(rejectChange.getCreateOn()); + } + }else{ + processDetailVO.setStepStatus(StepStatusEnum.NOT_START); + processDetailVO.setProcessName(CommonConst.PROVINCE_UNITED_REVIEW); + processSchedule.add(processDetailVO); + return; + } +// processDetailVO.setProcessProgressVo(project.getSjlsResult()); + processDetailVO.setContent(project.getSjlsResult()); + processDetailVO.setProcessName(CommonConst.PROVINCE_UNITED_REVIEW); + processSchedule.add(processDetailVO); + } + + @Override + Integer getOrder() { + return order; + } + + @Override + void setOrder(Integer order) { + this.order = order; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java index 00be16a..62f99c4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/TenderPurchaseHandle.java @@ -27,13 +27,13 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; * @author CMM * @since 2023/02/24 14:35 */ -@Order(8) +@Order(9) @Component public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { private final INdProjectStatusChangeService projectStatusChangeService; private final IProjectService projectService; - private Integer order = 8; + private Integer order = 9; /** * 项目状态为:建设中及之后的状态