|
|
@@ -69,6 +69,7 @@ import com.ningdatech.pmapi.safety.service.ISupplierSafetyQualificationService; |
|
|
|
import com.ningdatech.pmapi.todocenter.model.req.ProcessDetailReq; |
|
|
|
import com.ningdatech.pmapi.todocenter.service.ITodoService; |
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; |
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; |
|
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
|
import com.wflow.exception.BusinessException; |
|
|
|
import com.wflow.workflow.bean.vo.ProcessDetailVO; |
|
|
@@ -260,9 +261,16 @@ public class ProjectLibManage { |
|
|
|
.eq(ProjectApplication::getIsConstruct, projectInfo.getIsConstruct()) |
|
|
|
.eq(ProjectApplication::getProjectVersion, projectInfo.getVersion())); |
|
|
|
|
|
|
|
List<Long> applicationIds = applications.stream().map(ProjectApplication::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
//核心业务 |
|
|
|
List<ProjectCoreBusinessIndicators> coreBizs = projectCoreBusinessIndicatorsService.list(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) |
|
|
|
.in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); |
|
|
|
Map<Long,List<ProjectCoreBusinessIndicators>> coreBizMap = coreBizs.stream().collect(Collectors.groupingBy(ProjectCoreBusinessIndicators::getApplicationId)); |
|
|
|
|
|
|
|
Optional.ofNullable(applications).ifPresent(apps -> |
|
|
|
vo.setProjectApplications(CollUtils.convert(apps, |
|
|
|
ProjectHelper::convertVO) |
|
|
|
app -> ProjectHelper.convertVOWithMap(app,coreBizMap)) |
|
|
|
)); |
|
|
|
|
|
|
|
List<Long> allVersionProjectId = projectService.getAllVersionProjectId(projectInfo); |
|
|
@@ -373,9 +381,16 @@ public class ProjectLibManage { |
|
|
|
.eq(ProjectApplication::getIsConstruct, projectInfo.getIsConstruct()) |
|
|
|
.eq(ProjectApplication::getProjectVersion, projectInfo.getVersion())); |
|
|
|
|
|
|
|
List<Long> applicationIds = applications.stream().map(ProjectApplication::getId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
//核心业务 |
|
|
|
List<ProjectCoreBusinessIndicators> coreBizs = projectCoreBusinessIndicatorsService.list(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) |
|
|
|
.in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); |
|
|
|
Map<Long,List<ProjectCoreBusinessIndicators>> coreBizMap = coreBizs.stream().collect(Collectors.groupingBy(ProjectCoreBusinessIndicators::getApplicationId)); |
|
|
|
|
|
|
|
Optional.ofNullable(applications).ifPresent(apps -> |
|
|
|
vo.setProjectApplications(CollUtils.convert(apps, |
|
|
|
ProjectHelper::convertVO) |
|
|
|
app -> ProjectHelper.convertVOWithMap(app,coreBizMap)) |
|
|
|
)); |
|
|
|
|
|
|
|
//审批信息 |
|
|
@@ -1208,20 +1223,32 @@ public class ProjectLibManage { |
|
|
|
.eq(ProjectApplication::getProjectCode, oldProject.getProjectCode()) |
|
|
|
.eq(ProjectApplication::getProjectVersion, oldProject.getVersion())); |
|
|
|
if(CollUtil.isNotEmpty(apps)){ |
|
|
|
apps = apps.stream().map(app -> { |
|
|
|
apps.forEach(app -> { |
|
|
|
Long oldAppId = app.getId(); |
|
|
|
app.setProjectVersion(project.getVersion()); |
|
|
|
app.setProjectId(project.getId()); |
|
|
|
app.setId(null); |
|
|
|
if(Objects.nonNull(isConstruct)){ |
|
|
|
app.setIsConstruct(isConstruct); |
|
|
|
} |
|
|
|
return app; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
projectApplicationService.saveBatch(apps); |
|
|
|
projectApplicationService.save(app); |
|
|
|
|
|
|
|
//核心业务 |
|
|
|
List<ProjectCoreBusinessIndicators> cores = projectCoreBusinessIndicatorsService.list(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) |
|
|
|
.eq(ProjectCoreBusinessIndicators::getApplicationId, oldAppId)); |
|
|
|
if(CollUtil.isNotEmpty(cores)){ |
|
|
|
cores.forEach(c -> { |
|
|
|
c.setId(null); |
|
|
|
c.setApplicationId(app.getId()); |
|
|
|
projectCoreBusinessIndicatorsService.save(c); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void saveApplication(ProjectDTO projectDto,Project project,Boolean isConstruct) { |
|
|
|
UserInfoDetails user = LoginUserUtil.loginUserDetail(); |
|
|
|
//保存项目应用 |
|
|
|
Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) |
|
|
|
? Boolean.TRUE : Boolean.FALSE; |
|
|
@@ -1233,9 +1260,6 @@ public class ProjectLibManage { |
|
|
|
.eq(ProjectApplication::getProjectVersion, version)); |
|
|
|
if (CollUtil.isNotEmpty(applications)) { |
|
|
|
projectApplicationService.removeBatchByIds(applications); |
|
|
|
List<Long> applicationIds = applications.stream().map(ProjectApplication::getId).collect(Collectors.toList()); |
|
|
|
projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class) |
|
|
|
.in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds)); |
|
|
|
} |
|
|
|
|
|
|
|
if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { |
|
|
@@ -1262,7 +1286,9 @@ public class ProjectLibManage { |
|
|
|
for (ProjectCoreBusinessDTO coreBusiness : coreBusinessList) { |
|
|
|
ProjectCoreBusinessIndicators projectCoreBusinessIndicators = new ProjectCoreBusinessIndicators(); |
|
|
|
BeanUtils.copyProperties(coreBusiness, projectCoreBusinessIndicators); |
|
|
|
projectCoreBusinessIndicators.setApplicationId(application.getId()); |
|
|
|
projectCoreBusinessIndicators.setApplicationId(projectApplication.getId()); |
|
|
|
projectCoreBusinessIndicators.setCreateOn(LocalDateTime.now()); |
|
|
|
projectCoreBusinessIndicators.setCreateBy(user.getUsername()); |
|
|
|
projectCoreBusinessIndicatorsService.save(projectCoreBusinessIndicators); |
|
|
|
} |
|
|
|
} |
|
|
|