From f1079d561df741a3f80c61ceaabc2c9564ea1c92 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 11:58:03 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E7=89=88=E6=9C=AC=20?= =?UTF-8?q?=E5=8F=AA=E7=9C=8B=20=E5=BD=93=E5=89=8D=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=92=8C=E9=80=80=E5=9B=9E=20=E9=A9=B3=E5=9B=9E=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectdeclared/manage/FinalAcceptanceManage.java | 6 ++++-- .../pmapi/projectdeclared/manage/ReviewByDeptJointManage.java | 3 --- .../ningdatech/pmapi/projectlib/manage/ProjectLibManage.java | 10 +++++++++- .../com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java | 3 +++ .../com/ningdatech/pmapi/projectlib/model/entity/Project.java | 4 ++++ .../ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java | 3 +++ .../ningdatech/pmapi/todocenter/manage/TodoCenterManage.java | 1 + 7 files changed, 24 insertions(+), 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java index d2e15d5..5fa6eb9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java @@ -238,7 +238,8 @@ public class FinalAcceptanceManage { //保存终验项目 //生成新版本 并且进入下一状态 - projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()); + projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, + InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE); //发送给第一个审批人消息 noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, @@ -298,7 +299,8 @@ public class FinalAcceptanceManage { //保存终验项目 //生成新版本 并且进入下一状态 - projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()); + projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, + InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE); //发送给第一个审批人消息 noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java index c318a54..577c0c5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java @@ -102,9 +102,6 @@ public class ReviewByDeptJointManage { //保存项目信息 projectInfo = projectLibManage.saveProjectWithVersion(projectInfo,instanceId,ProjectProcessStageEnum.DEPARTMENT_JOINT_APPROVAL_PROCESS.getCode()); -// if(!modifyProject(projectInfo, instanceId)){ -// return Boolean.FALSE; -// } //发送给第一个审批人消息 noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId, diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 559ab06..4f5afa6 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -317,6 +317,7 @@ public class ProjectLibManage { project.setVersion(oldProject.getVersion() + 1); // 标记为建设方案申报 project.setIsConstruct(Boolean.TRUE); + project.setIsBackReject(Boolean.FALSE); // 保存初步方案项目ID if (Boolean.TRUE.equals(oldProject.getIsConstruct())) { // 重新提交 @@ -384,6 +385,7 @@ public class ProjectLibManage { project.setId(null); project.setCreateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now()); + project.setIsBackReject(Boolean.TRUE); stateMachineUtils.pass(project); projectService.save(project); @@ -410,6 +412,8 @@ public class ProjectLibManage { project.setId(null); project.setCreateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now()); + //都是在驳回 重新提交时用的 + project.setIsBackReject(Boolean.TRUE); if (Objects.nonNull(stageCode)) { project.setStage(stageCode); } @@ -500,7 +504,7 @@ public class ProjectLibManage { return project; } - public Project saveProjectWithVersionAndPass(Project oldProject, String instanceId, Integer instType) { + public Project saveProjectWithVersionAndPass(Project oldProject, String instanceId, Integer instType,Boolean isBackReject) { Project project = new Project(); VUtils.isTrue(Objects.isNull(oldProject)) .throwMessage("项目不存在!"); @@ -513,6 +517,7 @@ public class ProjectLibManage { project.setUpdateOn(LocalDateTime.now()); // 标识保存的项目信息是否为建设方案申报项目 project.setIsConstruct(Boolean.TRUE); + project.setIsBackReject(isBackReject); stateMachineUtils.pass(project); if (projectService.save(project)) { @@ -1020,8 +1025,11 @@ public class ProjectLibManage { return res; } + //只查 当前版本 和历史被驳回|退回的版本 List historyProjects = projectService.list(Wrappers.lambdaQuery(Project.class) .eq(Project::getProjectCode, project.getProjectCode()) + .and(q1->q1.eq(Project::getNewest, Boolean.TRUE) + .or(q2->q2.eq(Project::getIsBackReject,Boolean.TRUE))) .orderByDesc(Project::getCreateOn)); if (CollUtil.isEmpty(historyProjects)) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java index 8c38403..06edaf1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java @@ -317,4 +317,7 @@ public class ProjectDTO implements Serializable { @ApiModelProperty("项目类型 01首次建设;02迭代升级;03结转建设;04新运维;05续运维") private String baseProjType; + + @ApiModelProperty("是否退回|驳回的项目版本") + private Boolean isBackReject = Boolean.FALSE; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java index 6856b51..fcb7571 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java @@ -483,4 +483,8 @@ public class Project implements Serializable { @ApiModelProperty("区县预审本级主管单位盖章审核日期") private String countrySealAuditDate; + + @ApiModelProperty("是否退回|驳回的项目版本") + private Boolean isBackReject; + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java index 21ded6a..edaab44 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java @@ -395,6 +395,9 @@ public class ProjectDetailVO { @ApiModelProperty("审批详情") private ProcessProgressDetailVo process; + @ApiModelProperty("是否退回|驳回的项目版本") + private Boolean isBackReject; + public String getVersionStr() { if (Objects.nonNull(this.newest) && this.newest) { this.versionStr = "当前版本"; 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 25c3b0f..04d8341 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 @@ -1106,6 +1106,7 @@ public class TodoCenterManage { project.setId(null); project.setCreateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now()); + project.setIsBackReject(Boolean.TRUE); projectService.save(project); ProjectInst oldInst = projectInstService.getOne(Wrappers.lambdaUpdate(ProjectInst.class) From 81a1093ee485b1ad7fa75e5ae510ac1d20e0a29c Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 14:04:43 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E7=89=88=E6=9C=AC=20?= =?UTF-8?q?=E5=8F=AA=E7=9C=8B=20=E5=BD=93=E5=89=8D=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=92=8C=E9=80=80=E5=9B=9E=20=E9=A9=B3=E5=9B=9E=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 20 ++++++++++++++++---- .../pmapi/todocenter/manage/TodoCenterManage.java | 5 ++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 4f5afa6..cd7651f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -385,10 +385,13 @@ public class ProjectLibManage { project.setId(null); project.setCreateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now()); - project.setIsBackReject(Boolean.TRUE); + project.setIsBackReject(Boolean.FALSE); stateMachineUtils.pass(project); projectService.save(project); + oldProject.setIsBackReject(Boolean.TRUE); + projectService.updateById(oldProject); + projectService.update(Wrappers.lambdaUpdate(Project.class) .set(Project::getNewest, Boolean.FALSE) .ne(Project::getId, project.getId()) @@ -413,7 +416,7 @@ public class ProjectLibManage { project.setCreateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now()); //都是在驳回 重新提交时用的 - project.setIsBackReject(Boolean.TRUE); + project.setIsBackReject(Boolean.FALSE); if (Objects.nonNull(stageCode)) { project.setStage(stageCode); } @@ -421,6 +424,9 @@ public class ProjectLibManage { project.setStatus(statusCode); } + oldProject.setIsBackReject(Boolean.TRUE); + projectService.updateById(oldProject); + if (projectService.save(project)) { projectService.update(Wrappers.lambdaUpdate(Project.class) .set(Project::getNewest, Boolean.FALSE) @@ -516,10 +522,13 @@ public class ProjectLibManage { project.setCreateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now()); // 标识保存的项目信息是否为建设方案申报项目 - project.setIsConstruct(Boolean.TRUE); + project.setIsConstruct(Boolean.FALSE); project.setIsBackReject(isBackReject); stateMachineUtils.pass(project); + oldProject.setIsBackReject(Boolean.TRUE); + projectService.updateById(oldProject); + if (projectService.save(project)) { //保存项目和实例的关系 ProjectInst projectInst = new ProjectInst(); @@ -554,9 +563,12 @@ public class ProjectLibManage { project.setCreateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now()); // 标识保存的项目信息是否为建设方案申报项目 - project.setIsConstruct(Boolean.TRUE); + project.setIsConstruct(Boolean.FALSE); stateMachineUtils.pass(project); + oldProject.setIsBackReject(Boolean.TRUE); + projectService.updateById(oldProject); + if (projectService.save(project)) { //保存项目和实例的关系 ProjectInst projectInst = new ProjectInst(); 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 04d8341..49220b8 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 @@ -1106,9 +1106,12 @@ public class TodoCenterManage { project.setId(null); project.setCreateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now()); - project.setIsBackReject(Boolean.TRUE); + 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())); From a1be9aaa8933a2c7e42a2afeb8c6dea93798e85d Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 15:14:00 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=AE=9E=E4=BE=8B=20=E4=B8=8D=E8=A6=81EMPTY?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 49220b8..d1be954 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 @@ -1117,8 +1117,7 @@ public class TodoCenterManage { .eq(ProjectInst::getInstCode, oldProject.getInstCode())); String instCode = oldProject.getInstCode(); - oldInst.setInstCode("EMPTY"); - projectInstService.updateById(oldInst); + projectInstService.removeById(oldInst); ProjectInst newPi = new ProjectInst(); newPi.setProjectId(project.getId()); From bac19ceaa4ae3cecae2af33d64dd0f4c412b3f00 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 3 Aug 2023 16:35:37 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E7=89=88=E6=9C=AC=20=E6=B5=81=E7=A8=8B=E5=AE=9E=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handle/ConstructionPlanReviewHandle.java | 2 ++ .../projectlib/handle/DeptUnitedReviewHandle.java | 2 ++ .../handle/PreliminaryPreviewHandle.java | 2 ++ .../handle/ProjectFinalInspectionHandle.java | 2 ++ .../projectlib/handle/UnitInnerAuditHandle.java | 2 ++ .../pmapi/todocenter/manage/TodoCenterManage.java | 36 ++++++++++++---------- 6 files changed, 29 insertions(+), 17 deletions(-) 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;