去友达参数

This commit is contained in:
2022-10-11 21:25:24 +08:00
parent 3ae709c5ce
commit 0cf86d57b8
@@ -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<YdDealPrice> 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<YdDealPrice> 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<String, Integer> buildDistrictAvgZouShiByMonth(DistrictModel model,DistrictKey districtKey, Date end, Date start) {
Map<String, List<Integer>> avgPriceDetailMap = new HashMap<String, List<Integer>>();
if(model.isYouDa() && "上海".equals(model.getCityName())){
List<YdDealPrice> list = ydDealPriceService.findYdDealPrices(districtKey.getCity(), districtKey.getRegion(), districtKey.getName(), start, end);
for (YdDealPrice stat : list) {
String ws = DateUtil.formatByPattern(stat.getWeekend(), "yyyy-MM");
List<Integer> prices = avgPriceDetailMap.get(ws);
if(null == prices){
prices = new ArrayList<Integer>();
avgPriceDetailMap.put(ws, prices);
}
prices.add(stat.getPrice());
}
}else{
// if(model.isYouDa() && "上海".equals(model.getCityName())){
// List<YdDealPrice> list = ydDealPriceService.findYdDealPrices(districtKey.getCity(), districtKey.getRegion(), districtKey.getName(), start, end);
// for (YdDealPrice stat : list) {
// String ws = DateUtil.formatByPattern(stat.getWeekend(), "yyyy-MM");
// List<Integer> prices = avgPriceDetailMap.get(ws);
// if(null == prices){
// prices = new ArrayList<Integer>();
// avgPriceDetailMap.put(ws, prices);
// }
// prices.add(stat.getPrice());
// }
// }else{
List<DistrictStat> 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<String, Integer> districtMap = new HashMap<String, Integer>();
if(null != avgPriceDetailMap){