| | |
| | | import java.lang.reflect.Array; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @ApiOperation(value = "查询",tags = {"后台-申报通知","web-职称申报"}) |
| | | @PostMapping(value = "/list") |
| | | public R<Page<TDeclareNotice>> list(@RequestBody DeclareNoticeQuery informationQuery) { |
| | | Page<TDeclareNotice> page = tDeclareNoticeService.lambdaQuery() |
| | | .like(!StringUtils.isEmpty(informationQuery.getDeclareNoticeName()), TDeclareNotice::getDeclareNoticeName, informationQuery.getDeclareNoticeName()) |
| | | .eq(informationQuery.getRegionId() != null, TDeclareNotice::getRegionId, informationQuery.getRegionId()) |
| | | .eq(informationQuery.getTechnicalId() != null, TDeclareNotice::getTechnicalId, informationQuery.getTechnicalId()) |
| | | .eq(informationQuery.getMajorId() != null, TDeclareNotice::getMajorId, informationQuery.getMajorId()) |
| | | .eq(informationQuery.getLevel() != null, TDeclareNotice::getLevel, informationQuery.getLevel()) |
| | | .eq(informationQuery.getIsOnline()!=null, TDeclareNotice::getIsOnline, informationQuery.getIsOnline()) |
| | | .between(informationQuery.getDeclareStartTime1()!=null,TDeclareNotice::getDeclareStartTime,informationQuery.getDeclareStartTime1(),informationQuery.getDeclareStartTime2()) |
| | | .between(informationQuery.getDeclareEndTime1()!=null,TDeclareNotice::getDeclareEndTime,informationQuery.getDeclareEndTime1(),informationQuery.getDeclareEndTime2()) |
| | | .orderByDesc(TDeclareNotice::getNoticeSort) |
| | | .page(Page.of(informationQuery.getPageNum(), informationQuery.getPageSize())); |
| | | Page<TDeclareNotice> page; |
| | | if(informationQuery.getSortType()==1){ |
| | | page = tDeclareNoticeService.lambdaQuery() |
| | | .like(!StringUtils.isEmpty(informationQuery.getDeclareNoticeName()), TDeclareNotice::getDeclareNoticeName, informationQuery.getDeclareNoticeName()) |
| | | .eq(informationQuery.getRegionId() != null, TDeclareNotice::getRegionId, informationQuery.getRegionId()) |
| | | .eq(informationQuery.getTechnicalId() != null, TDeclareNotice::getTechnicalId, informationQuery.getTechnicalId()) |
| | | .eq(informationQuery.getMajorId() != null, TDeclareNotice::getMajorId, informationQuery.getMajorId()) |
| | | .eq(informationQuery.getLevel() != null, TDeclareNotice::getLevel, informationQuery.getLevel()) |
| | | .eq(informationQuery.getIsOnline()!=null, TDeclareNotice::getIsOnline, informationQuery.getIsOnline()) |
| | | .between(informationQuery.getDeclareStartTime1()!=null,TDeclareNotice::getDeclareStartTime,informationQuery.getDeclareStartTime1(),informationQuery.getDeclareStartTime2()) |
| | | .between(informationQuery.getDeclareEndTime1()!=null,TDeclareNotice::getDeclareEndTime,informationQuery.getDeclareEndTime1(),informationQuery.getDeclareEndTime2()) |
| | | .orderByDesc(TDeclareNotice::getCreateTime) |
| | | .page(Page.of(informationQuery.getPageNum(), informationQuery.getPageSize())); |
| | | }else { |
| | | page = tDeclareNoticeService.lambdaQuery() |
| | | .like(!StringUtils.isEmpty(informationQuery.getDeclareNoticeName()), TDeclareNotice::getDeclareNoticeName, informationQuery.getDeclareNoticeName()) |
| | | .eq(informationQuery.getRegionId() != null, TDeclareNotice::getRegionId, informationQuery.getRegionId()) |
| | | .eq(informationQuery.getTechnicalId() != null, TDeclareNotice::getTechnicalId, informationQuery.getTechnicalId()) |
| | | .eq(informationQuery.getMajorId() != null, TDeclareNotice::getMajorId, informationQuery.getMajorId()) |
| | | .eq(informationQuery.getLevel() != null, TDeclareNotice::getLevel, informationQuery.getLevel()) |
| | | .eq(informationQuery.getIsOnline()!=null, TDeclareNotice::getIsOnline, informationQuery.getIsOnline()) |
| | | .between(informationQuery.getDeclareStartTime1()!=null,TDeclareNotice::getDeclareStartTime,informationQuery.getDeclareStartTime1(),informationQuery.getDeclareStartTime2()) |
| | | .between(informationQuery.getDeclareEndTime1()!=null,TDeclareNotice::getDeclareEndTime,informationQuery.getDeclareEndTime1(),informationQuery.getDeclareEndTime2()) |
| | | .orderByDesc(TDeclareNotice::getNoticeSort) |
| | | .page(Page.of(informationQuery.getPageNum(), informationQuery.getPageSize())); |
| | | } |
| | | |
| | | for (TDeclareNotice record : page.getRecords()) { |
| | | TRegion byId = regionService.getById(record.getRegionId()); |
| | |
| | | tDeclareNotice.setDeclareNoticeFiles(tDeclareNoticeFiles); |
| | | tDeclareNotice.setDeclareNoticeTechnicals(tDeclareNoticeTechnicals); |
| | | tDeclareNotice.setDeclareNoticeMajors(tDeclareNoticeMajors); |
| | | if(StringUtils.isEmpty(tDeclareNotice.getDeclareLevel())){ |
| | | tDeclareNotice.setDeclareLevel(tDeclareNoticeTechnicals.stream().map(TDeclareNoticeTechnical::getLevelName).collect(Collectors.joining("/"))); |
| | | } |
| | | return R.ok(tDeclareNotice); |
| | | } |
| | | |