From 207f717a7cc41c4e5db4e07cdb8c617527d9eae2 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Fri, 14 Jul 2023 10:24:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=BA=E8=AE=BE=E6=96=B9=E6=A1=88=E7=94=B3?= =?UTF-8?q?=E6=8A=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/ConstructionPlanManage.java | 2 +- .../pmapi/projectlib/manage/ProjectLibManage.java | 38 ++++++++++++++++++---- .../pmapi/projectlib/model/entity/Project.java | 3 ++ .../projectlib/model/vo/ProjectLibListItemVO.java | 6 ++++ 4 files changed, 41 insertions(+), 8 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 f1b75ac..1cbab70 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 @@ -168,7 +168,7 @@ public class ConstructionPlanManage { log.info("建设方案项目申报成功 【{}】", instanceId); // 保存建设项目相关 - Project buildProject = projectLibManage.saveConstructProjectInDeclared(projectInfo,instanceId,employeeCode); + Project buildProject = projectLibManage.saveConstructProjectInDeclared(projectInfo,instanceId,employeeCode,oldProject); //发送给第一个审批人消息 noticeManage.sendFirtUser(buildProject,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 6fc6f63..617a738 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 @@ -4,10 +4,10 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.copier.CopyOptions; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; -import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; @@ -19,7 +19,6 @@ import com.ningdatech.pmapi.common.constant.RegionConst; import com.ningdatech.pmapi.common.enumeration.CommonEnum; import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; import com.ningdatech.pmapi.common.helper.RegionCacheHelper; -import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.common.model.entity.ExcelExportWriter; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.common.util.BizUtils; @@ -74,8 +73,6 @@ import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; -import static com.ningdatech.pmapi.irs.config.IrsSealPlatformProperties.projectId; - /** *
* ProjectLibManage
@@ -170,6 +167,7 @@ public class ProjectLibManage {
&& w.getSuperOrgCode().equals(finalUser.getEmpPosUnitCode())) {
item.setCanPreDeclared(Boolean.TRUE);
}
+ item.setPrePlanProjectId(w.getPrePlanProjectId());
return item;
});
return PageVo.of(records, total);
@@ -204,14 +202,36 @@ public class ProjectLibManage {
/**
* 建设方案申报项目时 保存项目信息和其它相关联的信息
+ *
* @param projectDto
* @param instanceId
* @param employeeCode
+ * @param oldProject
* @return
*/
public Project saveConstructProjectInDeclared(ProjectDTO projectDto, String instanceId,
- String employeeCode) {
- Project project = saveConstructProjectNewVersion(projectDto,instanceId,employeeCode);
+ String employeeCode, Project oldProject) {
+ // 将旧的项目状态置为,版本置为不是最新
+ oldProject.setNewest(Boolean.FALSE);
+ projectService.updateById(oldProject);
+
+ LambdaUpdateWrapper