From 1f810df013f293f23eb8616c4d0718c683156311 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 20 Apr 2023 17:34:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=81=E7=BA=A7=E8=81=94=E5=AE=A1=20?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/ReviewByProvincialDeptManage.java | 21 ++++++++++++++++++--- .../pmapi/projectlib/manage/ProjectLibManage.java | 15 +++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java index 794fc73..ba4cbed 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java @@ -13,11 +13,15 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.ningdatech.pmapi.provincial.service.IJoinReviewProvincialBureauService; +import com.ningdatech.pmapi.staging.service.IProjectStagingService; +import com.ningdatech.pmapi.todocenter.constant.TodoCenterContant; import com.wflow.exception.BusinessException; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; import java.util.List; import java.util.Objects; @@ -42,6 +46,8 @@ public class ReviewByProvincialDeptManage { private final ProjectLibManage projectLibManage; + private final IProjectStagingService projectStagingService; + /** * 省级部门联审 * @param project @@ -95,8 +101,17 @@ public class ReviewByProvincialDeptManage { ApplicationConverter.convertProject(projectInfo,applications,fileService))){ throw new BusinessException("提交省级部门联审失败"); } - projectInfo = projectLibManage.saveProjectWithVersionAndStatus(project,null, - ProjectStatusEnum.JOINT_REVIEW_BY_PROVINCIAL_DEPARTMENTS.getCode()); - return String.valueOf(projectInfo.getId()); + Project p = projectLibManage.saveProjectWithVersionAndStatus(project,null, + ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode()); + + //入库暂存表 后续处理 对接外部接口 + projectInfo.setUpdateOn(LocalDateTime.now()); + //保存一下 当前的主管单位发起人 + projectInfo.setPreStartUserId(p.getSponsor()); + //当前实例置为空 + projectInfo.setInstCode(TodoCenterContant.Declared.NULL_INST_CODE); + projectStagingService.addByProject(projectInfo,"省级部门联审-重新提交"); + declaringDTO.getProjectInfo().setId(p.getId()); + return String.valueOf(p.getId()); } } 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 006964d..c2c8568 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 @@ -304,13 +304,28 @@ public class ProjectLibManage { if(Objects.nonNull(statusCode)){ project.setStatus(statusCode); } + if(projectService.save(project)){ projectService.update(Wrappers.lambdaUpdate(Project.class) .set(Project::getNewest,Boolean.FALSE) .ne(Project::getId,project.getId()) .eq(Project::getProjectCode,project.getProjectCode())); + + //继承它的app + List apps = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) + .eq(ProjectApplication::getProjectId, oldProject.getId())); + if(CollUtil.isNotEmpty(apps)){ + List newApps = apps.stream() + .map(a -> { + a.setProjectId(project.getId()); + return a; + }) + .collect(Collectors.toList()); + projectApplicationService.saveBatch(newApps); + } } + return project; }