From 80110fbee847334bd3a026bb06f12b3e1d9c0dd8 Mon Sep 17 00:00:00 2001 From: mjt <13607600062@163.com> Date: Wed, 22 May 2024 18:42:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=97=E4=BA=A4=E6=89=80=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E6=94=B9=E6=88=902B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ComprehensiveQueryController.java | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/ComprehensiveQueryController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/ComprehensiveQueryController.java index 145926d26..55872ef9d 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/ComprehensiveQueryController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/ComprehensiveQueryController.java @@ -258,9 +258,21 @@ public class ComprehensiveQueryController { DistrictStatBo statBo = districtStatService.findCurrentDistrictStat(new DistrictKey(district)); if (null != statBo) { if (statBo.getDistrictStat() != null) { - dto.setAvgPrice(statBo.getDistrictStat().getAvgPrice()); + // 有2B价格,使用2B价格 + Integer avgPrice2b = statBo.getDistrictStat().getAvg_price_2b(); + if (avgPrice2b != null && avgPrice2b > 0) { + dto.setAvgPrice(avgPrice2b); + } else { + dto.setAvgPrice(statBo.getDistrictStat().getAvgPrice()); + } } else if (statBo.getVillaDistrictStat() != null) { - dto.setAvgPrice(statBo.getVillaDistrictStat().getAvgPrice()); + // 有2B价格,使用2B价格 + Integer avgPrice2b = statBo.getVillaDistrictStat().getAvg_price_2b(); + if (avgPrice2b != null && avgPrice2b > 0) { + dto.setAvgPrice(avgPrice2b); + } else { + dto.setAvgPrice(statBo.getVillaDistrictStat().getAvgPrice()); + } } } @@ -640,10 +652,18 @@ public class ComprehensiveQueryController { 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); + // 有2B价格用2B价格,没有用2C + Integer minPrice = 0; + Integer maxPrice = 0; + if (evaluation.getAvgPrice2b() != null && evaluation.getAvgPrice2b() > 0) { + minPrice = (int) (evaluation.getAvgPrice2b() * 0.95); + maxPrice = (int) (evaluation.getAvgPrice2b() * 1.05); + } else { + minPrice = (int) (evaluation.getAvgPrice() * 0.95); + maxPrice = (int) (evaluation.getAvgPrice() * 1.05); + } // 偏离度超过5%不进行调整 - if (minPrice <= avgPrice && avgPrice <= maxPrice) { + if (minPrice != 0 && maxPrice != 0 && minPrice <= avgPrice && avgPrice <= maxPrice) { evaluation.setAvgPrice(avgPrice); evaluation.setBigTotalPrice((long) (avgPrice * evaluation.getArea())); } @@ -659,7 +679,11 @@ public class ComprehensiveQueryController { districtPriceMap.put("district", district.getRegion()); districtPriceMap.put("name", district.getName()); districtPriceMap.put("totalPrice", evaluation.getBigTotalPrice()); - districtPriceMap.put("avgPrice", evaluation.getAvgPrice()); + if (evaluation.getAvgPrice2b() != null && evaluation.getAvgPrice2b() != 0) { + districtPriceMap.put("avgPrice", evaluation.getAvgPrice2b()); + } else { + districtPriceMap.put("avgPrice", evaluation.getAvgPrice()); + } // 根据城市等 级设置D级可信度 ApiUserAuthority apiUserAuthority = apiUserAuthorityService @@ -884,7 +908,11 @@ public class ComprehensiveQueryController { otherPriceRets = new HashMap(); } - otherPriceRets.put("fjw_price", evaluation.getAvgPrice()); + if (evaluation.getAvgPrice2b()!=null&&evaluation.getAvgPrice2b() > 0){ + otherPriceRets.put("fjw_price", evaluation.getAvgPrice2b()); + }else { + otherPriceRets.put("fjw_price", evaluation.getAvgPrice()); + } Map levelMap = getPriceLevel(otherPriceRets, evaluation.getCredit()); Long lastPrice = getLastPrice(levelMap, otherPriceRets, evaluation, dCredit);