Explorar el Código

debug 应用丢失情况

tags/24080901
PoffyZhang hace 1 año
padre
commit
ac0286f83f
Se han modificado 2 ficheros con 13 adiciones y 22 borrados
  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 Ver fichero

@@ -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);


+ 1
- 15
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java Ver fichero

@@ -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;


Cargando…
Cancelar
Guardar