@@ -8,6 +8,7 @@ import cn.hutool.core.collection.CollUtil; | |||||
import com.google.common.collect.Lists; | import com.google.common.collect.Lists; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import com.ningdatech.basic.util.NdDateUtils; | import com.ningdatech.basic.util.NdDateUtils; | ||||
import com.ningdatech.pmapi.common.constant.BizConst; | |||||
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.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; | import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; | ||||
@@ -61,10 +62,10 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle | |||||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | ||||
// 根据项目ID查询出建设方案评审流程的流程状态 | // 根据项目ID查询出建设方案评审流程的流程状态 | ||||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ||||
.eq(ProjectInst::getProjectId, projectId) | |||||
.in(ProjectInst::getProjectId, allVersionProjectIds) | |||||
.eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()) | .eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()) | ||||
.orderByDesc(ProjectInst::getCreatOn) | .orderByDesc(ProjectInst::getCreatOn) | ||||
.last("limit 1")); | |||||
.last(BizConst.LIMIT_1)); | |||||
ProcessProgressVo instanceDetail = null; | ProcessProgressVo instanceDetail = null; | ||||
// 未找到当前版本项目的建设方案审核流程且当前项目版本号大于1(是被驳回重新申报的项目) | // 未找到当前版本项目的建设方案审核流程且当前项目版本号大于1(是被驳回重新申报的项目) | ||||
if (Objects.isNull(projectInst)) { | if (Objects.isNull(projectInst)) { | ||||
@@ -56,6 +56,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { | |||||
void businessHandle(Long projectId, List<ProcessDetailVO> processSchedule) { | void businessHandle(Long projectId, List<ProcessDetailVO> processSchedule) { | ||||
ProcessDetailVO processDetailVO = new ProcessDetailVO(); | ProcessDetailVO processDetailVO = new ProcessDetailVO(); | ||||
Project project = projectService.getById(projectId); | Project project = projectService.getById(projectId); | ||||
if (Objects.isNull(project)){ | if (Objects.isNull(project)){ | ||||
throw new BizException("当前项目不存在!"); | throw new BizException("当前项目不存在!"); | ||||
} | } | ||||
@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.projectlib.handle; | |||||
import java.util.*; | import java.util.*; | ||||
import com.ningdatech.basic.util.CollUtils; | import com.ningdatech.basic.util.CollUtils; | ||||
import com.ningdatech.pmapi.common.constant.BizConst; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | import com.ningdatech.pmapi.projectlib.model.entity.Project; | ||||
import com.wflow.workflow.bean.vo.ProcessDetailVO; | import com.wflow.workflow.bean.vo.ProcessDetailVO; | ||||
import com.wflow.workflow.enums.StepStatusEnum; | import com.wflow.workflow.enums.StepStatusEnum; | ||||
@@ -68,6 +69,8 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { | |||||
ProcessDetailVO processDetailVO = new ProcessDetailVO(); | ProcessDetailVO processDetailVO = new ProcessDetailVO(); | ||||
Project project = projectService.getById(projectId); | Project project = projectService.getById(projectId); | ||||
//查出历史版本的 所有项目ID | |||||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||||
Integer status = project.getStatus(); | Integer status = project.getStatus(); | ||||
List<Integer> fieldList = CollUtils.fieldList(PROJECT_APPROVAL_LIST_STATUS, ProjectStatusEnum::getCode); | List<Integer> fieldList = CollUtils.fieldList(PROJECT_APPROVAL_LIST_STATUS, ProjectStatusEnum::getCode); | ||||
@@ -83,9 +86,9 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle { | |||||
if (ProjectStatusEnum.TO_BE_APPROVED.getCode().equals(status)){ | if (ProjectStatusEnum.TO_BE_APPROVED.getCode().equals(status)){ | ||||
// 根据建设方案评审通过的时间获取 | // 根据建设方案评审通过的时间获取 | ||||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | ||||
.eq(ProjectStatusChange::getProjectId, projectId) | |||||
.in(ProjectStatusChange::getProjectId, allVersionProjectIds) | |||||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PLAN_REVIEW_PASS.name()) | .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PLAN_REVIEW_PASS.name()) | ||||
.last("limit 1")); | |||||
.last(BizConst.LIMIT_1)); | |||||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | ||||
processDetailVO.setStepStatus(StepStatusEnum.ON_GOING); | processDetailVO.setStepStatus(StepStatusEnum.ON_GOING); | ||||
@@ -8,8 +8,10 @@ import cn.hutool.core.collection.CollUtil; | |||||
import com.google.common.collect.Lists; | import com.google.common.collect.Lists; | ||||
import com.ningdatech.basic.util.NdDateUtils; | import com.ningdatech.basic.util.NdDateUtils; | ||||
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; | import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum; | ||||
import com.ningdatech.pmapi.projectlib.model.entity.Project; | |||||
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | import com.ningdatech.pmapi.projectlib.service.IProjectInstService; | ||||
import com.ningdatech.pmapi.projectlib.service.IProjectService; | |||||
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | ||||
import com.wflow.workflow.bean.process.ProgressNode; | import com.wflow.workflow.bean.process.ProgressNode; | ||||
import com.wflow.workflow.bean.vo.ProcessDetailVO; | import com.wflow.workflow.bean.vo.ProcessDetailVO; | ||||
@@ -36,20 +38,26 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle | |||||
private final ProcessInstanceService processInstanceService; | private final ProcessInstanceService processInstanceService; | ||||
private final BuildUserUtils buildUserUtils; | private final BuildUserUtils buildUserUtils; | ||||
private final IProjectService projectService; | |||||
private Integer order = 10; | private Integer order = 10; | ||||
public ProjectFinalInspectionHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, BuildUserUtils buildUserUtils){ | |||||
public ProjectFinalInspectionHandle(IProjectInstService projectInstService, ProcessInstanceService processInstanceService, | |||||
BuildUserUtils buildUserUtils,IProjectService projectService){ | |||||
this.projectInstService = projectInstService; | this.projectInstService = projectInstService; | ||||
this.processInstanceService = processInstanceService; | this.processInstanceService = processInstanceService; | ||||
this.buildUserUtils = buildUserUtils; | this.buildUserUtils = buildUserUtils; | ||||
this.projectService = projectService; | |||||
} | } | ||||
@Override | @Override | ||||
void businessHandle(Long projectId, List<ProcessDetailVO> processSchedule) { | void businessHandle(Long projectId, List<ProcessDetailVO> processSchedule) { | ||||
ProcessDetailVO processDetailVO = new ProcessDetailVO(); | ProcessDetailVO processDetailVO = new ProcessDetailVO(); | ||||
Project project = projectService.getById(projectId); | |||||
//查出历史版本的 所有项目ID | |||||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||||
// 根据项目ID查询出项目终验流程的流程状态 | // 根据项目ID查询出项目终验流程的流程状态 | ||||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ||||
.eq(ProjectInst::getProjectId, projectId) | |||||
.in(ProjectInst::getProjectId, allVersionProjectIds) | |||||
.eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()) | .eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()) | ||||
.orderByDesc(ProjectInst::getCreatOn) | .orderByDesc(ProjectInst::getCreatOn) | ||||
.last("limit 1")); | .last("limit 1")); | ||||
@@ -4,7 +4,9 @@ import static com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum.*; | |||||
import java.util.Arrays; | import java.util.Arrays; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.stream.Collectors; | |||||
import com.ningdatech.pmapi.common.constant.BizConst; | |||||
import com.wflow.workflow.bean.vo.ProcessDetailVO; | import com.wflow.workflow.bean.vo.ProcessDetailVO; | ||||
import com.wflow.workflow.enums.StepStatusEnum; | import com.wflow.workflow.enums.StepStatusEnum; | ||||
import org.springframework.core.annotation.Order; | import org.springframework.core.annotation.Order; | ||||
@@ -55,7 +57,9 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH | |||||
ProcessDetailVO processDetailVO = new ProcessDetailVO(); | ProcessDetailVO processDetailVO = new ProcessDetailVO(); | ||||
// 根据项目状态是否在建设中及之后的状态判断项目初验是否开始 | // 根据项目状态是否在建设中及之后的状态判断项目初验是否开始 | ||||
List<Integer> fieldList = CollUtils.fieldList(PROJECT_PRELIMINARY_INSPECTION_LIST_STATUS, ProjectStatusEnum::getCode); | List<Integer> fieldList = CollUtils.fieldList(PROJECT_PRELIMINARY_INSPECTION_LIST_STATUS, ProjectStatusEnum::getCode); | ||||
Project project = projectService.getById(projectId); | |||||
Project project = projectService.getNewProject(projectId); | |||||
//查出历史版本的 所有项目ID | |||||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||||
Integer status = project.getStatus(); | Integer status = project.getStatus(); | ||||
// 项目状态不在建设中及之后的状态 | // 项目状态不在建设中及之后的状态 | ||||
if (!fieldList.contains(status)){ | if (!fieldList.contains(status)){ | ||||
@@ -71,9 +75,9 @@ public class ProjectPreliminaryInspectionHandle extends AbstractProcessBusinessH | |||||
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | ||||
// 根据初验备案的时间获取 | // 根据初验备案的时间获取 | ||||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | ||||
.eq(ProjectStatusChange::getProjectId, projectId) | |||||
.in(ProjectStatusChange::getProjectId, allVersionProjectIds) | |||||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD.name()) | .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PRELIMINARY_ACCEPTANCE_PUT_ON_RECORD.name()) | ||||
.last("limit 1")); | |||||
.last(BizConst.LIMIT_1)); | |||||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | ||||
} | } | ||||
processDetailVO.setProcessName(CommonConst.PROJECT_PRELIMINARY_INSPECTION); | processDetailVO.setProcessName(CommonConst.PROJECT_PRELIMINARY_INSPECTION); | ||||
@@ -56,9 +56,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { | |||||
ProcessDetailVO processDetailVO = new ProcessDetailVO(); | ProcessDetailVO processDetailVO = new ProcessDetailVO(); | ||||
// 根据项目是否通过立项批复(立项批复时间)来判断招标采购是否开始 | // 根据项目是否通过立项批复(立项批复时间)来判断招标采购是否开始 | ||||
Project project = projectService.getNewProject(projectId); | Project project = projectService.getNewProject(projectId); | ||||
List<Long> projectIds = projectService.list(Wrappers.lambdaQuery(Project.class) | |||||
.in(Project::getProjectCode, project.getProjectCode())).stream() | |||||
.map(Project::getId).collect(Collectors.toList()); | |||||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||||
Integer status = project.getStatus(); | Integer status = project.getStatus(); | ||||
// 未进行立项批复 | // 未进行立项批复 | ||||
if (Objects.isNull(project.getApprovalDate())){ | if (Objects.isNull(project.getApprovalDate())){ | ||||
@@ -75,7 +73,7 @@ public class TenderPurchaseHandle extends AbstractProcessBusinessHandle { | |||||
processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | processDetailVO.setStepStatus(StepStatusEnum.COMPLETED); | ||||
// 根据采购备案的时间获取 | // 根据采购备案的时间获取 | ||||
ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | ProjectStatusChange projectStatusChange = projectStatusChangeService.getOne(Wrappers.lambdaQuery(ProjectStatusChange.class) | ||||
.in(ProjectStatusChange::getProjectId, projectIds) | |||||
.in(ProjectStatusChange::getProjectId, allVersionProjectIds) | |||||
.eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD.name()) | .eq(ProjectStatusChange::getEvent, ProjectStatusChangeEvent.PURCHASE_PUT_ON_RECORD.name()) | ||||
.last(BizConst.LIMIT_1)); | .last(BizConst.LIMIT_1)); | ||||
processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | processDetailVO.setFinishTime(projectStatusChange.getCreateOn()); | ||||
@@ -61,9 +61,10 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { | |||||
void businessHandle(Long projectId, List<ProcessDetailVO> processSchedule) { | void businessHandle(Long projectId, List<ProcessDetailVO> processSchedule) { | ||||
ProcessDetailVO processDetailVO = new ProcessDetailVO(); | ProcessDetailVO processDetailVO = new ProcessDetailVO(); | ||||
Project project = projectService.getById(projectId); | Project project = projectService.getById(projectId); | ||||
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project); | |||||
// 根据项目ID查询出单位内部审核流程的流程状态 | // 根据项目ID查询出单位内部审核流程的流程状态 | ||||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) | ||||
.eq(ProjectInst::getProjectId, projectId) | |||||
.in(ProjectInst::getProjectId, allVersionProjectIds) | |||||
.eq(ProjectInst::getInstType, InstTypeEnum.UNIT_INNER_AUDIT.getCode()) | .eq(ProjectInst::getInstType, InstTypeEnum.UNIT_INNER_AUDIT.getCode()) | ||||
.orderByDesc(ProjectInst::getCreatOn) | .orderByDesc(ProjectInst::getCreatOn) | ||||
.last("limit 1")); | .last("limit 1")); | ||||