| | |
| | | .page(Page.of(informationQuery.getPageNum(), informationQuery.getPageSize())); |
| | | } |
| | | } |
| | | List<TCommittee> records = page.getRecords(); |
| | | List<Integer> regionIds = records.stream().map(TCommittee::getRegionId).collect(Collectors.toList()); |
| | | List<TRegion> regions = regionService.lambdaQuery().in(TRegion::getId, regionIds).list(); |
| | | |
| | | for (TCommittee record : page.getRecords()) { |
| | | TRegion byId = regionService.getById(record.getRegionId()); |
| | | record.setRegionName(byId.getProvinceName()+"-"+byId.getName()); |
| | | TTechnicalTitle byId1 = tTechnicalTitleService.getById(record.getTechnicalId() ); |
| | | TTitleMajor byId2 = majorService.getById(record.getMajorId()); |
| | | record.setTechnicalName(byId1.getTitileName()+"-"+byId2.getMajorName()); |
| | | List<Long> technicalIds = records.stream().map(TCommittee::getTechnicalId).collect(Collectors.toList()); |
| | | List<TTechnicalTitle> tTechnicalTitles = tTechnicalTitleService.lambdaQuery().in(TTechnicalTitle::getId, technicalIds).list(); |
| | | |
| | | List<Long> majorIds = records.stream().map(TCommittee::getMajorId).collect(Collectors.toList()); |
| | | List<TTitleMajor> tTitleMajors = majorService.lambdaQuery().in(TTitleMajor::getId, majorIds).list(); |
| | | |
| | | List<TCommitteeTechnical> tCommitteeTechnicals = committeeTechnicalService.lambdaQuery().eq(TCommitteeTechnical::getCommitteeId, record.getId()).list(); |
| | | List<TCommitteeMajor> tCommitteeMajors =tCommitteeMajorService.lambdaQuery().eq(TCommitteeMajor::getCommitteeId, record.getId()).list(); |
| | | List<Long> ids = records.stream().map(TCommittee::getId).collect(Collectors.toList()); |
| | | List<TCommitteeTechnical> committeeTechnicals = committeeTechnicalService.lambdaQuery().in(TCommitteeTechnical::getCommitteeId, ids).list(); |
| | | List<TCommitteeMajor> committeeMajors = tCommitteeMajorService.lambdaQuery().in(TCommitteeMajor::getCommitteeId, ids).list(); |
| | | |
| | | for (TCommittee record : records) { |
| | | TRegion region = regions.stream().filter(e -> e.getId().equals(record.getRegionId())).findFirst().orElse(null); |
| | | record.setRegionName(region.getProvinceName()+"-"+region.getName()); |
| | | TTechnicalTitle tTechnicalTitle = tTechnicalTitles.stream().filter(e -> e.getId().equals(record.getTechnicalId())).findFirst().orElse(null); |
| | | TTitleMajor tTitleMajor = tTitleMajors.stream().filter(e -> e.getId().equals(record.getMajorId())).findFirst().orElse(null); |
| | | record.setTechnicalName(tTechnicalTitle.getTitileName()+"-"+tTitleMajor.getMajorName()); |
| | | List<TCommitteeTechnical> tCommitteeTechnicals = committeeTechnicals.stream().filter(e -> e.getCommitteeId().equals(record.getId())).collect(Collectors.toList()); |
| | | List<TCommitteeMajor> tCommitteeMajors = committeeMajors.stream().filter(e -> e.getCommitteeId().equals(record.getId())).collect(Collectors.toList()); |
| | | record.setTCommitteeTechnicals(tCommitteeTechnicals); |
| | | record.setTCommitteeMajors(tCommitteeMajors); |
| | | } |