diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/PropertyController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/PropertyController.java index 6b48880e9..587f0f599 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/PropertyController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/PropertyController.java @@ -396,6 +396,27 @@ public class PropertyController { put("5000", "five");// 五线 } }; + /** + * 第三方均价映射 + */ + private static final Map OTHER_PRICE_MAP = new HashMap() { + { + put("zhuge_price", "诸葛找房"); + put("anjuke_price", "安居客"); + put("fang_price", "房天下"); + put("lianjia_price", "链家"); + put("cityhouse_price", "禧泰数据"); + put("maitian_price", "麦田"); + put("ke_price", "贝壳"); + put("taofang_price", "淘房365"); + put("zhongyuan_price", "中原"); + put("tbs_price", "兔博士"); + put("qfang_price", "Q房"); + put("fangtan_price", "房探"); + put("fangduoduo_price", "房多多"); + put("wiwj_price", "我爱我家"); + } + }; /** * 利用百度API把GPS转换成Google经纬度 @@ -1251,6 +1272,8 @@ public class PropertyController { } Integer minPrice = (int)(evaluation.getAvgPrice() * 0.8); Integer maxPrice = (int)(evaluation.getAvgPrice() * 1.2); + Integer min10Price = (int)(evaluation.getAvgPrice() * 0.9); + Integer max10Price = (int)(evaluation.getAvgPrice() * 1.1); List houses = seawaterDao.findHouses(district.getCity(), district.getRegion(), names,minPrice, maxPrice, 20); if(houses.size() > 3){ districtPriceMap.put("calcType", 1); @@ -1276,6 +1299,29 @@ public class PropertyController { houseDtos.add(houseDto); } districtPriceMap.put("houses", houseDtos); + // 新增第三方均价 + try { + double dCredit = 0.61; + Map rMap = getLastEvaluationPrice(district, evaluation, dCredit); + if (null != rMap) { + if (rMap.containsKey("other_price")) { + Map otherPriceMap = (Map) rMap.get("other_price"); + Map priceResultMap = new HashMap(); + for (String key : otherPriceMap.keySet()) { + Integer price = otherPriceMap.get(key); + // 剔除偏差大于10的 + if (min10Price <= price && max10Price >= price) { + if (OTHER_PRICE_MAP.containsKey(key)) { + priceResultMap.put(OTHER_PRICE_MAP.get(key), price); + } + } + } + districtPriceMap.put("otherPrice", priceResultMap); + } + } + } catch (Exception ex) { + + } }else if(district.getLng() != null && district.getLng() > 0){ double lng = DataUtil.roundDouble(district.getLng() / 10000000000.0,6); double lat = DataUtil.roundDouble(district.getLat() / 10000000000.0, 6);