@@ -21,7 +21,9 @@ public interface CommonConst { | |||||
String PROJECT_DECLARE = "项目申报"; | String PROJECT_DECLARE = "项目申报"; | ||||
String UNIT_INNER_AUDIT = "单位内部审核"; | String UNIT_INNER_AUDIT = "单位内部审核"; | ||||
String PRELIMINARY_PREVIEW = "项目预审"; | String PRELIMINARY_PREVIEW = "项目预审"; | ||||
String DEPT_UNITED_REVIEW = "部门联审"; | String DEPT_UNITED_REVIEW = "部门联审"; | ||||
String PROVINCE_UNITED_REVIEW = "省级部门联审"; | |||||
String ANNUAL_PLAN = "年度计划"; | String ANNUAL_PLAN = "年度计划"; | ||||
String CONSTRUCTION_PLAN_REVIEW = "建设方案评审"; | String CONSTRUCTION_PLAN_REVIEW = "建设方案评审"; | ||||
String PROJECT_APPROVAL = "立项批复"; | String PROJECT_APPROVAL = "立项批复"; | ||||
@@ -28,13 +28,13 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/02/24 14:35 | * @since 2023/02/24 14:35 | ||||
*/ | */ | ||||
@Order(5) | |||||
@Order(6) | |||||
@Component | @Component | ||||
public class AnnualPlanHandle extends AbstractProcessBusinessHandle { | public class AnnualPlanHandle extends AbstractProcessBusinessHandle { | ||||
private final INdProjectStatusChangeService projectStatusChangeService; | private final INdProjectStatusChangeService projectStatusChangeService; | ||||
private final IProjectService projectService; | private final IProjectService projectService; | ||||
private Integer order = 5; | |||||
private Integer order = 6; | |||||
/** | /** | ||||
* 项目状态为:年度计划中之前的状态 | * 项目状态为:年度计划中之前的状态 | ||||
@@ -24,13 +24,13 @@ import com.ningdatech.pmapi.projectlib.service.INdProjectStatusChangeService; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/02/24 14:35 | * @since 2023/02/24 14:35 | ||||
*/ | */ | ||||
@Order(11) | |||||
@Order(12) | |||||
@Component | @Component | ||||
public class ArchivedHandle extends AbstractProcessBusinessHandle { | public class ArchivedHandle extends AbstractProcessBusinessHandle { | ||||
private final IProjectService projectService; | private final IProjectService projectService; | ||||
private final INdProjectStatusChangeService projectStatusChangeService; | private final INdProjectStatusChangeService projectStatusChangeService; | ||||
private Integer order = 11; | |||||
private Integer order = 12; | |||||
public ArchivedHandle( IProjectService projectService, INdProjectStatusChangeService projectStatusChangeService){ | public ArchivedHandle( IProjectService projectService, INdProjectStatusChangeService projectStatusChangeService){ | ||||
this.projectService = projectService; | this.projectService = projectService; | ||||
@@ -34,7 +34,7 @@ import com.wflow.workflow.service.ProcessInstanceService; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/02/24 14:35 | * @since 2023/02/24 14:35 | ||||
*/ | */ | ||||
@Order(6) | |||||
@Order(7) | |||||
@Component | @Component | ||||
public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle { | public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle { | ||||
@@ -44,7 +44,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle | |||||
private final ProjectVersionUtil projectVersionUtil; | private final ProjectVersionUtil projectVersionUtil; | ||||
private final IProjectService projectService; | private final IProjectService projectService; | ||||
private Integer order = 6; | |||||
private Integer order = 7; | |||||
public ConstructionPlanReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils, ProjectVersionUtil projectVersionUtil, IProjectService projectService){ | public ConstructionPlanReviewHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils, ProjectVersionUtil projectVersionUtil, IProjectService projectService){ | ||||
this.projectInstService = projectInstService; | this.projectInstService = projectInstService; | ||||
@@ -32,7 +32,7 @@ import com.wflow.workflow.service.ProcessInstanceService; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/02/24 14:35 | * @since 2023/02/24 14:35 | ||||
*/ | */ | ||||
@Order(4) | |||||
@Order(5) | |||||
@Component | @Component | ||||
public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { | public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { | ||||
@@ -43,7 +43,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { | |||||
private final BuildUserUtils buildUserUtils; | private final BuildUserUtils buildUserUtils; | ||||
private final ProjectVersionUtil projectVersionUtil; | private final ProjectVersionUtil projectVersionUtil; | ||||
private Integer order = 4; | |||||
private Integer order = 5; | |||||
public DeptUnitedReviewHandle(IProjectInstService projectInstService,IProjectService projectService | public DeptUnitedReviewHandle(IProjectInstService projectInstService,IProjectService projectService | ||||
, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils, | , ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils, | ||||
@@ -3,8 +3,10 @@ package com.ningdatech.pmapi.projectlib.handle; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.google.common.collect.Lists; | import com.google.common.collect.Lists; | ||||
import com.ningdatech.pmapi.common.constant.BizConst; | 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.enumeration.ProjectProcessStageEnum; | ||||
import com.ningdatech.pmapi.common.statemachine.contants.RegionContant; | 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.model.entity.Project; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | import com.ningdatech.pmapi.projectlib.service.IProjectService; | ||||
import com.wflow.bean.entity.WflowModels; | import com.wflow.bean.entity.WflowModels; | ||||
@@ -67,6 +69,8 @@ public class ProcessExecuteChainHandle { | |||||
processBusinessHandle.setOrder(6); | processBusinessHandle.setOrder(6); | ||||
} | } | ||||
} | } | ||||
//建设方案 | |||||
if(processBusinessHandle instanceof ConstructionPlanReviewHandle){ | if(processBusinessHandle instanceof ConstructionPlanReviewHandle){ | ||||
WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) | ||||
.eq(WflowModels::getRegionCode, project.getAreaCode()) | .eq(WflowModels::getRegionCode, project.getAreaCode()) | ||||
@@ -77,9 +81,15 @@ public class ProcessExecuteChainHandle { | |||||
handles.add(processBusinessHandle); | 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() | handles = handles.stream() | ||||
@@ -26,14 +26,14 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/02/24 14:35 | * @since 2023/02/24 14:35 | ||||
*/ | */ | ||||
@Order(7) | |||||
@Order(8) | |||||
@Component | @Component | ||||
public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { | public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { | ||||
private final INdProjectStatusChangeService projectStatusChangeService; | private final INdProjectStatusChangeService projectStatusChangeService; | ||||
private final IProjectService projectService; | private final IProjectService projectService; | ||||
private final AnnualPlanLibManage annualPlanLibManage; | private final AnnualPlanLibManage annualPlanLibManage; | ||||
private Integer order = 7; | |||||
private Integer order = 8; | |||||
/** | /** | ||||
* 项目状态为:待立项批复之前的状态 | * 项目状态为:待立项批复之前的状态 | ||||
@@ -31,7 +31,7 @@ import com.ningdatech.pmapi.common.constant.CommonConst; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/02/24 14:35 | * @since 2023/02/24 14:35 | ||||
*/ | */ | ||||
@Order(10) | |||||
@Order(11) | |||||
@Component | @Component | ||||
public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle { | public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle { | ||||
private final IProjectInstService projectInstService; | private final IProjectInstService projectInstService; | ||||
@@ -40,7 +40,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle | |||||
private final IProjectService projectService; | private final IProjectService projectService; | ||||
private Integer order = 10; | |||||
private Integer order = 11; | |||||
public ProjectFinalInspectionHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, | public ProjectFinalInspectionHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, | ||||
BuildUserUtils buildUserUtils,IProjectService projectService){ | BuildUserUtils buildUserUtils,IProjectService projectService){ | ||||
this.projectInstService = projectInstService; | this.projectInstService = projectInstService; | ||||
@@ -29,13 +29,13 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/02/24 14:35 | * @since 2023/02/24 14:35 | ||||
*/ | */ | ||||
@Order(9) | |||||
@Order(10) | |||||
@Component | @Component | ||||
public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessHandle { | public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessHandle { | ||||
private final INdProjectStatusChangeService projectStatusChangeService; | private final INdProjectStatusChangeService projectStatusChangeService; | ||||
private final IProjectService projectService; | private final IProjectService projectService; | ||||
private Integer order = 9; | |||||
private Integer order = 10; | |||||
/** | /** | ||||
* 项目状态为:建设中及之后的状态 | * 项目状态为:建设中及之后的状态 | ||||
@@ -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<ProcessDetailVO> processSchedule) { | |||||
ProcessDetailVO processDetailVO = new ProcessDetailVO(); | |||||
//查询项目 | |||||
Project project = projectService.getNewProject(projectId); | |||||
List<Long> 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; | |||||
} | |||||
} |
@@ -27,13 +27,13 @@ import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||||
* @author CMM | * @author CMM | ||||
* @since 2023/02/24 14:35 | * @since 2023/02/24 14:35 | ||||
*/ | */ | ||||
@Order(8) | |||||
@Order(9) | |||||
@Component | @Component | ||||
public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { | public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { | ||||
private final INdProjectStatusChangeService projectStatusChangeService; | private final INdProjectStatusChangeService projectStatusChangeService; | ||||
private final IProjectService projectService; | private final IProjectService projectService; | ||||
private Integer order = 8; | |||||
private Integer order = 9; | |||||
/** | /** | ||||
* 项目状态为:建设中及之后的状态 | * 项目状态为:建设中及之后的状态 | ||||