Browse Source

应用是否是 建设方案的

master
PoffyZhang 1 year ago
parent
commit
a92a51cd59
1 changed files with 9 additions and 9 deletions
  1. +9
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java

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

@@ -201,7 +201,7 @@ public class ProjectLibManage {
*/ */
public Project saveProjectInDeclared(ProjectDTO projectDto, String instanceId, public Project saveProjectInDeclared(ProjectDTO projectDto, String instanceId,
String employeeCode) { String employeeCode) {
Project project = saveProjectNewVersion(projectDto, instanceId, employeeCode);
Project project = saveProjectNewVersion(projectDto, instanceId, employeeCode,Boolean.FALSE);
//保存项目和实例的关系 //保存项目和实例的关系
ProjectInst projectInst = new ProjectInst(); ProjectInst projectInst = new ProjectInst();
projectInst.setProjectId(project.getId()); projectInst.setProjectId(project.getId());
@@ -253,7 +253,7 @@ public class ProjectLibManage {
* @return * @return
*/ */
public Project saveProjectNewVersion(ProjectDTO projectDto, String instanceId, public Project saveProjectNewVersion(ProjectDTO projectDto, String instanceId,
String employeeCode) {
String employeeCode,Boolean isContruct) {
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示 //流程启动之后 入库项目 重要业务信息 用于列表查询 展示
try { try {
Project project = new Project(); Project project = new Project();
@@ -273,7 +273,7 @@ public class ProjectLibManage {
} }
} else { } else {
//否则是重新提交的 新生成一个新版本的项目 //否则是重新提交的 新生成一个新版本的项目
project = newProjectWithVersion(projectDto);
project = newProjectWithVersion(projectDto,isContruct);
if (Objects.nonNull(project)) { if (Objects.nonNull(project)) {
project.setInstCode(instanceId); project.setInstCode(instanceId);
project.setSponsor(employeeCode); project.setSponsor(employeeCode);
@@ -326,7 +326,7 @@ public class ProjectLibManage {
project.setPrePlanProjectId(oldProject.getId()); project.setPrePlanProjectId(oldProject.getId());
} }
if(projectService.save(project)){ if(projectService.save(project)){
saveApplication(projectDto,project,null);
saveApplication(projectDto,project,Boolean.TRUE);


// 将旧的项目版本置为不是最新 // 将旧的项目版本置为不是最新
projectService.update(Wrappers.lambdaUpdate(Project.class) projectService.update(Wrappers.lambdaUpdate(Project.class)
@@ -337,7 +337,7 @@ public class ProjectLibManage {


} else { } else {
//否则是被驳回,重新提交的 新生成一个新版本的项目 //否则是被驳回,重新提交的 新生成一个新版本的项目
project = newProjectWithVersion(projectDto);
project = newProjectWithVersion(projectDto,Boolean.TRUE);
if (Objects.nonNull(project)) { if (Objects.nonNull(project)) {
project.setInstCode(instanceId); project.setInstCode(instanceId);
project.setSponsor(employeeCode); project.setSponsor(employeeCode);
@@ -358,10 +358,10 @@ public class ProjectLibManage {
* @param projectDto * @param projectDto
* @return * @return
*/ */
public Project reSaveProjectNewVersion(ProjectDTO projectDto) {
public Project reSaveProjectNewVersion(ProjectDTO projectDto,Boolean isContruct) {
//流程启动之后 入库项目 重要业务信息 用于列表查询 展示 //流程启动之后 入库项目 重要业务信息 用于列表查询 展示
try { try {
return newProjectWithVersion(projectDto);
return newProjectWithVersion(projectDto,isContruct);
} catch (Exception e) { } catch (Exception e) {
log.error("项目信息入库错误 " + e); log.error("项目信息入库错误 " + e);
throw new BusinessException("项目信息入库错误 :" + e); throw new BusinessException("项目信息入库错误 :" + e);
@@ -372,7 +372,7 @@ public class ProjectLibManage {
* 重新提交工作流时 舍弃在原有项目修改 * 重新提交工作流时 舍弃在原有项目修改
* 新增一个新的项目 新的版本号 * 新增一个新的项目 新的版本号
*/ */
public Project newProjectWithVersion(ProjectDTO projecDto) {
public Project newProjectWithVersion(ProjectDTO projecDto,Boolean isContruct) {
Project oldProject = projectService.getById(projecDto.getId()); Project oldProject = projectService.getById(projecDto.getId());
Project project = new Project(); Project project = new Project();
VUtils.isTrue(Objects.isNull(oldProject)) VUtils.isTrue(Objects.isNull(oldProject))
@@ -397,7 +397,7 @@ public class ProjectLibManage {
.ne(Project::getId, project.getId()) .ne(Project::getId, project.getId())
.eq(Project::getProjectCode, project.getProjectCode())); .eq(Project::getProjectCode, project.getProjectCode()));


saveApplication(projecDto,project,null);
saveApplication(projecDto,project,isContruct);


return project; return project;
} }


Loading…
Cancel
Save