Browse Source

Merge remote-tracking branch 'origin/master'

tags/24080901
PoffyZhang 1 year ago
parent
commit
87755cd2fc
3 changed files with 10 additions and 21 deletions
  1. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java
  3. +6
    -17
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java

+ 3
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectLibController.java View File

@@ -58,10 +58,10 @@ public class ProjectLibController {
return projectLibManage.applicationList(req);
}

@GetMapping("/construct/{id}")
@ApiOperation("获取项目建设方案详情")
@GetMapping("/prePlan/{id}")
@ApiOperation("获取项目初步方案详情")
public ProjectDetailVO constructDetail (@PathVariable Long id){
return projectLibManage.getConstructProjectDetail(id);
return projectLibManage.getPrePlanProjectDetail(id);
}

@GetMapping("/{id}")


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java View File

@@ -67,7 +67,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle {
.orderByDesc(ProjectInst::getCreatOn)
.last("limit 1"));
ProcessProgressVo instanceDetail = null;
// 未找到当前版本项目的预审审核流程且当前项目版本号大于1(是被驳回重新申报的项目)
// 未找到当前版本项目的预审审核流程且当前项目版本号大于1(是被驳回重新申报的项目或者建设方案申报的项目)
if (Objects.isNull(projectInst)) {
if (project.getVersion() > CommonConst.VERSION_ONE){
// 获取上个版本的信息


+ 6
- 17
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java View File

@@ -213,10 +213,8 @@ public class ProjectLibManage {
String employeeCode, Project oldProject) {

Project project = saveConstructProjectNewVersion(projectDto,instanceId,employeeCode,oldProject);
Long newProjectId = project.getId();

// 将旧的项目状态、阶段置为null,版本置为不是最新,项目编号设置为新的项目编号
oldProject.setProjectCode(project.getProjectCode());
// 将旧的项目状态、阶段置为null,版本置为不是最新
oldProject.setNewest(Boolean.FALSE);
projectService.updateById(oldProject);

@@ -225,17 +223,6 @@ public class ProjectLibManage {
.set(Project::getStatus,null)
.eq(Project::getId,oldProject.getId());
projectService.update(updateWrapper);
// 关联旧的项目的审核实例到新的项目ID
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project);
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, allVersionProjectIds))
.stream().map(p -> {
p.setProjectId(newProjectId);
return p;
}).collect(Collectors.toList());
projectInstService.updateBatchById(projectInstList);

//保存项目和实例的关系
ProjectInst projectInst = new ProjectInst();
projectInst.setProjectId(project.getId());
@@ -333,7 +320,9 @@ public class ProjectLibManage {
project.setStatus(ProjectStatusEnum.SCHEME_UNDER_REVIEW.getCode());
project.setInstCode(instanceId);
project.setSponsor(employeeCode);
// 项目编号不变,版本号加1
project.setProjectCode(oldProject.getProjectCode());
project.setVersion(oldProject.getVersion() + 1);
// 标记为建设方案申报
project.setIsConstruct(Boolean.TRUE);
// 保存初步方案项目ID
@@ -738,15 +727,15 @@ public class ProjectLibManage {
}

/**
* 获取建设方案申报项目详情
* 获取项目初步方案详情
* @param projectId
* @return com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO
* @author CMM
* @since 2023/07/12 11:43
*/
public ProjectDetailVO getConstructProjectDetail(Long projectId) {
public ProjectDetailVO getPrePlanProjectDetail(Long projectId) {
// 查询建设方案申报前最新的项目申报信息
Project projectInfo = projectService.getNewConstructProject(projectId);
Project projectInfo = projectService.getById(projectId);
if (Objects.isNull(projectInfo)) {
return null;
}


Loading…
Cancel
Save