| | |
| | | } |
| | | // 根据用户历史搜索 推荐对应的区域 |
| | | } |
| | | // 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())) |
| | |
| | | SearchHouseResourceListRes searchHouseResourceListRes = new SearchHouseResourceListRes(); |
| | | searchHouseResourceListRes.setId(resource.getId()); |
| | | AppUser appUser = appUserService.selectById(resource.getAppUserId()); |
| | | if (appUser==null){ |
| | | continue; |
| | | } |
| | | searchHouseResourceListRes.setHouseResource(appUser.getUserType()); |
| | | if(StringUtils.hasLength(resource.getHousePhoto())){ |
| | | searchHouseResourceListRes.setImgUrl(resource.getHousePhoto().split(",")[0]); |
| | |
| | | } |
| | | return ResultUtil.success(3-size); |
| | | } |
| | | if (appUser.getUserType()==1){ |
| | | // 最多只能发布三条房源信息 |
| | | int size = this.baseMapper.selectList(new EntityWrapper<HouseResource>() |
| | | .eq("app_user_id", appUser.getId()) |
| | | .eq("is_delete", 0) |
| | | .eq("type",2) |
| | | ).size(); |
| | | if (3-size<0){ |
| | | return ResultUtil.success(0); |
| | | } |
| | | return ResultUtil.success(3-size); |
| | | } |
| | | if (appUser.getUserType()==3){ |
| | | // 如果是中介 判断他是否认证成功 |
| | | if (appUser.getAuth()==2){ |