From 947a214b5309264421de976ed3c0b2f0adc4a6c9 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Thu, 20 Jul 2023 22:58:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=BA=93=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/ConstructionPlanManage.java | 15 +++----- .../pmapi/projectlib/manage/ProjectLibManage.java | 40 +++++----------------- .../model/entity/ProjectApplication.java | 3 ++ .../pmapi/todocenter/manage/TodoCenterManage.java | 5 +++ 4 files changed, 21 insertions(+), 42 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java index 57a5ef0..545811c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java @@ -130,7 +130,7 @@ public class ConstructionPlanManage { projectInfo.setSuperOrg(user.getEmpPosUnitName()); } - //如果是重新提交的话 判断下 项目是否存在 + //如果是撤回重新提交的话 判断下 项目是否存在 if(Objects.nonNull(projectInfo.getId())){ //新申报的项目不允许带项目id projectInfo.setId(null); @@ -175,14 +175,7 @@ public class ConstructionPlanManage { log.info("建设方案项目申报成功 【{}】", instanceId); // 保存建设项目相关 - Project buildProject; - if (dto.getRestart()){ - // 如果是重新提交,不用生成新版本 - modifyProject(oldProject, instanceId, oldProject.getConstructionPlanFile()); - buildProject = oldProject; - }else { - buildProject = projectLibManage.saveConstructProjectInDeclared(projectInfo,instanceId,employeeCode,oldProject); - } + Project buildProject = projectLibManage.saveConstructProjectInDeclared(projectInfo,instanceId,employeeCode,oldProject); //发送给第一个审批人消息 noticeManage.sendFirtUser(buildProject,model.getFormName(),instanceId, @@ -192,7 +185,7 @@ public class ConstructionPlanManage { } /** - * 重新建设方案 + * 驳回 重新提交建设方案 * * @param dto * @return @@ -217,7 +210,7 @@ public class ConstructionPlanManage { } /** - * 提交预审项目 时 更新信息 + * 提交建设方案项目 时 更新信息 * * @param project * @param 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 b072ec6..9569fa6 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 @@ -370,6 +370,7 @@ public class ProjectLibManage { projectApplication.setProjectCode(finalProject.getProjectCode()); projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode()); projectApplication.setBuildOrgName(finalProject.getBuildOrgName()); + projectApplication.setIsConstruct(Boolean.TRUE); return projectApplication; }).collect(Collectors.toList()); projectApplicationService.saveBatch(applications); @@ -492,6 +493,7 @@ public class ProjectLibManage { app.setProjectId(project.getId()); app.setBuildOrgName(project.getBuildOrgName()); app.setBuildOrgCode(project.getBuildOrgCode()); + app.setIsConstruct(Boolean.TRUE); return app; }) .collect(Collectors.toList()); @@ -673,28 +675,10 @@ public class ProjectLibManage { vo.buildDynamicForm(projectInfo.getDynamicForm()); // 查询应用 List applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectCode, vo.getProjectCode())); - - // 查出同一项目编号,建设方案申报前的项目ID - List projectIdList = projectService.list(Wrappers.lambdaQuery(Project.class) - .eq(Project::getProjectCode, projectInfo.getProjectCode()) - .eq(Project::getIsConstruct, Boolean.FALSE)).stream() - .map(Project::getId).collect(Collectors.toList()); - List applicationList; - // 如果是建设方案申报后的项目,过滤掉初步方案的应用信息 - if (Boolean.TRUE.equals(projectInfo.getIsConstruct())){ - applicationList = applications.stream() - .filter(a -> !projectIdList.contains(a.getProjectCode())) - .collect(Collectors.toList()); - } - // 如果不是,展示初步方案的应用信息 - else { - applicationList = applications.stream() - .filter(a -> projectIdList.contains(a.getProjectCode())) - .collect(Collectors.toList()); - } + .eq(ProjectApplication::getProjectCode, vo.getProjectCode()) + .eq(ProjectApplication::getIsConstruct,projectInfo.getIsConstruct())); - Optional.ofNullable(applicationList).ifPresent(apps -> + Optional.ofNullable(applications).ifPresent(apps -> vo.setProjectApplications(CollUtils.convert(apps, ProjectHelper::convertVO) )); @@ -781,20 +765,14 @@ public class ProjectLibManage { vo.buildDynamicForm(projectInfo.getDynamicForm()); // 查询应用 List applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) - .eq(ProjectApplication::getProjectCode, vo.getProjectCode())); - // 查出同一项目编号,建设方案申报前的项目ID - List projectIdList = projectService.list(Wrappers.lambdaQuery(Project.class) - .eq(Project::getProjectCode, projectInfo.getProjectCode()) - .eq(Project::getIsConstruct, Boolean.FALSE)).stream() - .map(Project::getId).collect(Collectors.toList()); - List applicationList = applications.stream() - .filter(a -> projectIdList.contains(a.getProjectId())) - .collect(Collectors.toList()); + .eq(ProjectApplication::getProjectCode, vo.getProjectCode()) + .eq(ProjectApplication::getIsConstruct,Boolean.FALSE)); - Optional.ofNullable(applicationList).ifPresent(apps -> + Optional.ofNullable(applications).ifPresent(apps -> vo.setProjectApplications(CollUtils.convert(apps, ProjectHelper::convertVO) )); + return vo; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java index 0c46a0f..8ccc09a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectApplication.java @@ -181,4 +181,7 @@ public class ProjectApplication implements Serializable { @ApiModelProperty("项目编码") private String projectCode; + + @ApiModelProperty("是否为建设方案申报") + private Boolean isConstruct; } 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 82632bf..19b5943 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 @@ -1107,6 +1107,11 @@ public class TodoCenterManage { projectApplication.setId(null); projectApplication.setProjectId(project.getId()); projectApplication.setProjectCode(project.getProjectCode()); + if (!InstTypeEnum.UNIT_INNER_AUDIT.getCode().equals(instType) && + !InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType) && + !InstTypeEnum.DEPT_UNITED_REVIEW.getCode().equals(instType)) { + projectApplication.setIsConstruct(Boolean.TRUE); + } return projectApplication; }).collect(Collectors.toList()); projectApplicationService.saveBatch(applications);