| | |
| | | @ApiOperation(value = "获取房源详情", tags = {"详情"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "房源id", required = true), |
| | | // @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = false, paramType = "header") |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = false, paramType = "header") |
| | | }) |
| | | public ResultUtil<HouseResourceInfoRes> getHouseResourceInfo(Integer id){ |
| | | HouseResourceInfoRes houseResourceInfo = houseResourceService.getHouseResourceInfo(id); |
| | |
| | | au.user_type as houseResource, |
| | | hr.house_photo as imgUrl, |
| | | hr.title, |
| | | hr.headImg, |
| | | hr.house_area as houseArea, |
| | | hr.house_model as houseModel, |
| | | concat(rp.`name`, rc.`name`) as address, |
| | |
| | | } |
| | | // 根据用户历史搜索 推荐对应的区域 |
| | | } |
| | | // if(StringUtils.hasLength(req.getDistrict())){ |
| | | // cityIds = new ArrayList<>(); |
| | | // districtIds = new ArrayList<>(); |
| | | // JSONArray jsonArray = JSON.parseArray(req.getDistrict()); |
| | | // for (int i = 0; i < jsonArray.size(); i++) { |
| | | // JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | // Integer cityId = jsonObject.getInteger("cityId"); |
| | | // Integer districtId = jsonObject.getInteger("districtId"); |
| | | // //不限区域 |
| | | // if(0 == districtId || null == districtId){ |
| | | // List<Region> regions = regionService.selectList(new EntityWrapper<Region>().eq("parent_id", cityId)); |
| | | // districtIds.addAll(regions.stream().map(Region::getId).collect(Collectors.toList())); |
| | | // } |
| | | // cityIds.add(cityId); |
| | | // districtIds.add(districtId); |
| | | // } |
| | | // } |
| | | |
| | | //价格范围 |
| | | Double saleAmountStart = null; |
| | | Double saleAmountEnd = null; |
| | |
| | | } |
| | | SearchHouseResourceRes searchHouseResource = new SearchHouseResourceRes(); |
| | | List<SearchHouseResourceListRes> searchHouseResourceListRes = this.baseMapper.searchHouseResource(req, cityIds, districtIds, saleAmountStart, saleAmountEnd, houseModels, houseTypeIds); |
| | | |
| | | |
| | | // 如果有根据用户历史来搜索必看 如果没有搜索出数据 那么查询所有必看 |
| | | if (req.getDataType()!=null&&req.getDataType()==1 && (!StringUtils.hasLength(req.getDistrict())) |
| | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | HousingDemand housingDemand = this.selectById(id); |
| | | HousingDemandInfoRes housingDemandInfoRes = new HousingDemandInfoRes(); |
| | | // AppUser appUser = appUserService.getAppUser(); |
| | | AppUser appUser = appUserService.getAppUser(); |
| | | housingDemandInfoRes.setId(id); |
| | | housingDemandInfoRes.setDataType(housingDemand.getDataType()); |
| | | housingDemandInfoRes.setQrCode(housingDemand.getQrCode()); |
| | |
| | | int collectionTimes = collectionHousingDemandService.selectCount(new EntityWrapper<CollectionHousingDemand>().eq("housing_demand_id", id)); |
| | | housingDemandInfoRes.setCollectionTimes(collectionTimes); |
| | | housingDemandInfoRes.setCollection(0); |
| | | // if(null != appUser){ |
| | | // int collection = collectionHousingDemandService |
| | | // .selectCount(new EntityWrapper<CollectionHousingDemand>() |
| | | // .eq("housing_demand_id", id) |
| | | // .eq("app_user_id", appUser.getId())); |
| | | // housingDemandInfoRes.setCollection(0 == collection ? 0 : 1); |
| | | // } |
| | | if(null != appUser){ |
| | | int collection = collectionHousingDemandService |
| | | .selectCount(new EntityWrapper<CollectionHousingDemand>() |
| | | .eq("housing_demand_id", id) |
| | | .eq("app_user_id", appUser.getId())); |
| | | housingDemandInfoRes.setCollection(0 == collection ? 0 : 1); |
| | | } |
| | | //添加访问次数记录 |
| | | // addViewsNumber(housingDemand); |
| | | addViewsNumber(housingDemand); |
| | | return housingDemandInfoRes; |
| | | } |
| | | |