From 29a456e9453ef59845005215aebc8a05f1cba9db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Mon, 10 Feb 2025 16:23:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9D=87=E4=BB=B7=E4=BF=9D=E6=8C=81=E4=B8=80?= =?UTF-8?q?=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coresite/controllers/EvaluationController.java | 6 ++++-- .../fangjia/service/datastore/EvaluationServiceImpl.java | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/EvaluationController.java b/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/EvaluationController.java index be342ece4..30a73fa2f 100644 --- a/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/EvaluationController.java +++ b/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/EvaluationController.java @@ -3665,12 +3665,14 @@ public Object checkUserAction(EvaluationModel model, HttpServletRequest req, Htt SimpleDateFormat format = new SimpleDateFormat("yyyy.MM"); for (Date key : districtStatMap.keySet()) { DistrictStat ds = districtStatMap.get(key); - districtMap.put(format.format(ds.getWeekend()),ds.getAvgPrice()); + Integer avgPrice = ds.getAvg_price_2b() != null ? ds.getAvg_price_2b() : ds.getAvgPrice(); + districtMap.put(format.format(ds.getWeekend()), avgPrice); } for (Date key : villaDistrictStatMap.keySet()) { DistrictStat ds = villaDistrictStatMap.get(key); - districtMap.put(format.format(ds.getWeekend()),ds.getAvgPrice()); + Integer avgPrice = ds.getAvg_price_2b() != null ? ds.getAvg_price_2b() : ds.getAvgPrice(); + districtMap.put(format.format(ds.getWeekend()), avgPrice); } } diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/EvaluationServiceImpl.java b/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/EvaluationServiceImpl.java index 070094dc1..0146770f1 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/EvaluationServiceImpl.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/EvaluationServiceImpl.java @@ -1,5 +1,6 @@ package com.fangjia.service.datastore; +import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; @@ -338,7 +339,10 @@ public class EvaluationServiceImpl implements EvaluationService { if(useAvgMode) { DistrictStatBo districtStatBo = districtStatService.findDistrictStat(districtKey); if (districtStatBo != null && districtStatBo.getDefaultDistrictStat() != null && districtStatBo.getDefaultDistrictStat().getAvgPrice() > 0) { - long totalPrice = evaluationRateService.evaluation(districtStatBo.getDefaultDistrictStat().getAvgPrice(), evaluation); + Double avgPrice = (double) (districtStatBo.getDefaultDistrictStat().getAvg_price_2b() != null ? districtStatBo.getDefaultDistrictStat().getAvg_price_2b() : districtStatBo.getDefaultDistrictStat().getAvgPrice()); + // 均价乘以系数 + avgPrice *= 1.04; + long totalPrice = evaluationRateService.evaluation(BigDecimal.valueOf(avgPrice).setScale(0, BigDecimal.ROUND_HALF_UP).intValue(), evaluation); avgModeValue = ((Number) (totalPrice)).intValue(); avgModeCredit = districtStatBo.getDefaultDistrictStat().getCredit(); } @@ -1898,7 +1902,8 @@ public class EvaluationServiceImpl implements EvaluationService { private void buildWeekAvgPrice(EvaluationBeforeLoanBean dto, Evaluation evaluation) { DistrictStatBo bo = getNearestDistrictStat(new DistrictKey(evaluation.getCity(), evaluation.getRegion(), evaluation.getDistrictName())); if (bo != null) { - dto.setWeekAvgPrice(bo.getDistrictStat().getAvgPrice()); + Integer avgPrice = bo.getDistrictStat().getAvg_price_2b() != null ? bo.getDistrictStat().getAvg_price_2b() : bo.getDistrictStat().getAvgPrice(); + dto.setWeekAvgPrice(avgPrice); dto.setTopWeekUpDownRange(bo.getDistrictStat().getWeekendMarkup()); } }