@@ -255,7 +255,9 @@ public class ProjectLibManage { | |||||
project.setSponsor(employeeCode); | project.setSponsor(employeeCode); | ||||
String projectCode = generateProjectCodeUtil.generateProjectCode(projectDto); | String projectCode = generateProjectCodeUtil.generateProjectCode(projectDto); | ||||
project.setProjectCode(projectCode); | project.setProjectCode(projectCode); | ||||
projectService.save(project); | |||||
if(projectService.save(project)){ | |||||
saveApplication(projectDto,project,null); | |||||
} | |||||
} else { | } else { | ||||
//否则是重新提交的 新生成一个新版本的项目 | //否则是重新提交的 新生成一个新版本的项目 | ||||
project = newProjectWithVersion(projectDto); | project = newProjectWithVersion(projectDto); | ||||
@@ -309,13 +311,16 @@ public class ProjectLibManage { | |||||
} else { | } else { | ||||
project.setPrePlanProjectId(oldProject.getId()); | project.setPrePlanProjectId(oldProject.getId()); | ||||
} | } | ||||
projectService.save(project); | |||||
if(projectService.save(project)){ | |||||
saveApplication(projectDto,project,null); | |||||
// 将旧的项目版本置为不是最新 | |||||
projectService.update(Wrappers.lambdaUpdate(Project.class) | |||||
.set(Project::getNewest, Boolean.FALSE) | |||||
.ne(Project::getId, project.getId()) | |||||
.eq(Project::getProjectCode, project.getProjectCode())); | |||||
} | |||||
// 将旧的项目版本置为不是最新 | |||||
projectService.update(Wrappers.lambdaUpdate(Project.class) | |||||
.set(Project::getNewest, Boolean.FALSE) | |||||
.ne(Project::getId, project.getId()) | |||||
.eq(Project::getProjectCode, project.getProjectCode())); | |||||
} else { | } else { | ||||
//否则是被驳回,重新提交的 新生成一个新版本的项目 | //否则是被驳回,重新提交的 新生成一个新版本的项目 | ||||
project = newProjectWithVersion(projectDto); | project = newProjectWithVersion(projectDto); | ||||
@@ -1136,9 +1136,6 @@ public class TodoCenterManage { | |||||
.eq(ProjectApplication::getIsConstruct, Boolean.TRUE)); | .eq(ProjectApplication::getIsConstruct, Boolean.TRUE)); | ||||
if (CollUtil.isNotEmpty(applicationList)) { | if (CollUtil.isNotEmpty(applicationList)) { | ||||
projectApplicationService.removeBatchByIds(applicationList); | projectApplicationService.removeBatchByIds(applicationList); | ||||
List<Long> applicationIds = applicationList.stream().map(ProjectApplication::getId).collect(Collectors.toList()); | |||||
// projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) | |||||
// .in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); | |||||
} | } | ||||
List<ProjectApplicationDTO> applications = projectDto.getApplicationList(); | List<ProjectApplicationDTO> applications = projectDto.getApplicationList(); | ||||
@@ -1157,18 +1154,7 @@ public class TodoCenterManage { | |||||
projectApplication.setIsConstruct(Boolean.TRUE); | projectApplication.setIsConstruct(Boolean.TRUE); | ||||
} | } | ||||
projectApplication.setProjectVersion(project.getVersion()); | projectApplication.setProjectVersion(project.getVersion()); | ||||
boolean result = projectApplicationService.save(projectApplication); | |||||
// // 保存应用关联的核心业务 | |||||
// List<ProjectCoreBusinessDTO> coreBusinessList = application.getCoreBusinessList(); | |||||
// Boolean hasCoreBusiness = CollUtil.isNotEmpty(coreBusinessList) ? Boolean.TRUE : Boolean.FALSE; | |||||
// if (Boolean.TRUE.equals(result) && Boolean.TRUE.equals(hasCoreBusiness)){ | |||||
// for (ProjectCoreBusinessDTO coreBusiness : coreBusinessList) { | |||||
// ProjectCoreBusinessIndicators projectCoreBusinessIndicators = new ProjectCoreBusinessIndicators(); | |||||
// BeanUtils.copyProperties(coreBusiness, projectCoreBusinessIndicators); | |||||
// projectCoreBusinessIndicators.setApplicationId(application.getId()); | |||||
// projectCoreBusinessIndicatorsService.save(projectCoreBusinessIndicators); | |||||
// } | |||||
// } | |||||
projectApplicationService.save(projectApplication); | |||||
} | } | ||||
} | } | ||||
return Boolean.TRUE; | return Boolean.TRUE; | ||||