|
|
@@ -370,6 +370,7 @@ public class ProjectLibManage { |
|
|
|
projectApplication.setProjectCode(finalProject.getProjectCode()); |
|
|
|
projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode()); |
|
|
|
projectApplication.setBuildOrgName(finalProject.getBuildOrgName()); |
|
|
|
projectApplication.setIsConstruct(Boolean.TRUE); |
|
|
|
return projectApplication; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
projectApplicationService.saveBatch(applications); |
|
|
@@ -492,6 +493,7 @@ public class ProjectLibManage { |
|
|
|
app.setProjectId(project.getId()); |
|
|
|
app.setBuildOrgName(project.getBuildOrgName()); |
|
|
|
app.setBuildOrgCode(project.getBuildOrgCode()); |
|
|
|
app.setIsConstruct(Boolean.TRUE); |
|
|
|
return app; |
|
|
|
}) |
|
|
|
.collect(Collectors.toList()); |
|
|
@@ -673,28 +675,10 @@ public class ProjectLibManage { |
|
|
|
vo.buildDynamicForm(projectInfo.getDynamicForm()); |
|
|
|
// 查询应用 |
|
|
|
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
.eq(ProjectApplication::getProjectCode, vo.getProjectCode())); |
|
|
|
|
|
|
|
// 查出同一项目编号,建设方案申报前的项目ID |
|
|
|
List<Long> projectIdList = projectService.list(Wrappers.lambdaQuery(Project.class) |
|
|
|
.eq(Project::getProjectCode, projectInfo.getProjectCode()) |
|
|
|
.eq(Project::getIsConstruct, Boolean.FALSE)).stream() |
|
|
|
.map(Project::getId).collect(Collectors.toList()); |
|
|
|
List<ProjectApplication> applicationList; |
|
|
|
// 如果是建设方案申报后的项目,过滤掉初步方案的应用信息 |
|
|
|
if (Boolean.TRUE.equals(projectInfo.getIsConstruct())){ |
|
|
|
applicationList = applications.stream() |
|
|
|
.filter(a -> !projectIdList.contains(a.getProjectCode())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
// 如果不是,展示初步方案的应用信息 |
|
|
|
else { |
|
|
|
applicationList = applications.stream() |
|
|
|
.filter(a -> projectIdList.contains(a.getProjectCode())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) |
|
|
|
.eq(ProjectApplication::getIsConstruct,projectInfo.getIsConstruct())); |
|
|
|
|
|
|
|
Optional.ofNullable(applicationList).ifPresent(apps -> |
|
|
|
Optional.ofNullable(applications).ifPresent(apps -> |
|
|
|
vo.setProjectApplications(CollUtils.convert(apps, |
|
|
|
ProjectHelper::convertVO) |
|
|
|
)); |
|
|
@@ -781,20 +765,14 @@ public class ProjectLibManage { |
|
|
|
vo.buildDynamicForm(projectInfo.getDynamicForm()); |
|
|
|
// 查询应用 |
|
|
|
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) |
|
|
|
.eq(ProjectApplication::getProjectCode, vo.getProjectCode())); |
|
|
|
// 查出同一项目编号,建设方案申报前的项目ID |
|
|
|
List<Long> projectIdList = projectService.list(Wrappers.lambdaQuery(Project.class) |
|
|
|
.eq(Project::getProjectCode, projectInfo.getProjectCode()) |
|
|
|
.eq(Project::getIsConstruct, Boolean.FALSE)).stream() |
|
|
|
.map(Project::getId).collect(Collectors.toList()); |
|
|
|
List<ProjectApplication> applicationList = applications.stream() |
|
|
|
.filter(a -> projectIdList.contains(a.getProjectId())) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) |
|
|
|
.eq(ProjectApplication::getIsConstruct,Boolean.FALSE)); |
|
|
|
|
|
|
|
Optional.ofNullable(applicationList).ifPresent(apps -> |
|
|
|
Optional.ofNullable(applications).ifPresent(apps -> |
|
|
|
vo.setProjectApplications(CollUtils.convert(apps, |
|
|
|
ProjectHelper::convertVO) |
|
|
|
)); |
|
|
|
|
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
|