Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

tags/24080901
PoffyZhang 1 yıl önce
ebeveyn
işleme
aacdabcb89
4 değiştirilmiş dosya ile 41 ekleme ve 8 silme
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java
  2. +31
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  3. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java
  4. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionPlanManage.java Dosyayı Görüntüle

@@ -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,


+ 31
- 7
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java Dosyayı Görüntüle

@@ -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;

/**
* <p>
* 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<Project> updateWrapper = Wrappers.lambdaUpdate(Project.class);
updateWrapper.set(Project::getStage,null)
.set(Project::getStatus,null)
.eq(Project::getId,oldProject.getId());
projectService.update(updateWrapper);

Project project = saveConstructProjectNewVersion(projectDto,instanceId,employeeCode,oldProject);
Long newProjectId = project.getId();
// 关联旧的项目的审核实例到新的项目ID
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getProjectId, oldProject.getId()))
.stream().map(p -> {
p.setProjectId(newProjectId);
return p;
}).collect(Collectors.toList());
projectInstService.updateBatchById(projectInstList);

//保存项目和实例的关系
ProjectInst projectInst = new ProjectInst();
projectInst.setProjectId(project.getId());
@@ -288,13 +308,15 @@ public class ProjectLibManage {

/**
* 建设方案申报项目时 保存项目信息和其它相关联的信息
*
* @param projectDto
* @param instanceId
* @param employeeCode
* @param oldProject
* @return
*/
public Project saveConstructProjectNewVersion(ProjectDTO projectDto, String instanceId,
String employeeCode) {
String employeeCode, Project oldProject) {
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示
try {
Project project = new Project();
@@ -311,6 +333,8 @@ public class ProjectLibManage {
project.setProjectCode(projectCode);
// 标记为建设方案申报
project.setIsConstruct(Boolean.TRUE);
// 保存初步方案项目ID
project.setPrePlanProjectId(oldProject.getId());
projectService.save(project);
}else{
//否则是重新提交的 新生成一个新版本的项目


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java Dosyayı Görüntüle

@@ -366,4 +366,7 @@ public class Project implements Serializable {

@ApiModelProperty("是否为建设方案申报")
private Boolean isConstruct;

@ApiModelProperty("初步方案项目ID")
private Long prePlanProjectId;
}

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java Dosyayı Görüntüle

@@ -136,6 +136,12 @@ public class ProjectLibListItemVO {
@ApiModelProperty("是否可以申请延期")
private Boolean canDelayApply = Boolean.TRUE;

@ApiModelProperty("是否为建设方案申报")
private Boolean isConstruct;

@ApiModelProperty("初步方案项目ID")
private Long prePlanProjectId;

//预审申报时候 需不需要上传上级条线意见文件
private Boolean needUploadSuperLineFile;
public Boolean getNeedUploadSuperLineFile() {


Yükleniyor…
İptal
Kaydet