|
@@ -727,21 +727,36 @@ public class MeetingManage { |
|
|
Page<Project> page = projectService.page(req.page(), query); |
|
|
Page<Project> page = projectService.page(req.page(), query); |
|
|
PageVo<ProjectLibListItemVO> result = PageVo.of(null, page.getTotal()); |
|
|
PageVo<ProjectLibListItemVO> result = PageVo.of(null, page.getTotal()); |
|
|
if (result.getTotal() > 0) { |
|
|
if (result.getTotal() > 0) { |
|
|
List<ProjectLibListItemVO> projects = CollUtils.convert(page.getRecords(), |
|
|
|
|
|
w -> ProjectLibListItemVO |
|
|
|
|
|
.builder() |
|
|
|
|
|
.id(w.getId()) |
|
|
|
|
|
.projectName(w.getProjectName()) |
|
|
|
|
|
.declaredAmount(w.getDeclareAmount()) |
|
|
|
|
|
.projectType(w.getProjectType()) |
|
|
|
|
|
.projectYear(w.getProjectYear()) |
|
|
|
|
|
.buildOrg(w.getBuildOrgName()) |
|
|
|
|
|
.build()); |
|
|
|
|
|
result.setRecords(projects); |
|
|
|
|
|
|
|
|
result.setRecords(CollUtils.convert(page.getRecords(), this::buildProjectList)); |
|
|
} |
|
|
} |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<ProjectLibListItemVO> projectsByMeetingId(Long meetingId) { |
|
|
|
|
|
Meeting meeting = meetingService.getById(meetingId); |
|
|
|
|
|
if (meeting.getIsInnerProject()) { |
|
|
|
|
|
List<MeetingInnerProject> projects = meetingInnerProjectService.listByMeetingId(meetingId); |
|
|
|
|
|
List<Long> projectIdList = CollUtils.fieldList(projects, MeetingInnerProject::getProjectId); |
|
|
|
|
|
List<Project> projectList = projectService.listByIds(projectIdList); |
|
|
|
|
|
return CollUtils.convert(projectList, this::buildProjectList); |
|
|
|
|
|
} else { |
|
|
|
|
|
List<MeetingOuterProject> projects = meetingOuterProjectService.listByMeetingId(meetingId); |
|
|
|
|
|
return BeanUtil.copyToList(projects, ProjectLibListItemVO.class); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ProjectLibListItemVO buildProjectList(Project project) { |
|
|
|
|
|
return ProjectLibListItemVO |
|
|
|
|
|
.builder() |
|
|
|
|
|
.id(project.getId()) |
|
|
|
|
|
.projectName(project.getProjectName()) |
|
|
|
|
|
.declaredAmount(project.getDeclareAmount()) |
|
|
|
|
|
.projectType(project.getProjectType()) |
|
|
|
|
|
.projectYear(project.getProjectYear()) |
|
|
|
|
|
.buildOrg(project.getBuildOrgName()) |
|
|
|
|
|
.build(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private void buildOptionProjectQuery(LambdaQueryWrapper<Project> query, String meetingType, ProjectStatusEnum status) { |
|
|
private void buildOptionProjectQuery(LambdaQueryWrapper<Project> query, String meetingType, ProjectStatusEnum status) { |
|
|
String sql = String.format("select 1 from meeting m inner join meeting_inner_project mip on" + |
|
|
String sql = String.format("select 1 from meeting m inner join meeting_inner_project mip on" + |
|
|
" m.is_inner_project = true and m.id = mip.meeting_id and m.type = %s and m.status != 3", meetingType); |
|
|
" m.is_inner_project = true and m.id = mip.meeting_id and m.type = %s and m.status != 3", meetingType); |
|
|