From 0cf86d57b891262dbd065e497e945344b52bf275 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Tue, 11 Oct 2022 21:25:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E5=8F=8B=E8=BE=BE=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../open/controllers/FshController.java | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/FshController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/FshController.java index 40a303f11..d5d69a1af 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/FshController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/FshController.java @@ -386,24 +386,24 @@ public class FshController { Double oneMonthMarkup = null; Evaluation evaluation = null; if(model.isYouDa()){ - if("上海".equals(model.getCity())){ - YdDealPrice ydDealPrice = ydDealPriceService.findYdDealPrice(model.getCity(), model.getDistrict(), model.getName()); - if(ydDealPrice == null){ - mav.setModel(BasicModel.buildOKModel().setMsg("该小区暂不支持估价").markNoData()); - return mav; - }else{ - evaluation = evaluationService.ydEvaluate(district, buildYdEvaluation(model, request), model.getCalDate(),ydDealPrice.getPrice()); - //近30天的涨跌幅:取最近1个月至3个月之间最近的那期价格和当前均价相比 - Date end = DateUtil.getDateOfLastMonth(new Date(),-1); - Date start = DateUtil.getDateOfLastMonth(new Date(),-3); - List ydDealPrices = ydDealPriceService.findYdDealPrices(model.getCity(), model.getDistrict(), model.getName(),start,end); - if(ydDealPrices!=null && ydDealPrices.size()>0){ - oneMonthMarkup = (double)(ydDealPrices.get(0).getPrice()-ydDealPrice.getPrice())/ydDealPrice.getPrice(); - } - } - }else{ +// if("上海".equals(model.getCity())){ +// YdDealPrice ydDealPrice = ydDealPriceService.findYdDealPrice(model.getCity(), model.getDistrict(), model.getName()); +// if(ydDealPrice == null){ +// mav.setModel(BasicModel.buildOKModel().setMsg("该小区暂不支持估价").markNoData()); +// return mav; +// }else{ +// evaluation = evaluationService.ydEvaluate(district, buildYdEvaluation(model, request), model.getCalDate(),ydDealPrice.getPrice()); +// //近30天的涨跌幅:取最近1个月至3个月之间最近的那期价格和当前均价相比 +// Date end = DateUtil.getDateOfLastMonth(new Date(),-1); +// Date start = DateUtil.getDateOfLastMonth(new Date(),-3); +// List ydDealPrices = ydDealPriceService.findYdDealPrices(model.getCity(), model.getDistrict(), model.getName(),start,end); +// if(ydDealPrices!=null && ydDealPrices.size()>0){ +// oneMonthMarkup = (double)(ydDealPrices.get(0).getPrice()-ydDealPrice.getPrice())/ydDealPrice.getPrice(); +// } +// } +// }else{ evaluation = evaluationService.evaluate(district, buildYdEvaluation(model, request), model.getCalDate()); - } +// } }else{ evaluation = evaluationService.evaluate(district, buildEvaluation(model, request), model.getCalDate()); } @@ -1163,18 +1163,18 @@ public class FshController { private Map buildDistrictAvgZouShiByMonth(DistrictModel model,DistrictKey districtKey, Date end, Date start) { Map> avgPriceDetailMap = new HashMap>(); - if(model.isYouDa() && "上海".equals(model.getCityName())){ - List list = ydDealPriceService.findYdDealPrices(districtKey.getCity(), districtKey.getRegion(), districtKey.getName(), start, end); - for (YdDealPrice stat : list) { - String ws = DateUtil.formatByPattern(stat.getWeekend(), "yyyy-MM"); - List prices = avgPriceDetailMap.get(ws); - if(null == prices){ - prices = new ArrayList(); - avgPriceDetailMap.put(ws, prices); - } - prices.add(stat.getPrice()); - } - }else{ +// if(model.isYouDa() && "上海".equals(model.getCityName())){ +// List list = ydDealPriceService.findYdDealPrices(districtKey.getCity(), districtKey.getRegion(), districtKey.getName(), start, end); +// for (YdDealPrice stat : list) { +// String ws = DateUtil.formatByPattern(stat.getWeekend(), "yyyy-MM"); +// List prices = avgPriceDetailMap.get(ws); +// if(null == prices){ +// prices = new ArrayList(); +// avgPriceDetailMap.put(ws, prices); +// } +// prices.add(stat.getPrice()); +// } +// }else{ List list = districtStatService.findDistrictPrice(districtKey.getCity(), districtKey.getRegion(), districtKey.getName(), start, end); for (DistrictStat stat : list) { String ws = DateUtil.formatByPattern(stat.getWeekend(), "yyyy-MM"); @@ -1185,7 +1185,7 @@ public class FshController { } prices.add(stat.getAvgPrice()); } - } +// } Map districtMap = new HashMap(); if(null != avgPriceDetailMap){