diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 810d0ab..fa36c23 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -262,7 +262,9 @@ public class ProjectLibManage { project.setSponsor(employeeCode); String projectCode = generateProjectCodeUtil.generateProjectCode(projectDto); project.setProjectCode(projectCode); - projectService.save(project); + if(projectService.save(project)){ + saveApplication(projectDto,project,null); + } } else { //否则是重新提交的 新生成一个新版本的项目 project = newProjectWithVersion(projectDto); @@ -316,13 +318,16 @@ public class ProjectLibManage { } else { 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 { //否则是被驳回,重新提交的 新生成一个新版本的项目 project = newProjectWithVersion(projectDto); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java index aaf4cf4..c8997dc 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java @@ -1136,9 +1136,6 @@ public class TodoCenterManage { .eq(ProjectApplication::getIsConstruct, Boolean.TRUE)); if (CollUtil.isNotEmpty(applicationList)) { projectApplicationService.removeBatchByIds(applicationList); - List applicationIds = applicationList.stream().map(ProjectApplication::getId).collect(Collectors.toList()); -// projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) -// .in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); } List applications = projectDto.getApplicationList(); @@ -1157,18 +1154,7 @@ public class TodoCenterManage { projectApplication.setIsConstruct(Boolean.TRUE); } projectApplication.setProjectVersion(project.getVersion()); - boolean result = projectApplicationService.save(projectApplication); -// // 保存应用关联的核心业务 -// List 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;