CMM 1 year ago
parent
commit
66885f1aa7
3 changed files with 11 additions and 4 deletions
  1. +8
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java
  3. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java

+ 8
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectApprovalHandle.java View File

@@ -1,6 +1,9 @@
package com.ningdatech.pmapi.projectlib.handle;

import java.util.*;
import java.util.stream.Collectors;

import cn.hutool.core.collection.CollUtil;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
@@ -68,14 +71,16 @@ public class ProjectApprovalHandle extends AbstractProcessBusinessHandle {
void businessHandle(Long projectId, List<ProcessDetailVO> processSchedule) {
ProcessDetailVO processDetailVO = new ProcessDetailVO();

Project project = projectService.getById(projectId);
Project project = projectService.getNewProject(projectId);
//查出历史版本的 所有项目ID
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(project);
Integer status = project.getStatus();
List<Integer> fieldList = CollUtils.fieldList(PROJECT_APPROVAL_LIST_STATUS, ProjectStatusEnum::getCode);
if(Objects.isNull(status)){
return;
}

// 项目状态为待立项批复之前的状态
if (fieldList.contains(status)){
if (status < ProjectStatusEnum.TO_BE_APPROVED.getCode()){
processDetailVO.setStepStatus(StepStatusEnum.NOT_START);
processDetailVO.setProcessName(CommonConst.PROJECT_APPROVAL);
processSchedule.add(processDetailVO);


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/AnnualPlanLibManage.java View File

@@ -149,7 +149,6 @@ public class AnnualPlanLibManage {
Project oldProject = projectService.getById(req.getProjectId());
Project project = BeanUtil.copyProperties(oldProject, Project.class);
// 被撤回重新申报的项目,项目ID要置空
project.setId(null);
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
stateMachine.pass(project);
@@ -167,6 +166,7 @@ public class AnnualPlanLibManage {
project.setProjectCode(oldProject.getProjectCode());
project.setVersion(oldProject.getVersion() + 1);
project.setInstCode(TodoCenterConstant.Declared.NULL_INST_CODE);
project.setId(null);
if(projectService.save(project)){
applicationService.saveApplication(project,oldProject,Boolean.TRUE);
// 将旧的项目版本置为不是最新


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java View File

@@ -126,6 +126,8 @@ public class ProjectRenewalFundManage {
declaration.setCreateOn(LocalDateTime.now());
declaration.setUpdateOn(LocalDateTime.now());
declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name());
declaration.setRegionCode(project.getAreaCode());
declaration.setOrgCode(project.getBuildOrgCode());
if(!projectRenewalFundDeclarationService.saveOrUpdate(declaration)){
throw new BusinessException(String.format("申报失败 【%s】",dto.getId()));
}


Loading…
Cancel
Save