/house/around接口
This commit is contained in:
+9
-9
@@ -992,7 +992,7 @@ public class DistrictServiceImpl implements DistrictService {
|
||||
|
||||
/**
|
||||
* 根据QueryBean查询符合条件的小区数量
|
||||
*
|
||||
*
|
||||
* @param districtQueryBean
|
||||
* @return
|
||||
*/
|
||||
@@ -1067,7 +1067,7 @@ public class DistrictServiceImpl implements DistrictService {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param keyList
|
||||
* List<DistrictKey>
|
||||
* @param isNewDistrict
|
||||
@@ -1098,7 +1098,7 @@ public class DistrictServiceImpl implements DistrictService {
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param districtKey
|
||||
* DistrictKey
|
||||
* @param isNewDistrict
|
||||
@@ -1171,7 +1171,7 @@ public class DistrictServiceImpl implements DistrictService {
|
||||
|
||||
/**
|
||||
* 查找小区
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private District doFindDistrict(DistrictKey key, String cat) {
|
||||
@@ -1203,7 +1203,7 @@ public class DistrictServiceImpl implements DistrictService {
|
||||
|
||||
/**
|
||||
* 查找小区
|
||||
*
|
||||
*
|
||||
* @param key
|
||||
* DistrictKey
|
||||
* @param isNewDistrict
|
||||
@@ -1252,7 +1252,7 @@ public class DistrictServiceImpl implements DistrictService {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see com.fangjia.service.datastore.DistrictService#processDistrictInfo(java
|
||||
* .util.List, java.lang.String)
|
||||
*/
|
||||
@@ -2226,13 +2226,13 @@ public class DistrictServiceImpl implements DistrictService {
|
||||
|
||||
/**
|
||||
* 查找周边最相似的楼盘
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* 相似条件
|
||||
* |建筑类型(estate_type2)相同或包含
|
||||
* |建筑年代最多差5年
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @param district
|
||||
* @param radiusMeters
|
||||
* @param limit
|
||||
@@ -2431,7 +2431,7 @@ public class DistrictServiceImpl implements DistrictService {
|
||||
|
||||
/**
|
||||
* 查找最近的楼盘
|
||||
*
|
||||
*
|
||||
* @param district
|
||||
* @param radiusMeters
|
||||
* @param limit
|
||||
|
||||
@@ -469,4 +469,6 @@ public interface HouseService extends ModeService<String, HouseBo> {
|
||||
long findHouseByYearMonth(String city, String region, String districtName, int yearMonth);
|
||||
|
||||
HashMap<String, Object> findHouseStat(District districtKey, Integer avgPrice);
|
||||
|
||||
List<House> findNearestHasHouseByLocation(String city, Double lat,Double lng,String cat, int radiusMeters, int limit);
|
||||
}
|
||||
|
||||
+20
@@ -2612,5 +2612,25 @@ public class HouseServiceImpl implements HouseService {
|
||||
CacheUtils.putValue(CacheUtils.CachePolicyEnum.MIDDLE, HouseServiceImpl.class, key, value);
|
||||
return value;
|
||||
}
|
||||
@Override
|
||||
public List<House> findNearestHasHouseByLocation(String city,Double lat, Double lng, String cat,int radiusMeters, int limit) {
|
||||
if (lat == null || lng == null || lat <= 0 ||lng <= 0) {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
List<QueryParam> params = new ArrayList<QueryParam>();
|
||||
// params.add(new QueryParam("cat", cat));
|
||||
if (StringUtils.isNotBlank(city)){
|
||||
params.add(new QueryParam("city", city));
|
||||
}
|
||||
SdQuery sdQuery = new SdQuery();
|
||||
sdQuery.setPoint(lat + "," + lng);
|
||||
sdQuery.setField("lat_lng");
|
||||
// sdQuery.setDistance(String.valueOf((double) radiusMeters / 1000.0));
|
||||
sdQuery.setDistance(String.valueOf(radiusMeters));
|
||||
params.add(new QueryParam(QueryParam.SD_PARAM_NAME, sdQuery));
|
||||
// List<SortParam> sortParams = Arrays.asList(new SortParam("distance", true));
|
||||
List<House> list = houseDao.findAllByParams(params, null, 0, limit);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user