新增一房一价逻辑
This commit is contained in:
+48
-13
@@ -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());
|
||||||
|
|||||||
Reference in New Issue
Block a user