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 7aca628..5b040fd 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 @@ -12,6 +12,7 @@ import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; +import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant; import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.wflow.workflow.bean.process.ProgressNode; import com.wflow.workflow.bean.vo.ProcessDetailVO; @@ -64,6 +65,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()) + .ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) .orderByDesc(ProjectInst::getCreatOn) .last(BizConst.LIMIT_1)); ProcessProgressVo instanceDetail = null; 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 5ecc257..a93b73e 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 @@ -10,6 +10,7 @@ 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.constant.TodoCenterConstant; import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.wflow.workflow.bean.process.ProgressNode; import com.wflow.workflow.bean.vo.ProcessDetailVO; @@ -66,6 +67,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.DEPT_UNITED_REVIEW.getCode()) + .ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) .orderByDesc(ProjectInst::getCreatOn) .last(BizConst.LIMIT_1)); if (Objects.isNull(projectInst)){ diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java index c4a1843..61e8bb0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java @@ -12,6 +12,7 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; +import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant; import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.wflow.workflow.bean.process.ProgressNode; import com.wflow.workflow.bean.vo.ProcessDetailVO; @@ -65,6 +66,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { .eq(ProjectInst::getProjectId, projectId) .eq(ProjectInst::getInstType, InstTypeEnum.PRELIMINARY_PREVIEW.getCode()) .orderByDesc(ProjectInst::getCreatOn) + .ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) .last("limit 1")); ProcessProgressVo instanceDetail = null; // 未找到当前版本项目的预审审核流程且当前项目版本号大于1(是被驳回重新申报的项目或者建设方案申报的项目) 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 659b22d..0eef546 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 @@ -13,6 +13,7 @@ import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst; import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.projectlib.service.IProjectService; +import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant; import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.wflow.workflow.bean.process.ProgressNode; import com.wflow.workflow.bean.vo.ProcessDetailVO; @@ -60,6 +61,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()) + .ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) .orderByDesc(ProjectInst::getCreatOn) .last(BizConst.LIMIT_1)); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java index 14b592b..776f5ca 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java @@ -20,6 +20,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectInstService; import com.ningdatech.pmapi.common.constant.CommonConst; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil; +import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant; import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; import com.wflow.workflow.bean.dto.ProcessInstanceUserDto; import com.wflow.workflow.bean.process.ProgressNode; @@ -67,6 +68,7 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.UNIT_INNER_AUDIT.getCode()) + .ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) .orderByDesc(ProjectInst::getCreatOn) .last(BizConst.LIMIT_1)); ProcessProgressVo instanceDetail = null; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index d1be954..e087662 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -653,10 +653,7 @@ public class TodoCenterManage { List projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) .in(ProjectInst::getProjectId, projectIdList) .orderByDesc(ProjectInst::getProjectId)); - Map projectInfoMap = projectInstList.stream() - .filter(p -> Objects.nonNull(p.getInstCode()) && - !TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode())) - .collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId()))); + Map projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId()))); List instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); // 查出用户工作流 @@ -796,10 +793,7 @@ public class TodoCenterManage { List projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) .in(ProjectInst::getProjectId, projectIdList) .orderByDesc(ProjectInst::getProjectId)); - Map projectInfoMap = projectInstList.stream() - .filter(p -> Objects.nonNull(p.getInstCode()) && - !TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode())) - .collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId()))); + Map projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId()))); List instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); // 查出用户工作流 @@ -1106,18 +1100,15 @@ public class TodoCenterManage { project.setId(null); project.setCreateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now()); - project.setIsBackReject(Boolean.FALSE); projectService.save(project); - oldProject.setIsBackReject(Boolean.TRUE); - projectService.updateById(oldProject); - ProjectInst oldInst = projectInstService.getOne(Wrappers.lambdaUpdate(ProjectInst.class) .eq(ProjectInst::getProjectId, oldProject.getId()) .eq(ProjectInst::getInstCode, oldProject.getInstCode())); String instCode = oldProject.getInstCode(); - projectInstService.removeById(oldInst); + oldInst.setInstCode(TodoCenterConstant.Declared.NULL_INST_CODE); + projectInstService.updateById(oldInst); ProjectInst newPi = new ProjectInst(); newPi.setProjectId(project.getId()); @@ -1145,6 +1136,9 @@ public class TodoCenterManage { .eq(ProjectApplication::getIsConstruct, Boolean.TRUE)); if (CollUtil.isNotEmpty(applicationList)) { projectApplicationService.removeBatchByIds(applicationList); + List applicationIds = applicationList.stream().map(ProjectApplication::getId).collect(Collectors.toList()); +// projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) +// .in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); } List applications = projectDto.getApplicationList(); @@ -1162,11 +1156,19 @@ public class TodoCenterManage { !InstTypeEnum.DEPT_UNITED_REVIEW.getCode().equals(instType)) { projectApplication.setIsConstruct(Boolean.TRUE); } - if(StringUtils.isNotBlank(application.getRelatedExistsApplication())){ - projectApplication.setApplicationName(null); - } projectApplication.setProjectVersion(project.getVersion()); - projectApplicationService.save(projectApplication); + boolean result = projectApplicationService.save(projectApplication); +// // 保存应用关联的核心业务 +// List coreBusinessList = application.getCoreBusinessList(); +// Boolean hasCoreBusiness = CollUtil.isNotEmpty(coreBusinessList) ? Boolean.TRUE : Boolean.FALSE; +// if (Boolean.TRUE.equals(result) && Boolean.TRUE.equals(hasCoreBusiness)){ +// for (ProjectCoreBusinessDTO coreBusiness : coreBusinessList) { +// ProjectCoreBusinessIndicators projectCoreBusinessIndicators = new ProjectCoreBusinessIndicators(); +// BeanUtils.copyProperties(coreBusiness, projectCoreBusinessIndicators); +// projectCoreBusinessIndicators.setApplicationId(application.getId()); +// projectCoreBusinessIndicatorsService.save(projectCoreBusinessIndicators); +// } +// } } } return Boolean.TRUE;