|
|
@@ -17,7 +17,11 @@ import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
|
import com.ningdatech.pmapi.common.constant.RegionConst; |
|
|
|
import com.ningdatech.pmapi.common.enumeration.CommonEnum; |
|
|
|
import com.ningdatech.pmapi.performance.model.dto.ProjectCoreBusinessDTO; |
|
|
|
import com.ningdatech.pmapi.performance.model.entity.ProjectCoreBusinessIndicators; |
|
|
|
import com.ningdatech.pmapi.performance.service.IProjectCoreBusinessIndicatorsService; |
|
|
|
import com.ningdatech.pmapi.projectlib.enumeration.*; |
|
|
|
import com.ningdatech.pmapi.projectlib.model.dto.ProjectApplicationDTO; |
|
|
|
import com.ningdatech.pmapi.sys.model.entity.Region; |
|
|
|
import com.ningdatech.pmapi.sys.service.IRegionService; |
|
|
|
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant; |
|
|
@@ -140,6 +144,7 @@ public class TodoCenterManage { |
|
|
|
private final IRegionService regionService; |
|
|
|
|
|
|
|
private final ITodoService todoService; |
|
|
|
private final IProjectCoreBusinessIndicatorsService projectCoreBusinessIndicatorsService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 待办中心待我处理项目列表查询 |
|
|
@@ -1115,19 +1120,23 @@ public class TodoCenterManage { |
|
|
|
//再修改应用信息 |
|
|
|
Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && 1 == projectDto.getIncludeApplication() |
|
|
|
? Boolean.TRUE : Boolean.FALSE; |
|
|
|
Long projectDtoId = projectDto.getId(); |
|
|
|
Project projectInfo = projectService.getById(projectDtoId); |
|
|
|
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class).eq(ProjectInst::getInstCode, instCode)); |
|
|
|
Integer instType = projectInst.getInstType(); |
|
|
|
|
|
|
|
//批量删除 |
|
|
|
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
List<ProjectApplication> applicationList = projectApplicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
.eq(ProjectApplication::getProjectCode, project.getProjectCode()) |
|
|
|
.eq(ProjectApplication::getProjectVersion,project.getVersion())); |
|
|
|
|
|
|
|
if(isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())){ |
|
|
|
//批量添加 |
|
|
|
List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { |
|
|
|
.eq(ProjectApplication::getProjectVersion, project.getVersion()) |
|
|
|
.eq(ProjectApplication::getIsConstruct, Boolean.TRUE)); |
|
|
|
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(); |
|
|
|
if(isApp && CollUtil.isNotEmpty(applications)){ |
|
|
|
// 添加应用关联的核心业务 |
|
|
|
for (ProjectApplicationDTO application : applications) { |
|
|
|
ProjectApplication projectApplication = new ProjectApplication(); |
|
|
|
BeanUtils.copyProperties(application, projectApplication); |
|
|
|
projectApplication.setId(null); |
|
|
@@ -1139,9 +1148,19 @@ public class TodoCenterManage { |
|
|
|
projectApplication.setIsConstruct(Boolean.TRUE); |
|
|
|
} |
|
|
|
projectApplication.setProjectVersion(project.getVersion()); |
|
|
|
return projectApplication; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
projectApplicationService.saveBatch(applications); |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return Boolean.TRUE; |
|
|
|
} |
|
|
|