| | |
| | | |
| | | |
| | | Set<Long> cacheSet = redisCache.getCacheSet("Consultation:" + userId); |
| | | List<TRegion> regions = regionService.lambdaQuery().list(); |
| | | List<TTechnicalTitle> tTechnicalTitles = tTechnicalTitleService.lambdaQuery().list(); |
| | | List<TTitleMajor> tTitleMajors = majorService.lambdaQuery().list(); |
| | | List<TConsultationClassification> consultationClassifications = consultationClassificationService.lambdaQuery().list(); |
| | | |
| | | for (TConsultation record : page.getRecords()) { |
| | | TRegion byId = regionService.getById(record.getRegionId()); |
| | | record.setRegionName(byId.getProvinceName()+"-"+byId.getName()); |
| | | TTechnicalTitle byId1 = tTechnicalTitleService.getById(record.getTitleId()); |
| | | TTitleMajor byId2 = majorService.getById(record.getMajorId()); |
| | | record.setTechnicalName(byId1.getTitileName()+"-"+byId2.getMajorName()); |
| | | TConsultationClassification byId3 = consultationClassificationService.getById(record.getClassificationId()); |
| | | record.setTConsultationClassificationName(byId3.getConsultationName()); |
| | | TRegion region = regions.stream().filter(e -> e.getId().equals(record.getRegionId())).findFirst().orElse(null); |
| | | TTechnicalTitle tTechnicalTitle = tTechnicalTitles.stream().filter(e -> e.getId().equals(record.getTitleId())).findFirst().orElse(null); |
| | | TTitleMajor tTitleMajor = tTitleMajors.stream().filter(e -> e.getId().equals(record.getMajorId())).findFirst().orElse(null); |
| | | record.setRegionName(region.getProvinceName()+"-"+region.getName()); |
| | | record.setTechnicalName(tTechnicalTitle.getTitileName()+"-"+tTitleMajor.getMajorName()); |
| | | TConsultationClassification tConsultationClassification = consultationClassifications.stream().filter(e -> e.getId().equals(record.getClassificationId())).findFirst().orElse(null); |
| | | record.setTConsultationClassificationName(tConsultationClassification.getConsultationName()); |
| | | if (cacheSet!=null){ |
| | | if (cacheSet.contains(record.getId())){ |
| | | record.setIsCollect(1); |
| | |
| | | @ApiOperation(value = "详情",tags = {"后台-咨询管理-咨询列表","web-咨询查询"}) |
| | | @PostMapping(value = "/detail") |
| | | public R<TConsultation> detail(@RequestParam Long id ) { |
| | | TConsultation byId = informationService.getById(id); |
| | | byId.setWatchNum(byId.getWatchNum()+1); |
| | | informationService.updateById(byId); |
| | | TTechnicalTitle byId1 = tTechnicalTitleService.getById(byId.getTitleId()); |
| | | byId.setTechnicalName(byId1.getTitileName()); |
| | | TTitleMajor byId2 = majorService.getById(byId.getMajorId()); |
| | | byId.setMajorName(byId2.getMajorName()); |
| | | TLevel byId3 = levelService.getById(byId.getLevel()); |
| | | byId.setLevelName(byId3.getName()); |
| | | TRegion byId4 = regionService.getById(byId.getRegionId()); |
| | | byId.setTRegion(byId4); |
| | | return R.ok(byId); |
| | | TConsultation consultation = informationService.getById(id); |
| | | consultation.setWatchNum(consultation.getWatchNum()+1); |
| | | informationService.updateById(consultation); |
| | | TTechnicalTitle tTechnicalTitle = tTechnicalTitleService.getById(consultation.getTitleId()); |
| | | consultation.setTechnicalName(tTechnicalTitle.getTitileName()); |
| | | TTitleMajor tTitleMajor = majorService.getById(consultation.getMajorId()); |
| | | consultation.setMajorName(tTitleMajor.getMajorName()); |
| | | TLevel level = levelService.getById(consultation.getLevel()); |
| | | consultation.setLevelName(level.getName()); |
| | | TRegion region = regionService.getById(consultation.getRegionId()); |
| | | consultation.setTRegion(region); |
| | | return R.ok(consultation); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "观看",tags = {"web-咨询查询"}) |
| | | @PostMapping(value = "/watch") |
| | | public R watch(@RequestParam Long id ) { |
| | | TConsultation byId = informationService.getById(id); |
| | | byId.setWatchNum(byId.getWatchNum()+1); |
| | | informationService.updateById(byId); |
| | | TConsultation consultation = informationService.getById(id); |
| | | consultation.setWatchNum(consultation.getWatchNum()+1); |
| | | informationService.updateById(consultation); |
| | | return R.ok(); |
| | | |
| | | } |