Преглед на файлове

省级联审 重新提交

master
PoffyZhang преди 1 година
родител
ревизия
1f810df013
променени са 2 файла, в които са добавени 33 реда и са изтрити 3 реда
  1. +18
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByProvincialDeptManage.java
  2. +15
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java

+ 18
- 3
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());
}
}

+ 15
- 0
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<ProjectApplication> apps = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class)
.eq(ProjectApplication::getProjectId, oldProject.getId()));
if(CollUtil.isNotEmpty(apps)){
List<ProjectApplication> newApps = apps.stream()
.map(a -> {
a.setProjectId(project.getId());
return a;
})
.collect(Collectors.toList());
projectApplicationService.saveBatch(newApps);
}
}


return project;
}



Loading…
Отказ
Запис