Browse Source

debug 应用丢失情况

master
parent
commit
7952aa6f4d
2 changed files with 13 additions and 22 deletions
  1. +12
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  2. +1
    -15
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

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

@@ -255,7 +255,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);
@@ -309,13 +311,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);


+ 1
- 15
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -1136,9 +1136,6 @@ public class TodoCenterManage {
.eq(ProjectApplication::getIsConstruct, Boolean.TRUE));
if (CollUtil.isNotEmpty(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();
@@ -1157,18 +1154,7 @@ public class TodoCenterManage {
projectApplication.setIsConstruct(Boolean.TRUE);
}
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;


Loading…
Cancel
Save