新增一房一价逻辑

This commit is contained in:
Jian Shen
2022-05-23 13:20:19 +08:00
parent 13a146e4c6
commit 7033812428
@@ -397,7 +397,7 @@ public class PropertyController {
/** /**
* 利用百度API把GPS转换成Google经纬度 * 利用百度API把GPS转换成Google经纬度
* *
* @param lng * @param lng
* @param lat * @param lat
* @return * @return
@@ -419,7 +419,7 @@ public class PropertyController {
/** /**
* 利用算法模板把GPS转换成Google经纬度 * 利用算法模板把GPS转换成Google经纬度
* *
* @param lng * @param lng
* @param lat * @param lat
* @return * @return
@@ -611,7 +611,7 @@ public class PropertyController {
/** /**
* 判断小区是否有经纬度 * 判断小区是否有经纬度
* *
* @param district * @param district
* @return * @return
*/ */
@@ -622,7 +622,7 @@ public class PropertyController {
/** /**
* 调用匹配接口匹配小区 * 调用匹配接口匹配小区
* *
* @param city * @param city
* @param address * @param address
* @param region * @param region
@@ -1000,6 +1000,32 @@ public class PropertyController {
} }
} }
// 调整面积不同面积价格
try {
DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district));
int orgAvgPrice = 0;
if (districtStatBo != null) {
if (StringUtils.isNotBlank(district.getEstateType2()) && district.getEstateType2().contains("别墅") && districtStatBo.getVillaDistrictStat() != null) {
orgAvgPrice = districtStatBo.getVillaDistrictStat().getAvgPrice();
} else if (districtStatBo.getDistrictStat() != null) {
orgAvgPrice = districtStatBo.getDistrictStat().getAvgPrice();
}
}
if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) {
int factorPrice = evaluation.getAvgPrice();
int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice);
Integer minPrice = (int)(evaluation.getAvgPrice() * 0.95);
Integer maxPrice = (int)(evaluation.getAvgPrice() * 1.05);
// 偏离度超过5%不进行调整
if (minPrice <= avgPrice && avgPrice <= maxPrice) {
evaluation.setAvgPrice(avgPrice);
evaluation.setBigTotalPrice((long) (avgPrice * evaluation.getArea()));
}
}
} catch (Exception ex) {
}
if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0 if (evaluation.getTotalPrice() != null && evaluation.getTotalPrice() != 0
&& (cityPriceCredit == null || evaluation.getCredit() >= cityPriceCredit)) { && (cityPriceCredit == null || evaluation.getCredit() >= cityPriceCredit)) {
Map<String, Object> districtPriceMap = new HashMap<String, Object>(); Map<String, Object> districtPriceMap = new HashMap<String, Object>();
@@ -1172,20 +1198,29 @@ public class PropertyController {
return mav; return mav;
} }
// 调整面积不同面积价格 // 调整面积不同面积价格
DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district)); try {
int orgAvgPrice = 0; DistrictStatBo districtStatBo = districtStatService.findDistrictStat(new DistrictKey(district));
if (districtStatBo != null) { int orgAvgPrice = 0;
if (StringUtils.isNotBlank(district.getEstateType2()) && district.getEstateType2().contains("别墅") && districtStatBo.getVillaDistrictStat() != null) { if (districtStatBo != null) {
orgAvgPrice = districtStatBo.getVillaDistrictStat().getAvgPrice(); if (StringUtils.isNotBlank(district.getEstateType2()) && district.getEstateType2().contains("别墅") && districtStatBo.getVillaDistrictStat() != null) {
} else if (districtStatBo.getDistrictStat() != null) { orgAvgPrice = districtStatBo.getVillaDistrictStat().getAvgPrice();
orgAvgPrice = districtStatBo.getDistrictStat().getAvgPrice(); } else if (districtStatBo.getDistrictStat() != null) {
orgAvgPrice = districtStatBo.getDistrictStat().getAvgPrice();
}
} }
} if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) {
if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) { int factorPrice = evaluation.getAvgPrice();
int factorPrice = evaluation.getAvgPrice(); int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice);
int avgPrice = evaluateFactorService.recompose(district.getCity(), district.getRegion(), evaluation.getArea(), factorPrice, orgAvgPrice); Integer minPrice = (int)(evaluation.getAvgPrice() * 0.95);
evaluation.setAvgPrice(avgPrice); Integer maxPrice = (int)(evaluation.getAvgPrice() * 1.05);
evaluation.setTotalPrice((int) (avgPrice * evaluation.getArea())); // 偏离度超过5%不进行调整
if (minPrice <= avgPrice && avgPrice <= maxPrice) {
evaluation.setAvgPrice(avgPrice);
evaluation.setBigTotalPrice((long) (avgPrice * evaluation.getArea()));
}
}
} catch (Exception ex) {
} }
Map<String, Object> districtPriceMap = new LinkedHashMap<String, Object>(); Map<String, Object> districtPriceMap = new LinkedHashMap<String, Object>();
districtPriceMap.put("city", district.getCity()); districtPriceMap.put("city", district.getCity());
@@ -1512,7 +1547,7 @@ public class PropertyController {
return mav; return mav;
} }
} }
/** /**
* 四川锦程 定制接口 多建筑年代 * 四川锦程 定制接口 多建筑年代
* @param model * @param model
@@ -1624,7 +1659,7 @@ public class PropertyController {
districtPriceMap.put("buildYear", matcher3.group()); districtPriceMap.put("buildYear", matcher3.group());
} }
} }
// 根据城市等 级设置D级可信度 // 根据城市等 级设置D级可信度
ApiUserAuthority apiUserAuthority = apiUserAuthorityService ApiUserAuthority apiUserAuthority = apiUserAuthorityService
@@ -2137,7 +2172,7 @@ public class PropertyController {
/** /**
* 小区租金查询接口 * 小区租金查询接口
* *
* @param model * @param model
* @return * @return
*/ */
@@ -2616,7 +2651,7 @@ public class PropertyController {
/** /**
* 批量获取小区的均价,均价走势数据 * 批量获取小区的均价,均价走势数据
* *
* @param request * @param request
* @return * @return
*/ */
@@ -2758,7 +2793,7 @@ public class PropertyController {
/** /**
* 批量获取小区的配套数据,最多12个小区 * 批量获取小区的配套数据,最多12个小区
* *
* @param request * @param request
* @return * @return
*/ */
@@ -2903,7 +2938,7 @@ public class PropertyController {
/** /**
* 获取JSON参数中的num参数值 * 获取JSON参数中的num参数值
* *
* @param jo * @param jo
* @return * @return
*/ */
@@ -2928,7 +2963,7 @@ public class PropertyController {
/** /**
* 获取JSON参数中的radius值 * 获取JSON参数中的radius值
* *
* @param jo * @param jo
* @return * @return
*/ */
@@ -3736,7 +3771,7 @@ public class PropertyController {
/** /**
* 解析出关键字中的小区名 * 解析出关键字中的小区名
* *
* @param keyword * @param keyword
* @return * @return
*/ */
@@ -3853,7 +3888,7 @@ public class PropertyController {
/** /**
* 小区统计分析接口 * 小区统计分析接口
* *
* @param model * @param model
* @return * @return
*/ */
@@ -3938,7 +3973,7 @@ public class PropertyController {
/** /**
* 小区交通接口 * 小区交通接口
* *
* @param model * @param model
* @return * @return
*/ */
@@ -3996,7 +4031,7 @@ public class PropertyController {
/** /**
* 小区周边接口 * 小区周边接口
* *
* @param model * @param model
* @return * @return
*/ */
@@ -4055,7 +4090,7 @@ public class PropertyController {
/** /**
* 相同小区相似户型房源挂牌量接口<br> * 相同小区相似户型房源挂牌量接口<br>
* 获取该小区的满足指定相似条件的挂牌房源量 条件说明: 1.输入面积-5<=房源面积<=输入面积+5 2.上个月发布的房源 * 获取该小区的满足指定相似条件的挂牌房源量 条件说明: 1.输入面积-5<=房源面积<=输入面积+5 2.上个月发布的房源
* *
* @author yinjihuan * @author yinjihuan
* @date 2016年9月1日 * @date 2016年9月1日
* @param city * @param city
@@ -4095,7 +4130,7 @@ public class PropertyController {
/** /**
* 周边小区相似户型挂牌量接口<br> * 周边小区相似户型挂牌量接口<br>
* 获取该小区的满足指定相似条件的挂牌房源量 条件说明: 1.输入面积-5<=房源面积<=输入面积+5 2.上个月发布的房源 * 获取该小区的满足指定相似条件的挂牌房源量 条件说明: 1.输入面积-5<=房源面积<=输入面积+5 2.上个月发布的房源
* *
* @author yinjihuan * @author yinjihuan
* @date 2016年9月1日 * @date 2016年9月1日
* @param city * @param city
@@ -4146,7 +4181,7 @@ public class PropertyController {
/** /**
* 小区周边一公里均价 * 小区周边一公里均价
* *
* @author wenyan * @author wenyan
* @param model * @param model
* @return * @return
@@ -4169,7 +4204,7 @@ public class PropertyController {
/** /**
* 相同小区相似户型租金范围查询接口 * 相同小区相似户型租金范围查询接口
* *
* @param model * @param model
* @return * @return
*/ */
@@ -4212,7 +4247,7 @@ public class PropertyController {
/** /**
* 周边小区相似户型租金范围查询接口 * 周边小区相似户型租金范围查询接口
* *
* @param model * @param model
* @return * @return
*/ */
@@ -4275,7 +4310,7 @@ public class PropertyController {
/** /**
* 室号查询接口 * 室号查询接口
* *
* @param model * @param model
* @return * @return
*/ */
@@ -4311,7 +4346,7 @@ public class PropertyController {
/** /**
* 楼栋楼层信息查询接口 * 楼栋楼层信息查询接口
* *
* @param model * @param model
* @return * @return
*/ */
@@ -4336,7 +4371,7 @@ public class PropertyController {
/** /**
* 楼栋查询接口 * 楼栋查询接口
* *
* @param model * @param model
* @return * @return
*/ */
@@ -4381,7 +4416,7 @@ public class PropertyController {
/** /**
* 楼栋查询接口 * 楼栋查询接口
* *
* @param model * @param model
* @return * @return
*/ */
@@ -4834,7 +4869,7 @@ public class PropertyController {
/** /**
* 房产交易记录查询 * 房产交易记录查询
* *
* @param model * @param model
* @return * @return
*/ */
@@ -4894,7 +4929,7 @@ public class PropertyController {
/** /**
* 房产拍卖记录 * 房产拍卖记录
* *
* @param model * @param model
* @return * @return
*/ */
@@ -4955,7 +4990,7 @@ public class PropertyController {
/** /**
* 房产近期评估次数 * 房产近期评估次数
* *
* @param model * @param model
* @return * @return
*/ */