From 6bd20938e6af96936ca18731dad1b3373d8d4ea8 Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Mon, 8 Aug 2022 15:30:33 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A7=9F=E9=87=91?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RentPriceUpdateController.java | 1163 +++++++++++++++++ .../controllers/SqMetreRentController.java | 6 +- .../bkoff/model/RentPriceUpdateModel.java | 341 +++++ .../src/main/webapp/district/list.ftl | 1 + .../main/webapp/rentPriceUpdate/detail.ftl | 470 +++++++ .../webapp/rentPriceUpdate/districtDetail.ftl | 946 ++++++++++++++ .../webapp/rentPriceUpdate/districtList.ftl | 344 +++++ .../webapp/rentPriceUpdate/doCreatTask.ftl | 278 ++++ .../webapp/rentPriceUpdate/guidingList.ftl | 192 +++ .../webapp/rentPriceUpdate/guidingPrice.ftl | 111 ++ .../main/webapp/rentPriceUpdate/listQR.ftl | 125 ++ .../main/webapp/rentPriceUpdate/listSQR.ftl | 110 ++ .../webapp/rentPriceUpdate/loadQRData.ftl | 102 ++ .../webapp/rentPriceUpdate/loadSQRData.ftl | 49 + .../main/webapp/rentPriceUpdate/taskList.ftl | 160 +++ .../fangjia/dal/mongo/model/SqmetreRent.java | 92 +- .../datastore/EvaluationServiceImpl.java | 2 +- .../service/district/SqmetreRentService.java | 2 + .../district/SqmetreRentServiceImpl.java | 20 +- 19 files changed, 4455 insertions(+), 59 deletions(-) create mode 100644 projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/RentPriceUpdateController.java create mode 100644 projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/RentPriceUpdateModel.java create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/detail.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtDetail.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtList.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/doCreatTask.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingList.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingPrice.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listQR.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listSQR.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadQRData.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadSQRData.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/taskList.ftl diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/RentPriceUpdateController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/RentPriceUpdateController.java new file mode 100644 index 000000000..d60f9430a --- /dev/null +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/RentPriceUpdateController.java @@ -0,0 +1,1163 @@ +package com.fangjia.bkoff.controllers; + +import com.fangjia.bkoff.model.AvgPriceUpdateModel; +import com.fangjia.bkoff.model.GuidingAvgPriceUpdateModel; +import com.fangjia.bkoff.model.JsonModel; +import com.fangjia.bkoff.model.RentPriceUpdateModel; +import com.fangjia.core.RegionData; +import com.fangjia.core.util.AnalyticsUtil; +import com.fangjia.core.util.DataUtil; +import com.fangjia.core.util.DateUtil; +import com.fangjia.core.util.RandomUtil; +import com.fangjia.dal.common.DistrictKey; +import com.fangjia.dal.common.ServerAreaData; +import com.fangjia.dal.mongo.dao.*; +import com.fangjia.dal.mongo.fangjia.model.ServerArea; +import com.fangjia.dal.mongo.model.DistrictStat; +import com.fangjia.dal.mongo.model.RegionStat; +import com.fangjia.dal.mongo.model.SqmetreRent; +import com.fangjia.dal.mongo.model.bkoff.*; +import com.fangjia.dal.seawater.model.Seawater; +import com.fangjia.dal.seaweed.model.District; +import com.fangjia.service.bo.AvgUpdateBo; +import com.fangjia.service.bo.DistrictStatBo; +import com.fangjia.service.datastore.DistrictService; +import com.fangjia.service.datastore.RegionStatService; +import com.fangjia.service.district.DistrictStatService; +import com.fangjia.service.district.SqmetreRentService; +import com.fangjia.service.mongo.bkoff.*; +import com.fangjia.service.mongo.fangjia.DealPriceService; +import com.fangjia.service.mongo.fangjia.SeawaterService; +import com.ibm.icu.text.MessageFormat; +import com.mongodb.BasicDBObject; +import com.mongodb.DBObject; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.time.DateUtils; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.BooleanClause; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.TermQuery; +import org.apache.solr.client.solrj.util.ClientUtils; +import org.bson.types.ObjectId; +import org.sothis.core.util.Pager; +import org.sothis.web.mvc.annotation.Param; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; +import java.util.*; + +/** + * 负责租金更新任务的管理工作 + */ +public class RentPriceUpdateController { + + private RegionStatService regionStatService; + private CalcCommandService calcCommandService; + private DistrictStatService districtStatService; + private SqmetreRentService sqmetreRentService; + private CalcDistrictStatDao calcDistrictStatDao; + private AvgBaseDao avgBaseDao; + private DistrictService districtService; + private AverageStatisticsDao averageStatisticsDao; + private DealPriceService dealPriceService; + private GuidingPriceService guidingPriceService; + private CalcConfigService calcConfigService; + private AveragerQualityReportService averagerQualityReportService; + private SampleQualityReportService sampleQualityReportService; + private ComparePriceDao comparePriceDao; + private ComparePriceCityDao comparePriceCityDao; + private SeawaterService seawaterService; + private static final List IPS = Arrays.asList("fangjia-priceanalysis-0"); + + private static final List HOT_CITIES = Arrays.asList("上海", "北京", "广州", "深圳", "天津", "重庆", "成都", "杭州", "南京", "长沙", + "武汉", "西安", "沈阳"); + + public Object listQRAction(AvgPriceUpdateModel model) { + if(StringUtils.isBlank(model.getCityDisplay())) { + model.setCityDisplay("全国"); + } + + if(model.getSdateStart() <= 0 || model.getSdateEnd() <= 0) { + Date sunday = DateUtil.getThisSunday(new Date()); + model.setSdateStart(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(DateUtil.getBeforeDay(sunday, 13 * 7)))); //最近一季度 + model.setSdateEnd(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(sunday))); + } + + if(StringUtils.isBlank(model.getStype())) { + model.setStype("1"); + } + + if(StringUtils.isBlank(model.getVts())) { + model.setVts("1"); + } + + return model; + } + + public Object listSQRAction(AvgPriceUpdateModel model) { + if(StringUtils.isBlank(model.getCityDisplay())) { + model.setCityDisplay("全国"); + } + + if(model.getSdateStart() <= 0 || model.getSdateEnd() <= 0) { + Date sunday = DateUtil.getThisSunday(new Date()); + model.setSdateStart(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(DateUtil.getBeforeDay(sunday, 13 * 7)))); //最近一季度 + model.setSdateEnd(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(sunday))); + } + + if(StringUtils.isBlank(model.getStype())) { + model.setStype("1"); + } + + if(StringUtils.isBlank(model.getVts())) { + model.setVts("1"); + } + return model; + } + + public Object loadQRDataAction(AvgPriceUpdateModel model) { + if(StringUtils.isBlank(model.getCityDisplay())) { + model.setCityDisplay("全国"); + } + + if(model.getSdateStart() <= 0 || model.getSdateEnd() <= 0) { + Date sunday = DateUtil.getThisSunday(new Date()); + model.setSdateStart(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(DateUtil.getBeforeDay(sunday, 13)))); //最近一季度 + model.setSdateEnd(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(sunday))); + } + + if(StringUtils.isBlank(model.getStype())) { + model.setStype("1"); + } + + JSONArray series = createQualitySeries(model.getCityDisplay(), model.getStype(), model.getVts(), DateUtil.parseDate(String.valueOf(model.getSdateStart()), "yyyyMMdd"), DateUtil.parseDate(String.valueOf(model.getSdateEnd()), "yyyyMMdd")); + model.setSeries(series.toString().replace("\"name\"", "name").replace("\"data\"", "data").replace("\"visible\"", "visible")); + return model; + } + + public Object loadSQRDataAction(AvgPriceUpdateModel model) { + if(StringUtils.isBlank(model.getCityDisplay())) { + model.setCityDisplay("全国"); + } + + if(model.getSdateStart() <= 0 || model.getSdateEnd() <= 0) { + Date sunday = DateUtil.getThisSunday(new Date()); + model.setSdateStart(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(DateUtil.getBeforeDay(sunday, 13)))); //最近一季度 + model.setSdateEnd(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(sunday))); + } + + if(StringUtils.isBlank(model.getStype())) { + model.setStype("1"); + } + + JSONArray series = createSampleSeries(model.getCityDisplay(), model.getStype(), model.getVts(), DateUtil.parseDate(String.valueOf(model.getSdateStart()), "yyyyMMdd"), DateUtil.parseDate(String.valueOf(model.getSdateEnd()), "yyyyMMdd")); + model.setSeries(series.toString().replace("\"name\"", "name").replace("\"data\"", "data").replace("\"visible\"", "visible")); + return model; + } + + private JSONArray createSampleSeries(String city, String stype, String vts, Date startDate, Date endDate) { + List sampleQualityReports = sampleQualityReportService.findQualityReports(city, Integer.parseInt(DateUtil.formatToTightYYYYMMDD(startDate)), + Integer.parseInt(DateUtil.formatToTightYYYYMMDD(endDate))); + + JSONArray ret = new JSONArray(); + JSONObject jo1 = new JSONObject(), jo2 = new JSONObject(), jo3 = new JSONObject(),jo4 = new JSONObject(), + jo5 = new JSONObject(), jo6 = new JSONObject(), jo7 = new JSONObject(), jo8 = new JSONObject(); + JSONArray pt1 = new JSONArray(), pt2 = new JSONArray(), pt3 = new JSONArray(), pt4 = new JSONArray(), + pt5 = new JSONArray(), pt6 = new JSONArray(), pt7 = new JSONArray(), pt8 = new JSONArray(); + + if("1".equals(stype)) { + jo1.put("name", "一个月<10小区量"); + jo2.put("name", "一个月<30小区量"); + jo3.put("name", "一个月<100小区量"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + sqr.getMonthCount1() + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + sqr.getMonthCount2() + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + sqr.getMonthCount3() + "]")); + } + }else if("2".equals(stype)) { + jo1.put("name", "一个月<10比例"); + jo2.put("name", "一个月<30比例"); + jo3.put("name", "一个月<100比例"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getMonthCount1() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getMonthCount2() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getMonthCount3() / (double)sqr.getDistrictCount() * 1000.0) / 10.0+ "]")); + } + }else if("3".equals(stype)) { + jo1.put("name", "季度<10小区量"); + jo2.put("name", "季度<30小区量"); + jo3.put("name", "季度<100小区量"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + sqr.getQuarCount1() + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + sqr.getQuarCount2() + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + sqr.getQuarCount3() + "]")); + } + }else if("4".equals(stype)) { + jo1.put("name", "季度<10比例"); + jo2.put("name", "季度<30比例"); + jo3.put("name", "季度<100比例"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getQuarCount1() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getQuarCount2() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getQuarCount3() / (double)sqr.getDistrictCount() * 1000.0) / 10.0+ "]")); + } + }else if("5".equals(stype)) { + jo1.put("name", "半年<10小区量"); + jo2.put("name", "半年<30小区量"); + jo3.put("name", "半年<100小区量"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + sqr.getHalfCount1() + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + sqr.getHalfCount2() + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + sqr.getHalfCount3() + "]")); + } + }else if("6".equals(stype)) { + jo1.put("name", "半年<10比例"); + jo2.put("name", "半年<30比例"); + jo3.put("name", "半年<100比例"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getHalfCount1() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getHalfCount2() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getHalfCount3() / (double)sqr.getDistrictCount() * 1000.0) / 10.0+ "]")); + } + }else if("7".equals(stype)) { + jo1.put("name", "一年<10小区量"); + jo2.put("name", "一年<30小区量"); + jo3.put("name", "一年<100小区量"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + sqr.getYearCount1() + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + sqr.getYearCount2() + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + sqr.getYearCount3() + "]")); + } + }else if("8".equals(stype)) { + jo1.put("name", "一年<10比例"); + jo2.put("name", "一年<30比例"); + jo3.put("name", "一年<100比例"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getYearCount1() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getYearCount2() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getYearCount3() / (double)sqr.getDistrictCount() * 1000.0) / 10.0+ "]")); + } + } + + + jo1.put("color", "#79434D"); + jo2.put("color", "#BBBD81"); + jo3.put("color", "#C877C8"); + + jo1.put("data", pt1); + jo2.put("data", pt2); + jo3.put("data", pt3); + + ret.add(jo1); + ret.add(jo2); + ret.add(jo3); + + return ret; + } + + private JSONArray createQualitySeries(String city, String stype, String vts, Date startDate, Date endDate) { + List averagerQualityReports = averagerQualityReportService.findQualityReports(city, Integer.parseInt(DateUtil.formatToTightYYYYMMDD(startDate)), + Integer.parseInt(DateUtil.formatToTightYYYYMMDD(endDate))); + JSONArray ret = new JSONArray(); + JSONObject jo1 = new JSONObject(), jo2 = new JSONObject(), jo3 = new JSONObject(),jo4 = new JSONObject(), + jo5 = new JSONObject(), jo6 = new JSONObject(), jo7 = new JSONObject(), jo8 = new JSONObject(); + JSONArray pt1 = new JSONArray(), pt2 = new JSONArray(), pt3 = new JSONArray(), pt4 = new JSONArray(), + pt5 = new JSONArray(), pt6 = new JSONArray(), pt7 = new JSONArray(), pt8 = new JSONArray(); + if("1".equals(stype)) { + jo1.put("name", "小区量(全部)"); + jo2.put("name", "小区量(无法计算)"); + jo3.put("name", "小区量(指导价)"); + jo4.put("name", "小区量(自身样本)"); + jo5.put("name", "小区量(第三方)"); + jo6.put("name", "小区量(成交数据)"); + jo7.put("name", "小区量(周边小区)"); + jo8.put("name", "小区量(推算)"); + for(AveragerQualityReport aqr : averagerQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(aqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + aqr.getDistrictCount() + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + aqr.getNoneCount() + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + aqr.getGuidingCount() + "]")); + pt4.add(JSONArray.fromObject("[" + tms + "," + aqr.getOwnCount() + "]")); + pt5.add(JSONArray.fromObject("[" + tms + "," + aqr.getThirdCount() + "]")); + pt6.add(JSONArray.fromObject("[" + tms + "," + aqr.getDealCount() + "]")); + pt7.add(JSONArray.fromObject("[" + tms + "," + aqr.getAroundCount() + "]")); + pt8.add(JSONArray.fromObject("[" + tms + "," + aqr.getDeriCount() + "]")); + } + }else if("2".equals(stype)) { + jo1.put("name", "平均可信度(全部)"); + jo2.put("name", "平均可信度(无法计算)"); + jo3.put("name", "平均可信度(指导价)"); + jo4.put("name", "平均可信度(自身样本)"); + jo5.put("name", "平均可信度(第三方)"); + jo6.put("name", "平均可信度(成交数据)"); + jo7.put("name", "平均可信度(周边小区)"); + jo8.put("name", "平均可信度(推算)"); + for(AveragerQualityReport aqr : averagerQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(aqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getAvgCredit() * 100000) + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getNoneCredit() * 100000) + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getGuidingCredit() * 100000) + "]")); + pt4.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getOwnCredit() * 100000) + "]")); + pt5.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getThirdCredit() * 100000) + "]")); + pt6.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getDealCredit() * 100000) + "]")); + pt7.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getAroundCredit() * 100000) + "]")); + pt8.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getDeriCredit() * 100000) + "]")); + } + }else if("3".equals(stype)) { + jo1.put("name", "测试案例数量(全部)"); + jo2.put("name", "测试案例数量(无法计算)"); + jo3.put("name", "测试案例数量(指导价)"); + jo4.put("name", "测试案例数量(自身样本)"); + jo5.put("name", "测试案例数量(第三方)"); + jo6.put("name", "测试案例数量(成交数据)"); + jo7.put("name", "测试案例数量(周边小区)"); + jo8.put("name", "测试案例数量(推算)"); + for(AveragerQualityReport aqr : averagerQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(aqr.getWeekend()), "yyyyMMdd").getTime(); + int allTest = aqr.getNoneTest() + aqr.getGuidingTest() + aqr.getOwnTest() + aqr.getThirdTest() + aqr.getDealTest() + aqr.getAroundTest() + aqr.getDeriTest(); + pt1.add(JSONArray.fromObject("[" + tms + "," + allTest + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + aqr.getNoneTest() + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + aqr.getGuidingTest() + "]")); + pt4.add(JSONArray.fromObject("[" + tms + "," + aqr.getOwnTest() + "]")); + pt5.add(JSONArray.fromObject("[" + tms + "," + aqr.getThirdTest() + "]")); + pt6.add(JSONArray.fromObject("[" + tms + "," + aqr.getDealTest() + "]")); + pt7.add(JSONArray.fromObject("[" + tms + "," + aqr.getAroundTest() + "]")); + pt8.add(JSONArray.fromObject("[" + tms + "," + aqr.getDeriTest() + "]")); + } + }else if("4".equals(stype)) { + jo1.put("name", "案例差比<10%量(全部)"); + jo2.put("name", "案例差比<10%量(无法计算)"); + jo3.put("name", "案例差比<10%量(指导价)"); + jo4.put("name", "案例差比<10%量(自身样本)"); + jo5.put("name", "案例差比<10%量(第三方)"); + jo6.put("name", "案例差比<10%量(成交数据)"); + jo7.put("name", "案例差比<10%量(周边小区)"); + jo8.put("name", "案例差比<10%量(推算)"); + for(AveragerQualityReport aqr : averagerQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(aqr.getWeekend()), "yyyyMMdd").getTime(); + int allTest = aqr.getNoneTest() + aqr.getGuidingTest() + aqr.getOwnTest() + aqr.getThirdTest() + aqr.getDealTest() + aqr.getAroundTest() + aqr.getDeriTest(); + int allAccu1 = aqr.getNoneAccu1() + aqr.getGuidingAccu1() + aqr.getOwnAccu1() + aqr.getThirdAccu1() + aqr.getDealAccu1() + aqr.getAroundAccu1() + aqr.getDeriAccu1(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)allAccu1 / (double)allTest * 10000) / 100.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getNoneAccu1() / (double)allTest * 10000) / 100.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getGuidingAccu1() / (double)allTest * 10000) / 100.0 + "]")); + pt4.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getOwnAccu1() / (double)allTest * 10000) / 100.0 + "]")); + pt5.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getThirdAccu1() / (double)allTest * 10000) / 100.0 + "]")); + pt6.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getDealAccu1() / (double)allTest * 10000) / 100.0 + "]")); + pt7.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getAroundAccu1() / (double)allTest * 10000) / 100.0 + "]")); + pt8.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getDeriAccu1() / (double)allTest * 10000) / 100.0 + "]")); + } + }else if("5".equals(stype)) { + jo1.put("name", "案例差比<20%量(全部)"); + jo2.put("name", "案例差比<20%量(无法计算)"); + jo3.put("name", "案例差比<20%量(指导价)"); + jo4.put("name", "案例差比<20%量(自身样本)"); + jo5.put("name", "案例差比<20%量(第三方)"); + jo6.put("name", "案例差比<20%量(成交数据)"); + jo7.put("name", "案例差比<20%量(周边小区)"); + jo8.put("name", "案例差比<20%量(推算)"); + for(AveragerQualityReport aqr : averagerQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(aqr.getWeekend()), "yyyyMMdd").getTime(); + int allTest = aqr.getNoneTest() + aqr.getGuidingTest() + aqr.getOwnTest() + aqr.getThirdTest() + aqr.getDealTest() + aqr.getAroundTest() + aqr.getDeriTest(); + int allAccu2 = aqr.getNoneAccu2() + aqr.getGuidingAccu2() + aqr.getOwnAccu2() + aqr.getThirdAccu2() + aqr.getDealAccu2() + aqr.getAroundAccu2() + aqr.getDeriAccu2(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)allAccu2 / (double)allTest * 10000) / 100.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getNoneAccu2() / (double)allTest * 10000) / 100.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getGuidingAccu2() / (double)allTest * 10000) / 100.0 + "]")); + pt4.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getOwnAccu2() / (double)allTest * 10000) / 100.0 + "]")); + pt5.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getThirdAccu2() / (double)allTest * 10000) / 100.0 + "]")); + pt6.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getDealAccu2() / (double)allTest * 10000) / 100.0 + "]")); + pt7.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getAroundAccu2() / (double)allTest * 10000) / 100.0 + "]")); + pt8.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getDeriAccu2() / (double)allTest * 10000) / 100.0 + "]")); + } + }else if("6".equals(stype)) { + jo1.put("name", "案例差比<30%量(全部)"); + jo2.put("name", "案例差比<30%量(无法计算)"); + jo3.put("name", "案例差比<30%量(指导价)"); + jo4.put("name", "案例差比<30%量(自身样本)"); + jo5.put("name", "案例差比<30%量(第三方)"); + jo6.put("name", "案例差比<30%量(成交数据)"); + jo7.put("name", "案例差比<30%量(周边小区)"); + jo8.put("name", "案例差比<30%量(推算)"); + for(AveragerQualityReport aqr : averagerQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(aqr.getWeekend()), "yyyyMMdd").getTime(); + int allTest = aqr.getNoneTest() + aqr.getGuidingTest() + aqr.getOwnTest() + aqr.getThirdTest() + aqr.getDealTest() + aqr.getAroundTest() + aqr.getDeriTest(); + int allAccu3 = aqr.getNoneAccu3() + aqr.getGuidingAccu3() + aqr.getOwnAccu3() + aqr.getThirdAccu3() + aqr.getDealAccu3() + aqr.getAroundAccu3() + aqr.getDeriAccu3(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)allAccu3 / (double)allTest * 10000) / 100.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getNoneAccu3() / (double)allTest * 10000) / 100.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getGuidingAccu3() / (double)allTest * 10000) / 100.0 + "]")); + pt4.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getOwnAccu3() / (double)allTest * 10000) / 100.0 + "]")); + pt5.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getThirdAccu3() / (double)allTest * 10000) / 100.0 + "]")); + pt6.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getDealAccu3() / (double)allTest * 10000) / 100.0 + "]")); + pt7.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getAroundAccu3() / (double)allTest * 10000) / 100.0 + "]")); + pt8.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getDeriAccu3() / (double)allTest * 10000) / 100.0 + "]")); + } + } + + jo1.put("color", "#79434D"); + jo2.put("color", "#BBBD81"); + jo3.put("color", "#C877C8"); + jo4.put("color", "#3A696F"); + jo5.put("color", "#6BB7C5"); + jo6.put("color", "#729827"); + jo7.put("color", "#DD9F19"); + jo8.put("color", "#CAB0A2"); + + jo1.put("data", pt1); + jo2.put("data", pt2); + jo3.put("data", pt3); + jo4.put("data", pt4); + jo5.put("data", pt5); + jo6.put("data", pt6); + jo7.put("data", pt7); + jo8.put("data", pt8); + + List vtss = Arrays.asList(vts.split("-")); + if(vtss.contains("1")) { + ret.add(jo1); + } + if(vtss.contains("2")) { + ret.add(jo2); + } + if(vtss.contains("3")) { + ret.add(jo3); + } + if(vtss.contains("4")) { + ret.add(jo4); + } + if(vtss.contains("5")) { + ret.add(jo5); + } + if(vtss.contains("6")) { + ret.add(jo6); + } + if(vtss.contains("7")) { + ret.add(jo7); + } + if(vtss.contains("8")) { + ret.add(jo8); + } + return ret; + } + + public Object doCreatTaskAction(AvgPriceUpdateModel model) { + // model.setAvgUpdateBos(regionStatService.findAvgPriceData(null,null,null)); + + Map> avgUpdateBoMap = new LinkedHashMap>(); + List avgUpdateBoList = regionStatService.findAvgPriceData(null, null, null); + + Map regionStatMap = new LinkedHashMap(); + for (AvgUpdateBo bo : avgUpdateBoList) { + regionStatMap.put(bo.getCity(), bo); + } + + List serverAreas = ServerAreaData.getServerAreaList(); + Collections.sort(serverAreas, new Comparator() { + @Override + public int compare(ServerArea o1, ServerArea o2) { + return ((Integer)o1.getCityGrade()).compareTo(o2.getCityGrade()); + } + }); + + for (ServerArea serverArea : serverAreas) { + String w = String.valueOf(DataUtil.hanyuJianpin(serverArea.getDisplay()).toCharArray()[0]).toUpperCase(); + if (HOT_CITIES.contains(serverArea.getDisplay())) { + w = "HOT"; + } + + AvgUpdateBo bo = regionStatMap.get(serverArea.getDisplay()); + if(bo == null) { + bo = new AvgUpdateBo(); + bo.setCity(serverArea.getDisplay()); + } + if (avgUpdateBoMap.containsKey(w)) { + List list = avgUpdateBoMap.get(w); + list.add(bo); + avgUpdateBoMap.put(w, list); + } else { + List list = new ArrayList(); + list.add(bo); + avgUpdateBoMap.put(w, list); + } + } + + model.setAvgUpdateBoMap(avgUpdateBoMap); + return model; + } + + public Object reComputeAction(@Param(name = "data") String data, HttpServletRequest request) { + + JsonModel model = new JsonModel(); + Map json = new HashMap(); + model.setJsonModel(json); + JSONObject jsonObject = JSONObject.fromObject(data); + String calcRange = null; + String _startDate = null; + String _endDate = null; + if(jsonObject.containsKey("calcRange")) { + calcRange = jsonObject.getString("calcRange"); + } + if(jsonObject.containsKey("startDate")) { + _startDate = jsonObject.getString("startDate"); + } + if(jsonObject.containsKey("endDate")) { + _endDate = jsonObject.getString("endDate"); + } + String realName = (String) request.getSession().getAttribute("realName"); + String ip = AnalyticsUtil.getIpAddress(request); + String remark = MessageFormat.format("userName:{0},ip:{1}", new String[] { realName, ip }); + + JSONArray commands = jsonObject.getJSONArray("commands"); + + Date startDate = null; + Date endDate = null; + + List cmds = new ArrayList(); + + if(StringUtils.isNotBlank(calcRange)) { + Date currentDate = new Date(); + endDate = new Date(); + if("week".equals(calcRange)) { + startDate = DateUtil.getBeforeDay(currentDate, 7); + }else if("month".equals(calcRange)) { + startDate = DateUtil.getBeforeDay(currentDate, 30); + }else if("quarter".equals(calcRange)) { + startDate = DateUtil.getBeforeDay(currentDate, 30 * 3); + }else if("year".equals(calcRange)) { + startDate = DateUtil.getBeforeDay(currentDate, 365); + }else if("all".equals(calcRange)) { +// for (int i = 0, len = commands.size(); i < len; i++) { +// JSONObject command = (JSONObject) commands.get(i); +// cmds.add(commandToCalcCommand(command, null, remark)); +// } + // startDate取createYear或buildYear最小值 + JSONObject command = (JSONObject) commands.get(0); + District district = districtService.findByName(command.getString("city"), command.getString("region"), command.getString("name"), "district"); + Integer createYear = null; + if (StringUtils.isNotBlank(district.getCreateYear())) { + createYear = Integer.parseInt(district.getCreateYear().substring(0, 4)); + } + if (StringUtils.isNotBlank(district.getFinishBuildingDate())) { + Integer finishYear = Integer.parseInt(district.getFinishBuildingDate().substring(0, 4)); + if ((createYear != null && createYear > finishYear) || createYear == null) { + createYear = finishYear; + } + } + if (createYear == null) { + // 重算一年 + createYear = Integer.valueOf(DateUtil.formatByPattern(DateUtils.addYears(new Date(), -1), "yyyy")); + } + startDate = DateUtil.parseDate(String.valueOf(createYear), "yyyy"); + } + }else if (StringUtils.isNotBlank(_startDate) || StringUtils.isNotBlank(_endDate)) { + if (StringUtils.isNotBlank(_startDate)) { + startDate = DateUtil.parseDate(_startDate, "yyyyMMdd"); + } else { + startDate = DateUtil.parseDate("20070101", "yyyyMMdd"); + } + if (StringUtils.isNotBlank(_endDate)) { + endDate = DateUtil.parseDate(_endDate, "yyyyMMdd"); + } else { + endDate = new Date(); + } + }else { + for (int i = 0, len = commands.size(); i < len; i++) { + JSONObject command = (JSONObject) commands.get(i); + cmds.add(commandToCalcCommand(command, null, remark)); + } + } + + if(startDate != null && endDate != null) { + List months = DateUtil.getLastDayBetweenDates(startDate, endDate); + if (months.isEmpty()) { + json.put("msg", "你选择的日期不包含周末,请重新选择"); + return model; + } + for (Date month : months) { + for (int i = 0, len = commands.size(); i < len; i++) { + JSONObject command = (JSONObject) commands.get(i); + CalcCommand cmd = commandToCalcCommand(command, month, remark); + if (cmd != null) { + cmds.add(cmd); + } + + } + } + } + + calcCommandService.save(cmds); + json.put("msg", "任务保存成功,共保存" + cmds.size() + "条任务"); + return model; + } + + private CalcCommand commandToCalcCommand(JSONObject command, Date weekend, String remark) { + CalcCommand cmd = new CalcCommand(); + cmd.setCity(command.getString("city")); + if (command.containsKey("region")) { + cmd.setRegion(command.getString("region")); + } else { + cmd.setRegion(null); + } + if (command.containsKey("block")) { + cmd.setBlock(command.getString("block")); + } else { + cmd.setBlock(null); + } + if (command.containsKey("name")) { + cmd.setName(command.getString("name")); + } else { + cmd.setName(null); + } + if (command.containsKey("estateType")) { + cmd.setEstateType(command.getString("estateType")); + } else { + cmd.setEstateType(null); + } + if (weekend == null) { + cmd.setCalcType(1); + } else { + if (command.containsKey("startDate") && StringUtils.isNotBlank(command.getString("startDate"))) { + Date startDate = DateUtil.parseDate(command.getString("startDate"), "yyyy-MM-dd");// 均价开始时间 + if (weekend.before(startDate)) { + return null; + } + } + cmd.setCalcType(0); + } + cmd.setStatus(0); + cmd.setPriority(2); + cmd.setCalcDate(weekend); + cmd.setRemark(remark); + cmd.setCategory("rent"); + cmd.setIp(IPS.get(RandomUtil.nextInt(IPS.size()))); + cmd.setCreationDate(new Date()); + return cmd; + } + + public Object deleteAction(AvgPriceUpdateModel model) { + JsonModel ret = new JsonModel(); + if(model.getId() != null) { + regionStatService.deleteById(model.getId()); + } + return ret; + } + + public Object loadAvgPriceDataAction(AvgPriceUpdateModel model) { + JsonModel json = new JsonModel(); + json.setJsonModel(regionStatService.findAvgPriceData(model.getCityName(), model.getRegion(), model.getBlock())); + return json; + } + + public Object loadAllAvgPriceAction(AvgPriceUpdateModel model) { + JsonModel json = new JsonModel(); + Pager pager = model.getPager(); + if (pager == null) { + pager = model.getPager(15); + } + Map data = new HashMap(); + data.put("data", + regionStatService.findAllAvgPriceData(model.getCityName(), model.getRegion(), model.getBlock(), model.getPager(), false)); + data.put("pager", pager); + json.setJsonModel(data); + return json; + } + + public Object updateAvgPriceAction(AvgPriceUpdateModel model) { + JsonModel jsonModel = new JsonModel(); + RegionStat regionStat = regionStatService.findById(model.getId()); + if (regionStat != null) { + regionStat.setAvgPrice(model.getAvgPrice()); + regionStatService.save(regionStat); + } + return jsonModel; + } + + + public Object addAvgPriceAction(AvgPriceUpdateModel model) { + JsonModel jsonModel = new JsonModel(); + Map resMap = new HashMap(); + if(model.getAvgPrice() <= 0) { + resMap.put("msg", "价格错误!"); + jsonModel.setJsonModel(resMap); + return jsonModel; + } + + if(model.getWeekend() == null || model.getWeekend().getDay() > 0) { + resMap.put("msg", "日期错误!"); + jsonModel.setJsonModel(resMap); + return jsonModel; + } + + String city = null; + String region = null; + String block = null; + String cat = null; + if(StringUtils.isNotBlank(model.getCityDisplay()) && StringUtils.isNotBlank(model.getRegion()) && StringUtils.isNotBlank(model.getBlock())) { + city = model.getCityDisplay(); + region = model.getRegion(); + block = model.getBlock(); + cat = "板块"; + }else if(StringUtils.isNotBlank(model.getCityDisplay()) && StringUtils.isNotBlank(model.getRegion()) && StringUtils.isBlank(model.getBlock())) { + city = model.getCityDisplay(); + region = model.getRegion(); + cat = "区域"; + }else if(StringUtils.isNotBlank(model.getCityDisplay()) && StringUtils.isBlank(model.getRegion()) && StringUtils.isBlank(model.getBlock())) { + city = model.getCityDisplay(); + cat = "城市"; + } + + if(city == null || region == null || block == null) { + resMap.put("msg", "城市区域板块错误!"); + jsonModel.setJsonModel(resMap); + return jsonModel; + } + + RegionStat regionStat = regionStatService.findRegionStat(city, region, block, model.getWeekend()); + if (regionStat != null) { + resMap.put("msg", "均价数据已存在!"); + jsonModel.setJsonModel(resMap); + return jsonModel; + } + + RegionStat entity = new RegionStat(); + entity.setCity(city); + entity.setRegion(region); + entity.setBlock(block); + entity.setWeekend(model.getWeekend()); + entity.setAvgPrice(model.getAvgPrice()); + entity.setCalcValue(model.getAvgPrice()); + entity.setCoverage(0); + entity.setCredit(0.6); + entity.setCat(cat); + entity.setWeekendMarkup(0); + regionStatService.save(entity); + return jsonModel; + } + + public Object districtListAction(AvgPriceUpdateModel model) { + Pager pager = model.getPager(15); + String sort = model.getSort(); + if (StringUtils.isNotBlank(sort)) { + String[] sortArr = sort.split("_"); + if (sortArr.length == 2) { + model.setAvgUpdateBos(districtStatService.findAvgPriceData(model.getCityDisplay(), model.getRegion(), + model.getBlock(), model.getName(), model.getMinCredit(), model.getMaxCredit(), model.getValueType(), + pager,sortArr[0], sortArr[1])); + } + } else { + model.setAvgUpdateBos(districtStatService.findAvgPriceData(model.getCityDisplay(), model.getRegion(), + model.getBlock(), model.getName(), model.getMinCredit(), model.getMaxCredit(), model.getValueType(), pager, + "","")); + } + return model; + } + + public Object loadAllDistrictRentPriceAction(RentPriceUpdateModel model) { + JsonModel json = new JsonModel(); + Map data = new HashMap(); + DistrictKey key = new DistrictKey(model.getCityName(), model.getRegion(), model.getName()); + List bos = sqmetreRentService.findAllAvgPriceByKeys(key, "district"); + data.put("data", bos); + json.setJsonModel(data); + return json; + } + + /**a + * 加载某个小区的房源信息 + * + * @param model + * @return + */ + public Object loadHouseInfoAction(AvgPriceUpdateModel model) { + JsonModel json = new JsonModel(); + Map data = new HashMap(); + District district = this.districtService.findDistrict(new DistrictKey(model.getCityName(), model.getRegion(), model.getName()), false, new String[]{"city", "region", "name", "alias"}); + List districtAlias = null; + if(district != null && district.getAlias() != null) { + districtAlias = district.getAlias(); + } + + List regionAlias = RegionData.getRegionAlias(model.getCityName(), model.getRegion()); + List sells = seawaterService.findSeawatersFromEs("rent", model.getCityName(), model.getRegion(), model.getName(), districtAlias, regionAlias, null,null,null,null,"p_date",false,0,1000,null,"latest_seawater"); + data.put("data", sells); + json.setJsonModel(data); + return json; + + } + + + private long findSeawatersCount(String city, String region, String name, Date startDate, Date endDate) { + District district = this.districtService.findDistrict(new DistrictKey(city, region, name), false, new String[]{"city", "region", "name", "alias"}); + List districtAlias = null; + if(district != null && district.getAlias() != null) { + districtAlias = district.getAlias(); + } + List regionAlias = RegionData.getRegionAlias(city, region); + Integer sd = null; + Integer ed = null; + if(startDate != null) { + sd = Integer.parseInt(DateUtil.formatToTightYYYYMMDD(startDate)); + } + + if(endDate != null) { + ed = Integer.parseInt(DateUtil.formatToTightYYYYMMDD(endDate)); + } + + return seawaterService.findSeawatersCountFromEs("rent", city, region, name, districtAlias, regionAlias, sd, ed, null, null,"seawater"); + } + + private DBObject buildQueryDBObject(District district, Date startDate, Date endDate, boolean isCaseRegion, boolean isUseRegionAlias, boolean isUseAlias) { + Set namesList = new LinkedHashSet(); + namesList.add(district.getName()); + + if (district != null && district.getAlias() != null) { + namesList.addAll(district.getAlias()); + } + + Set regionsList = new LinkedHashSet(); + regionsList.add(district.getRegion()); + //只有进行区域区分,才可以使用区域别名 + if (isCaseRegion && isUseRegionAlias) { + List regionAlias = RegionData.getRegionAlias(district.getCity(), district.getRegion()); + if (regionAlias != null) { + for (String p : regionAlias) { + if (StringUtils.isNotBlank(p)) { + regionsList.add(p); + } + } + } + } + + BooleanQuery srQuery = new BooleanQuery(); + if (isCaseRegion) { + BooleanQuery regionQuery = new BooleanQuery(); + for (String region : regionsList) { + regionQuery.add(new TermQuery(new Term("region", region)), BooleanClause.Occur.SHOULD); + } + srQuery.add(regionQuery, BooleanClause.Occur.MUST); + } + + BooleanQuery nameQuery = new BooleanQuery(); + for (String name : namesList) { + name = name.trim(); + if (StringUtils.isNotBlank(name) && name.length() < 20) { + nameQuery.add(new TermQuery(new Term("district_name", ClientUtils.escapeQueryChars(name))), BooleanClause.Occur.SHOULD); + } + } + + if (StringUtils.isBlank(nameQuery.toString())) { + return null; + } + srQuery.add(nameQuery, BooleanClause.Occur.MUST); + + DBObject q = new BasicDBObject(); + q.put("cat", "rent"); + q.put("city", district.getCity()); + q.put("$sr", new BasicDBObject("sr.query", srQuery.toString())); + if (startDate != null && endDate != null) { + q.put("p_date", new BasicDBObject("$gt", Integer.parseInt(DateUtil.formatToTightYYYYMMDD(startDate))) + .append("$lt", Integer.parseInt(DateUtil.formatToTightYYYYMMDD(endDate)))); + } else if (startDate != null && endDate == null) { + q.put("p_date", new BasicDBObject("$gt", Integer.parseInt(DateUtil.formatToTightYYYYMMDD(startDate)))); + } else if (startDate == null && endDate != null) { + q.put("p_date", new BasicDBObject("$lt", Integer.parseInt(DateUtil.formatToTightYYYYMMDD(endDate)))); + } + + return q; + } + + public Object loadAllAvgPriceForChartAction(AvgPriceUpdateModel model) { + JsonModel json = new JsonModel(); + Map data = new HashMap(); + List bos = regionStatService.findAllAvgPriceData(model.getCityName(), model.getRegion(), model.getBlock(), + null, true); + data.put("data", bos); + json.setJsonModel(data); + return json; + + } + + public Object detailAction(AvgPriceUpdateModel model) { + return model; + } + + public Object districtDetailAction(RentPriceUpdateModel model) { + District district = null; + if (StringUtils.isNotBlank(model.getId())) { + district = districtService.findById(model.getId()); + } else { + district = districtService.findDistrict(new DistrictKey(model.getCityDisplay(), model.getRegion(), model.getName()), + "district"); + } + + + if (district == null) { + return null; + } + + if (district.getEstateType2() != null && district.getEstateType2().indexOf("别墅") > -1) { + district.setEstateType2("别墅"); + } else { + district.setEstateType2("普通住宅"); + } + + model.setId(district.getId()); + Date thisMonth = DateUtil.getFirstDayOfMonth(new Date()); + Date lastMonth = DateUtil.getFirstDayOfLastMonth(DateUtil.getFirstDayOfLastMonth(new Date())); + Date thisWeekend = DateUtil.getThisSunday(new Date()); + + DistrictKey districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName()); + + model.setCalcDistrictStat(this.calcDistrictStatDao.findCalcDistrictStat(district.getCity(), district.getRegion(), + district.getName(), district.getEstateType2(), thisWeekend)); + + List guidingPrices = guidingPriceService.findByDistrictKey(districtKey); + if(guidingPrices!=null && guidingPrices.size()>0) { + List t = new ArrayList(); + t.add(guidingPrices.get(guidingPrices.size()-1)); + model.setGuidingPrices(t); + }else { + model.setGuidingPrices(new ArrayList()); + } + Pager pager = new Pager(1); + pager.setCurrentPage(1); + model.setDealPriceCount(dealPriceService.findDealPriceCountByDistrictKey(districtKey)); + model.setAverageStatistics(averageStatisticsDao.findDistrictAverageStatistics(district.getCity(), district.getRegion(), + district.getName(), Integer.parseInt(DateUtil.formatByPattern(lastMonth, "yyyyMM")), + Integer.parseInt(DateUtil.formatByPattern(thisMonth, "yyyyMM")))); + model.setAvgBases(avgBaseDao.findAll(district.getCity(), district.getRegion(),district.getName(),0,null,null,null)); + Map distribution = new HashMap(); + /*distribution.put("QiTian", findSeawatersCount(district.getCity(), district.getRegion(), district.getName(), DateUtil.add(new Date(), Calendar.DATE, -7), null)); + distribution.put("YiYue", findSeawatersCount(district.getCity(), district.getRegion(), district.getName(), DateUtil.add(new Date(), Calendar.MONTH, -1), null)); + distribution.put("SanYue", findSeawatersCount(district.getCity(), district.getRegion(), district.getName(), DateUtil.add(new Date(), Calendar.MONTH, -3), null)); + distribution.put("BanNian", findSeawatersCount(district.getCity(), district.getRegion(), district.getName(), DateUtil.add(new Date(), Calendar.MONTH, -6), null)); + distribution.put("YiNian", findSeawatersCount(district.getCity(), district.getRegion(), district.getName(), DateUtil.add(new Date(), Calendar.YEAR, -1), null)); + distribution.put("All", findSeawatersCount(district.getCity(), district.getRegion(), district.getName(), null, null));*/ + List calcConfigs = calcConfigService.findDateByQuery(districtKey.getCity(), districtKey.getRegion(), + districtKey.getName()); + if (!calcConfigs.isEmpty()) { + model.setCalcConfig(calcConfigs.get(0)); + } + model.setDistrict(district); + model.setDistribution(distribution); + + Date week = DateUtil.truncateDay(DateUtil.getLastDayOfMonth(new Date(), -1)); + SqmetreRent sqmetreRent = sqmetreRentService.findSqmetreRent(districtKey.getCity(), districtKey.getRegion(), districtKey.getName(), "district", week); + model.setSqmetreRent(sqmetreRent); + + return model; + } + + public Object addGuidingPriceAction(@Param(name = "guidingDate") String guidingDate, + @Param(name = "guidingPrice") int guidingPrice, @Param(name = "id") String id,HttpServletRequest request) { + HttpSession session=request.getSession(); + District district = districtService.findById(id); + GuidingPrice guiding = new GuidingPrice(); + guiding.setGuidingPerson(session.getAttribute("realName").toString()); + guiding.setCat("district"); + guiding.setCreationDate(new Date()); + guiding.setGuidingValue(guidingPrice); + guiding.setGuidingDate(DateUtil.parseDate(guidingDate, "yyyyMMdd")); + guiding.setCity(district.getCity()); + guiding.setRegion(district.getRegion()); + guiding.setName(district.getName()); + guiding.setEstateType(district.getEstateType2().indexOf("别墅") > -1 ? "别墅" : "普通住宅"); + guidingPriceService.save(guiding); + + JsonModel model = new JsonModel(); + return model; + } + public Object guidingListAction(GuidingAvgPriceUpdateModel model) { + District district = districtService.findById(model.getId()); + model.setDistrict(district); + DistrictKey districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName()); + List guidingPrices = guidingPriceService.findByDistrictKey(districtKey); + model.setGuidingPrices(guidingPrices); + return model; + } + public Object guidingPriceAction(GuidingAvgPriceUpdateModel model) { + District district = districtService.findById(model.getId()); + if(StringUtils.isNotBlank(model.getGid())){ + GuidingPrice gp = guidingPriceService.findById(model.getGid()); + String gd = DateUtil.formatToTightYYYYMMDD(gp.getGuidingDate()); + model.setGuidingDate(gd); + model.setGuidingPrice(gp.getGuidingValue()); + } + model.setDistrict(district); + return model; + } + + public Object deleteGuidingPriceNewAction(GuidingAvgPriceUpdateModel model) { + JsonModel json = new JsonModel(); + guidingPriceService.deleteById(model.getGid()); + return json; + } + + public Object saveGuidingPriceAction(HttpServletRequest request,GuidingAvgPriceUpdateModel model) { + JsonModel json = new JsonModel(); + HttpSession session=request.getSession(); + District district = districtService.findById(model.getId()); + GuidingPrice guiding = new GuidingPrice(); + if(StringUtils.isNotBlank(model.getGid())){ + guiding = guidingPriceService.findById(model.getGid()); + } + guiding.setGuidingPerson(session.getAttribute("realName").toString()); + guiding.setCat("district"); + guiding.setCreationDate(new Date()); + guiding.setGuidingValue(model.getGuidingPrice()); + guiding.setGuidingDate(DateUtil.parseDate(model.getGuidingDate(), "yyyyMMdd")); + guiding.setCity(district.getCity()); + guiding.setRegion(district.getRegion()); + guiding.setName(district.getName()); + guiding.setEstateType(district.getEstateType2().indexOf("别墅") > -1 ? "别墅" : "普通住宅"); + guidingPriceService.save(guiding); + json.setJsonModel(model); + return json; + } + + public Object updateCalcConfigAction(@Param(name = "maxPrice") Integer maxPrice, @Param(name = "minPrice") Integer minPrice, + @Param(name = "id") String id, @Param(name = "configId") String configId) { + CalcConfig calcConfig; + if (StringUtils.isNotBlank(configId) && ObjectId.isValid(configId)) { + calcConfig = calcConfigService.findById(configId); + if (calcConfig.getLogicalMaxValue() != null && calcConfig.getLogicalMaxValue().equals(maxPrice)) { + calcConfig.getMarkMap().put("logical_max_value", 1); + } + if (calcConfig.getLogicalMinValue() != null && calcConfig.getLogicalMinValue().equals(minPrice)) { + calcConfig.getMarkMap().put("logical_min_value", 1); + } + } else { + District district = districtService.findById(id); + calcConfig = new CalcConfig(); + calcConfig.setCategory("district"); + calcConfig.setCreationDate(new Date()); + calcConfig.setCity(district.getCity()); + calcConfig.setRegion(district.getRegion()); + calcConfig.setName(district.getName()); + calcConfig.setEstateType(district.getEstateType2()); + } + calcConfig.setLogicalMaxValue(maxPrice); + calcConfig.setLogicalMinValue(minPrice); + calcConfigService.save(calcConfig); + JsonModel model = new JsonModel(); + return model; + } + + public Object updateDistrictCalcConfigAction(AvgPriceUpdateModel model) { + JsonModel ret = new JsonModel(); + + + return ret; + } + + public Object taskListAction(AvgPriceUpdateModel model) { + Pager pager = model.getPager(15); + pager.setTotalRows(calcCommandService.findAllCommondCount(model.getStype(), model.getCityDisplay(), model.getKeyword(), + model.getStatus(), model.getStartDate(), model.getEndDate())); + model.setCalcCommands(calcCommandService.findCommandByquery(model.getStype(), model.getCityDisplay(), model.getKeyword(), + model.getStatus(), model.getStartDate(), model.getEndDate(), pager.getStartRow(), pager.getPageSize())); + return model; + } + + public Object deleteGuidingPriceAction(@Param(name = "id") String id) { + JsonModel model = new JsonModel(); + guidingPriceService.deleteById(id); + return model; + } + + public RegionStatService getRegionStatService() { + return regionStatService; + } + + public void setRegionStatService(RegionStatService regionStatService) { + this.regionStatService = regionStatService; + } + + public CalcCommandService getCalcCommandService() { + return calcCommandService; + } + + public void setCalcCommandService(CalcCommandService calcCommandService) { + this.calcCommandService = calcCommandService; + } + + public DistrictStatService getDistrictStatService() { + return districtStatService; + } + + public void setDistrictStatService(DistrictStatService districtStatService) { + this.districtStatService = districtStatService; + } + + public void setDistrictService(DistrictService districtService) { + this.districtService = districtService; + } + + public SqmetreRentService getSqmetreRentService() { + return sqmetreRentService; + } + + public void setSqmetreRentService(SqmetreRentService sqmetreRentService) { + this.sqmetreRentService = sqmetreRentService; + } + + public void setAverageStatisticsDao(AverageStatisticsDao averageStatisticsDao) { + this.averageStatisticsDao = averageStatisticsDao; + } + + public void setDealPriceService(DealPriceService dealPriceService) { + this.dealPriceService = dealPriceService; + } + + public void setGuidingPriceService(GuidingPriceService guidingPriceService) { + this.guidingPriceService = guidingPriceService; + } + + public void setCalcConfigService(CalcConfigService calcConfigService) { + this.calcConfigService = calcConfigService; + } + + public void setCalcDistrictStatDao(CalcDistrictStatDao calcDistrictStatDao) { + this.calcDistrictStatDao = calcDistrictStatDao; + } + + public void setAveragerQualityReportService(AveragerQualityReportService averagerQualityReportService) { + this.averagerQualityReportService = averagerQualityReportService; + } + + public void setSampleQualityReportService(SampleQualityReportService sampleQualityReportService) { + this.sampleQualityReportService = sampleQualityReportService; + } + + public ComparePriceDao getComparePriceDao() { + return comparePriceDao; + } + + public void setComparePriceDao(ComparePriceDao comparePriceDao) { + this.comparePriceDao = comparePriceDao; + } + + public ComparePriceCityDao getComparePriceCityDao() { + return comparePriceCityDao; + } + + public void setComparePriceCityDao(ComparePriceCityDao comparePriceCityDao) { + this.comparePriceCityDao = comparePriceCityDao; + } + + public void setSeawaterService(SeawaterService seawaterService) { + this.seawaterService = seawaterService; + } + + public void setAvgBaseDao(AvgBaseDao avgBaseDao) { + this.avgBaseDao = avgBaseDao; + } +} diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/SqMetreRentController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/SqMetreRentController.java index 4c369289e..8e2662190 100644 --- a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/SqMetreRentController.java +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/SqMetreRentController.java @@ -102,7 +102,7 @@ public class SqMetreRentController { JSONObject row = new JSONObject(); row.put("x",DateUtil.add(rent.getWeekend(), 1).getTime()); row.put("y",rent.getAvgPrice()); - row.put("sampleEnum",rent.getSampleEnum()); + row.put("sampleEnum",rent.getValueType()); datas.add(row); } @@ -136,7 +136,7 @@ public class SqMetreRentController { Date statDate = DateUtil.parseFormatDate(model.getStatDate()); SqmetreRent stat = sqmetreRentService.findSqmetreRent(model.getCityDisplay(), model.getRegion(), model.getDistrictName(), model.getCat(), statDate); if(null != stat){ - stat.setAvgPrice(model.getValue()); + stat.setAvgPrice(model.getValue().intValue()); stat.setModificationDate(new Date()); sqmetreRentService.updateSqmetreRent(stat); } @@ -204,7 +204,7 @@ public class SqMetreRentController { rent.setDistrictName(model.getDistrictName()); rent.setWeekend(statDate); rent.setCat(model.getCat()); - rent.setAvgPrice(model.getValue()); + rent.setAvgPrice(model.getValue().intValue()); rent.setCreationDate(new Date()); rent.setModificationDate(new Date()); sqmetreRentService.save(rent); diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/RentPriceUpdateModel.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/RentPriceUpdateModel.java new file mode 100644 index 000000000..5245c5e0b --- /dev/null +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/RentPriceUpdateModel.java @@ -0,0 +1,341 @@ +package com.fangjia.bkoff.model; + +import com.fangjia.dal.mongo.model.*; +import com.fangjia.dal.mongo.model.bkoff.CalcCommand; +import com.fangjia.dal.mongo.model.bkoff.CalcConfig; +import com.fangjia.dal.mongo.model.bkoff.GuidingPrice; +import com.fangjia.dal.seaweed.model.District; +import com.fangjia.service.bo.AvgUpdateBo; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +public class RentPriceUpdateModel extends BaseModel { + + /** + * + */ + private static final long serialVersionUID = 1L; + + private List avgUpdateBos; + private Map> avgUpdateBoMap; + private String region; + private String block; + private String cityDisplay; + private String id; + private int avgPrice; + private Double minCredit; + private Double maxCredit; + private Integer valueType; + private String name; + private District district; + private List averageStatistics; + private List avgBases; + private CalcDistrictStat calcDistrictStat; + private DistrictStat districtStat; + private SqmetreRent sqmetreRent; + private long dealPriceCount; + private List guidingPrices; + private Map distribution; + private CalcConfig calcConfig; + private String stype; + private String keyword; + private Integer status; + private List calcCommands; + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date startDate; + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date endDate; + private String estateType; + private String sort; + private Date weekend; + private int sdateStart; + private int sdateEnd; + private String series; + private String vts; + private String category; + + public List getAvgUpdateBos() { + return avgUpdateBos; + } + + public void setAvgUpdateBos(List avgUpdateBos) { + this.avgUpdateBos = avgUpdateBos; + } + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getBlock() { + return block; + } + + public void setBlock(String block) { + this.block = block; + } + + public String getCityDisplay() { + return cityDisplay; + } + + public void setCityDisplay(String cityDisplay) { + this.cityDisplay = cityDisplay; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public int getAvgPrice() { + return avgPrice; + } + + public void setAvgPrice(int avgPrice) { + this.avgPrice = avgPrice; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public District getDistrict() { + return district; + } + + public void setDistrict(District district) { + this.district = district; + } + + public List getAverageStatistics() { + return averageStatistics; + } + + public void setAverageStatistics(List averageStatistics) { + this.averageStatistics = averageStatistics; + } + + public long getDealPriceCount() { + return dealPriceCount; + } + + public void setDealPriceCount(long dealPriceCount) { + this.dealPriceCount = dealPriceCount; + } + + public List getGuidingPrices() { + return guidingPrices; + } + + public void setGuidingPrices(List guidingPrices) { + this.guidingPrices = guidingPrices; + } + + public Map getDistribution() { + return distribution; + } + + public void setDistribution(Map distribution) { + this.distribution = distribution; + } + + public CalcConfig getCalcConfig() { + return calcConfig; + } + + public void setCalcConfig(CalcConfig calcConfig) { + this.calcConfig = calcConfig; + } + + public String getStype() { + return stype; + } + + public void setStype(String stype) { + this.stype = stype; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getStartDate() { + return startDate; + } + + public void setStartDate(Date startDate) { + this.startDate = startDate; + } + + public Date getEndDate() { + return endDate; + } + + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + + public List getCalcCommands() { + return calcCommands; + } + + public void setCalcCommands(List calcCommands) { + this.calcCommands = calcCommands; + } + + public String getEstateType() { + return estateType; + } + + public void setEstateType(String estateType) { + this.estateType = estateType; + } + + public Map> getAvgUpdateBoMap() { + return avgUpdateBoMap; + } + + public void setAvgUpdateBoMap(Map> avgUpdateBoMap) { + this.avgUpdateBoMap = avgUpdateBoMap; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public Double getMinCredit() { + return minCredit; + } + + public void setMinCredit(Double minCredit) { + this.minCredit = minCredit; + } + + public Double getMaxCredit() { + return maxCredit; + } + + public void setMaxCredit(Double maxCredit) { + this.maxCredit = maxCredit; + } + + public Integer getValueType() { + return valueType; + } + + public void setValueType(Integer valueType) { + this.valueType = valueType; + } + + public CalcDistrictStat getCalcDistrictStat() { + return calcDistrictStat; + } + + public void setCalcDistrictStat(CalcDistrictStat calcDistrictStat) { + this.calcDistrictStat = calcDistrictStat; + } + + public DistrictStat getDistrictStat() { + return districtStat; + } + + public void setDistrictStat(DistrictStat districtStat) { + this.districtStat = districtStat; + } + + public Date getWeekend() { + return weekend; + } + + public void setWeekend(Date weekend) { + this.weekend = weekend; + } + + + public int getSdateStart() { + return sdateStart; + } + + public void setSdateStart(int sdateStart) { + this.sdateStart = sdateStart; + } + + public int getSdateEnd() { + return sdateEnd; + } + + public void setSdateEnd(int sdateEnd) { + this.sdateEnd = sdateEnd; + } + + public String getSeries() { + return series; + } + + public void setSeries(String series) { + this.series = series; + } + + public String getVts() { + return vts; + } + + public void setVts(String vts) { + this.vts = vts; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public List getAvgBases() { + return avgBases; + } + + public void setAvgBases(List avgBases) { + this.avgBases = avgBases; + } + + + public SqmetreRent getSqmetreRent() { + return sqmetreRent; + } + + public void setSqmetreRent(SqmetreRent sqmetreRent) { + this.sqmetreRent = sqmetreRent; + } +} diff --git a/projects/fangjia-bkoff/src/main/webapp/district/list.ftl b/projects/fangjia-bkoff/src/main/webapp/district/list.ftl index a3ff35d00..60e42be0a 100644 --- a/projects/fangjia-bkoff/src/main/webapp/district/list.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/district/list.ftl @@ -686,6 +686,7 @@ 閰嶅 鍧囦环 + 绉熼噾 鏍锋湰 鏁版嵁瀵规瘮 澶嶅埗 diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/detail.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/detail.ftl new file mode 100644 index 000000000..2757fd165 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/detail.ftl @@ -0,0 +1,470 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + ${cityDisplay}<#if region?? && region!=''>-${region}<#if block?? && block!=''>-${block}</#if></#if> 鍩庡競绉熼噾璇︾粏淇℃伅 + + + + + + <#include "/common_js.ftl" /> + + + + + + + + + +<#include "/layout/header.ftl" /> +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
鏌ヨ鏉′欢绉熼噾鏇存柊绉熼噾鏂板
+ + + <@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" name="cityDisplay"/> + + 鏃ユ湡锛� + + + + 鏂板鏃ユ湡锛� + + +
+ + + + + 瑕嗙洊鐜�: + + + + 瑕嗙洊鐜�: + + +
+ + + + + 鍙俊搴�: + + + + 鍙俊搴�: + + +
+ + / + + + + + + + +
+ 鏇存柊绉熼噾 + 鍒犻櫎 + + 鏂板浠锋牸 +
+
+ + + + + + +
+
+
+ + + + + + + + + + + + + +
鏃ユ湡绉熼噾璁$畻绉熼噾鍛ㄥ悓姣�鍙俊搴�瑕嗙洊鐜�
+
+
+
+ + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtDetail.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtDetail.ftl new file mode 100644 index 000000000..ecab150c2 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtDetail.ftl @@ -0,0 +1,946 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + <#if district??>${district.name!}</#if> 绉熼噾璇︾粏淇℃伅 + + + + + <#include "/common_js.ftl" /> + + + + + + + + + + +<#include "/layout/header.ftl" /> +
+

+ + ${district.city!}- + ${district.region!}- + ${district.name!}(${district.estateType2!}) + 绉熼噾璇︾粏淇℃伅 + 閲嶇畻绉熼噾 +

+
+

+ <#if sqmetreRent??> + 鏈�鏂�(${t_util.formatDate(sqmetreRent.weekend!)}) + 绉熼噾锛�${sqmetreRent.avgPrice!}鍏�/骞崇背  +<#-- 2B绉熼噾锛�${districtStat.avg_price_2b!}鍏�/骞崇背 --> + 璁$畻鏂瑰紡锛� + <#if (sqmetreRent.valueType)??> + <#if sqmetreRent.valueType=='own'> + 鑷韩鏍锋湰 + + <#if sqmetreRent.valueType=='around'> + 鍛ㄨ竟 + + + 鍙俊搴︼細${(sqmetreRent.credit!)?string("#.#######")} + <#if sqmetreRent.markup??> +  鐜瘮涓婃湀锛�<#if sqmetreRent.markup gt 0>鈫�<#elseif sqmetreRent.markup lt 0>鈫�${(sqmetreRent.markup!/100.0)?string("#.##")}% + + <#else> + 鏈湀绉熼噾鏆傛棤 + +

+
+

${district.name!}-浠锋牸璧板娍鍥�

+ +
+ +<#--
--> +<#--

${district.name!}-鎸囧浠�

--> +<#--
--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> + +<#-- <#list guidingPrices as it>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#list guidingPrices as it>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#list guidingPrices as it>--> +<#-- --> +<#--
--> +<#--
--> +<#-- --> +<#-- --> +<#-- --> +<#--
--> +<#--
鏃ユ湡 ${it.guidingDate?string("yyyy-MM-dd")} --> +<#--
浠锋牸${it.guidingValue!}
娣诲姞浜�${it.guidingPerson!}
--> +<#--
--> +<#--
--> +<#--
--> +<#--

${district.name!}-鍙傝�冧环

--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (avgBases??&&avgBases?size>0)>--> +<#-- <#list avgBases as it>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if avgBases?size == 0>--> +<#-- --> +<#-- --> +<#-- --> +<#--
浠锋牸璋冩煡鏃堕棿璋冩煡浜�
--> +<#-- ${it.price}--> +<#-- --> +<#-- ${it.creationDate?string("yyyy-MM-dd")}--> +<#-- --> +<#-- <#if it.userName??>--> +<#-- ${it.userName}--> +<#-- --> +<#--
鏆傛棤鏁版嵁
--> +<#--
--> +<#--
--> +<#-- --> +<#--

${district.name!}-绗笁鏂逛环鏍煎姣�

--> +<#-- --> +<#-- <#list averageStatistics as it>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.xiaozijiaNewPrice)?? || (it.xiaozijiaEsfPrice)??> --> +<#-- --> +<#-- --> +<#-- <#if (it.lianjiaNewPrice)?? || (it.lianjiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.anjukeNewPrice)?? || (it.anjukeEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.zhugezhaofangNewPrice)?? || (it.zhugezhaofangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.beikeNewPrice)?? || (it.beikeEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.fangguguNewPrice)?? || (it.fangguguEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.fangdoudouNewPrice)?? || (it.fangdoudouEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.soufangNewPrice)?? || (it.soufangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.cityhouseNewPrice)?? || (it.cityhouseEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangtanNewPrice)?? || (it.fangtanEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.tuboshiNewPrice)?? || (it.tuboshiEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.centanetNewPrice)?? || (it.centanetEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.leyoujiaNewPrice)?? || (it.leyoujiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.qfangNewPrice)?? || (it.qfangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.sinaNewPrice)?? || (it.sinaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.cricNewPrice)?? || (it.cricEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.ganjiNewPrice)?? || (it.ganjiEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.yungujiaNewPrice)?? || (it.yungujiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.xiaozijiaNewPrice)?? || (it.xiaozijiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.lianjiaNewPrice)?? || (it.lianjiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.anjukeNewPrice)?? || (it.anjukeEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.zhugezhaofangNewPrice)?? || (it.zhugezhaofangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.beikeNewPrice)?? || (it.beikeEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangguguNewPrice)?? || (it.fangguguEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangdoudouNewPrice)?? || (it.fangdoudouEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.soufangNewPrice)?? || (it.soufangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.cityhouseNewPrice)?? || (it.cityhouseEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangtanNewPrice)?? || (it.fangtanEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.tuboshiNewPrice)?? || (it.tuboshiEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.centanetNewPrice)?? || (it.centanetEsfPrice)??> --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.leyoujiaNewPrice)?? || (it.leyoujiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.qfangNewPrice)?? || (it.qfangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.sinaNewPrice)?? || (it.sinaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.cricNewPrice)?? || (it.cricEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.ganjiNewPrice)?? || (it.ganjiEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.yungujiaNewPrice)?? || (it.yungujiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.xiaozijiaNewPrice)?? || (it.xiaozijiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.lianjiaNewPrice)?? || (it.lianjiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.anjukeNewPrice)?? || (it.anjukeEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.zhugezhaofangNewPrice)?? || (it.zhugezhaofangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.beikeNewPrice)?? || (it.beikeEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangguguNewPrice)?? || (it.fangguguEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangdoudouNewPrice)?? || (it.fangdoudouEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.soufangNewPrice)?? || (it.soufangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.cityhouseNewPrice)?? || (it.cityhouseEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangtanNewPrice)?? || (it.fangtanEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.tuboshiNewPrice)?? || (it.tuboshiEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.centanetNewPrice)?? || (it.centanetEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.leyoujiaNewPrice)?? || (it.leyoujiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.qfangNewPrice)?? || (it.qfangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.sinaNewPrice)?? || (it.sinaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.cricNewPrice)?? || (it.cricEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.ganjiNewPrice)?? || (it.ganjiEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.yungujiaNewPrice)?? || (it.yungujiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if averageStatistics?size == 0>--> +<#-- --> +<#-- --> +<#--
鏃ユ湡鎴夸环缃�灏忚祫瀹�閾惧瀹夊眳瀹�璇歌憶璐濆3鎴夸及浼�鎴垮厹鍏�鎼滄埧cityhouse鎴挎帰鍏斿崥澹�涓師鍦颁骇涔愭湁瀹�Q鎴�鏂版氮鍏嬪皵鐟�璧堕泦缃�浜戜及浠�
鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�
${(t_util.parseDate(it.shortDate?string, 'yyyyMM'))?string("yyyy骞碝M鏈�")}${it.fangjiaPrice!}${it.xiaozijiaNewPrice!}${it.xiaozijiaEsfPrice!}${it.lianjiaNewPrice!}${it.lianjiaEsfPrice!}${it.anjukeNewPrice!}${it.anjukeEsfPrice!}${it.zhugezhaofangNewPrice!}${it.zhugezhaofangEsfPrice!}${it.beikeNewPrice!}${it.beikeEsfPrice!}${it.fangguguNewPrice!}${it.fangguguEsfPrice!}${it.fangdoudouNewPrice!}${it.fangdoudouEsfPrice!}${it.soufangNewPrice!}${it.soufangEsfPrice!}${it.cityhouseNewPrice!}${it.cityhouseEsfPrice!}${it.fangtanNewPrice!}${it.fangtanEsfPrice!}${it.tuboshiNewPrice!}${it.tuboshiEsfPrice!}${it.centanetNewPrice!}${it.centanetEsfPrice!}${it.leyoujiaNewPrice!}${it.leyoujiaEsfPrice!}${it.qfangNewPrice!}${it.qfangEsfPrice!}${it.sinaNewPrice!}${it.sinaEsfPrice!}${it.cricNewPrice!}${it.cricEsfPrice!}${it.ganjiNewPrice!}${it.ganjiEsfPrice!}${it.yungujiaNewPrice!}${it.yungujiaEsfPrice!}
鏆傛棤鏁版嵁
--> +<#-- --> +<#--
--> +<#-- <#if !(calcDistrictStat??)>
鏈湀娌℃湁鍒╃敤绗笁鏂圭殑璇︾粏鏁版嵁锛�
--> +<#--
--> +<#-- <#if calcDistrictStat?? && calcDistrictStat.thirdpartDetails??>--> +<#-- <#macro greet pt> --> +<#-- <#assign ret=0>--> +<#-- <#list calcDistrictStat.thirdpartDetails as detail>--> +<#-- <#if detail['name'] == pt && detail['val']??>--> +<#-- <#assign ret>${detail['val']!}--> +<#-- --> +<#-- --> +<#-- ${ret}--> +<#-- --> +<#-- --> + +

+ ${district.name!}-鏍锋湰鏁e垪鍥� + 鎴挎簮鏍锋湰鍒楄〃 +<#-- 浜ゆ槗鏁版嵁鍒楄〃(${dealPriceCount!})--> +

+ <#-- + + +
涓冨ぉ涓�涓湀涓変釜鏈�鍗婂勾涓�骞�鍏ㄩ儴
${distribution['QiTian']}${distribution['YiYue']}${distribution['SanYue']}${distribution['BanNian']}${distribution['YiNian']}${distribution['All']}
--> +

${district.name!}-鎴挎簮鏁e垪鍥�

+
+<#--

${district.name!}-鏍锋湰杩囨护瑙勫垯

--> +<#--
--> +<#-- <#if calcConfig??>--> +<#-- --> +<#-- <#else>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if calcConfig??>--> +<#-- --> +<#-- <#else>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if calcConfig??>--> +<#-- --> +<#-- <#else>--> +<#-- --> +<#-- --> +<#-- (璇疯缃緝澶у尯闂�)--> +<#--
--> +<#--

--> +<#--
--> +<#-- --> +<#--
--> +<#--


--> +
+ + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtList.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtList.ftl new file mode 100644 index 000000000..b5846cabb --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtList.ftl @@ -0,0 +1,344 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + ${cityDisplay}<#if region?? && region!=''>-${region}<#if block?? && block!=''>-${block}</#if></#if> 灏忓尯鍧囦环鎿嶄綔鍒楄〃 + + + + + <#include "/common_js.ftl" /> + + + + + + + + + + +<#include "/layout/header.ftl" /> +<#setting number_format="0.###########"/> +
+ + + + + + + +
鏌ヨ鏉′欢
+
+ <@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" name="cityDisplay"/> + + + + + + + - + + + + + + + + + +
+
+ 鏌ヨ鍒�${pager.totalRows!}鏉¤褰� + + + + + + + + + + + + + + <#if avgUpdateBos??> + <#list avgUpdateBos as it> + + + + + + + + + + + + + + + + + + + +
鍖哄煙灏忓尯鍚�鍒悕鐗╀笟绫诲瀷 + <#if sort?? && sort == 'price_desc'> + 鍧囦环鈫� + <#elseif sort?? && sort == 'price_asc'> + 鍧囦环鈫� + <#else> + 鍧囦环 + + 鏃堕棿 + <#if sort?? && sort == 'credit_desc'>鍙俊搴�鈫� + <#elseif sort?? && sort == 'credit_asc'>鍙俊搴�鈫� + <#else>鍙俊搴� + + 璁$畻绫诲瀷鎿嶄綔
${it.region!}${it.districtName!} + ${t_util.join(it.alias!, ',')} + ${it.estateType!}${it.avgPrice!}${it.weekend!}${it.credit} + <#if it.valueType?? && it.valueType == 1> + 鎸囧浠� + <#elseif it.valueType?? && it.valueType == 2> + 鑷韩鏍锋湰 + <#elseif it.valueType?? && it.valueType == 3> + 绗笁鏂� + <#elseif it.valueType?? && it.valueType == 4> + 浜ゆ槗鏁版嵁 + <#elseif it.valueType?? && it.valueType == 5> + 鍛ㄨ竟妤肩洏 + + + 璋冩煡 + 鏍锋湰 + 璁剧疆 +
+ <@d_pager action = "districtList" currentPage = pager.currentPage controller = "rentPriceUpdate" totalPages = pager.totalPages pagerCount=12 theme="full"/> +
+
+ + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/doCreatTask.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/doCreatTask.ftl new file mode 100644 index 000000000..2cc00dfbe --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/doCreatTask.ftl @@ -0,0 +1,278 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + 鍧囦环鎿嶄綔鍚庡彴 + + + + + + <#include "/common_js.ftl" /> + + + + +<#include "/layout/header.ftl" /> +
+ <#-- + + + + + + + + + + + + + + +
椤�鍊�
鍩庡競
鍖哄煙
鏉垮潡
璧锋鏃堕棿 + + - +
鎿嶄綔 +
+ --> +
+ <#assign seqIndex = 0 /> + + + + + + + + <#list ['HOT', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] as key> + <#if avgUpdateBoMap[key]?? && avgUpdateBoMap[key]?size gt 0> + + + + <#list avgUpdateBoMap[key] as it> + + + + + + + + + + +
+ <#list ['HOT', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] as key> + ${key}     + +
搴忓彿鍚嶇О鏈�鏂板潎浠�璧峰鏃ユ湡鎿嶄綔
  ${key}
<#assign seqIndex = seqIndex +1 />${seqIndex} +  ${it.city} + ${it.avgPrice!}${it.startDate!} + 璇︾粏淇℃伅 + 鏌ョ湅灏忓尯 + 鏍锋湰鎴挎簮 +
+ + + + +<#-- + +--> + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingList.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingList.ftl new file mode 100644 index 000000000..e12ac9f88 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingList.ftl @@ -0,0 +1,192 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + 鎸囧浠锋暟鎹� + + + + + + +<#include "/common_js.ftl" /> +<#include "/layout/header.ftl" /> +<#setting number_format="0.####"> +
+ +
+
+
+
+ +
+ + + + + + + + + + + +
鍩庡競鍖哄煙灏忓尯鍚�鏃ユ湡娣诲姞浜�娣诲姞浠锋牸鎿嶄綔
+
+ + + <#list guidingPrices! as guid> + + + + + + + + + + + +
${guid.city!''}${guid.region!}${guid.name!}${guid.guidingDate?string("yyyy-MM-dd")}${guid.guidingPerson!}${guid.guidingValue!} + 缂栬緫 + 鍒犻櫎 + +
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingPrice.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingPrice.ftl new file mode 100644 index 000000000..a6a5a6580 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingPrice.ftl @@ -0,0 +1,111 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + 娣诲姞鎸囧浠� + + + + +<#include "/common_js.ftl" /> + <#include "/layout/header.ftl" /> +
+
+
+ + + + + + + + + + + + + + + + + + +
+ 鍩庡競 + + +
+ 鍖哄煙 + + +
+ 灏忓尯鍚� + + +
+ 鏃ユ湡* + +
+ 鎸囧浠锋牸* + +
+ + + + + +
+ +
+ +
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listQR.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listQR.ftl new file mode 100644 index 000000000..781677cd0 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listQR.ftl @@ -0,0 +1,125 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + 鍧囦环绯荤粺-${cityDisplay!}浠锋牸璐ㄩ噺璺熻釜 + + + + + <#include "/common_js.ftl" /> + + + + + + + + + + + <#setting number_format="0.###########"/> + <#include "/layout/header.ftl" /> + +
+ + + + + + + +
鏌ヨ鏉′欢
+
+
+ <@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" showCountry="1" name="cityDisplay"/> +
+
+ + +  -  + + +
+ +
+
+ +
+ cur"> + 灏忓尯閲� + + cur"> + 骞冲潎鍙俊搴� + + cur"> + 娴嬭瘯妗堜緥鏁伴噺 + + cur"> + 妗堜緥宸瘮<10%閲� + + cur"> + 妗堜緥宸瘮<20%閲� + + cur"> + 妗堜緥宸瘮<30%閲� + + <#-- + class="cur" style="border: 1px solid #e0e0e0; padding: 8px 10px; margin-top: 10px;cursor:pointer;border-left:none;"> + 鎴挎簮鏍锋湰閲� + + --> +
+ +
+ +
+ + + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listSQR.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listSQR.ftl new file mode 100644 index 000000000..2cd6e67b5 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listSQR.ftl @@ -0,0 +1,110 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + 鍧囦环绯荤粺-${cityDisplay!}鏍锋湰璐ㄩ噺璺熻釜 + + + + + <#include "/common_js.ftl" /> + + + + + + + + + + + <#setting number_format="0.###########"/> + <#include "/layout/header.ftl" /> + +
+ + + + + + + +
鏌ヨ鏉′欢
+
+
+ <@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" showCountry="1" name="cityDisplay"/> +
+
+ + +  -  + + +
+ +
+
+ + + +
+
+ + + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadQRData.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadQRData.ftl new file mode 100644 index 000000000..c706f6731 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadQRData.ftl @@ -0,0 +1,102 @@ +
+ + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadSQRData.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadSQRData.ftl new file mode 100644 index 000000000..12e6095c6 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadSQRData.ftl @@ -0,0 +1,49 @@ +
+ + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/taskList.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/taskList.ftl new file mode 100644 index 000000000..f32d1be97 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/taskList.ftl @@ -0,0 +1,160 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + 鍧囦环鏇存柊 + + + + + <#include "/common_js.ftl" /> + + + + + + + + + + +<#include "/layout/header.ftl" /> +
+ + + + + + + +
鏌ヨ鏉′欢
+
+ <@d_city defaultValue="${cityDisplay!}" callbackField="display" name="cityDisplay"/> + + + + + + <#if startDate??> + + <#else> + + + + <#if endDate??> + + <#else> + + + + 鍒涘缓浠诲姟 +
+
+ + + <#list calcCommands as it> + + + + + + + + + + + + + + + + +
鍩庡競鍖哄煙鏉垮潡灏忓尯鍚�璁$畻绫诲瀷璁$畻鏃堕棿鐘舵��浼樺厛绾�鐗╀笟绫诲瀷绉嶇被鍒涘缓鏃堕棿澶囨敞
${it.city!}${it.region!}${it.block!}${it.name} + <#if it.calcType ==0>鎸囧畾鏃ユ湡<#elseif it.calcType ==1 >鍏ㄩ儴璁$畻 + + <#if it.calcDate??> + ${it.calcDate?string("yyyy-MM-dd")} + <#if it.status ==0> + 鍒濆鐘舵�� + <#elseif it.status == 1> + 姝e湪澶勭悊 + <#elseif it.status == 2> + 澶勭悊瀹屾垚 + <#elseif it.status == 3> + 澶勭悊寮傚父 + + + <#if it.priority ==0> + 0 + <#elseif it.priority == 1> + 1 + <#elseif it.priority == 2> + 2 + + ${it.estateType!}${it.category!}${it.creationDate?string("yyyy-MM-dd HH:mm")}${it.remark!}
+ <@d_pager action = "taskList" currentPage = pager.currentPage controller = "rentPriceUpdate" totalPages = pager.totalPages/> +
+
+ + + + + \ No newline at end of file diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java index a5bb8b9a4..3b142528e 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java @@ -11,7 +11,7 @@ import javax.persistence.Table; import com.fangjia.dal.MongoEntity; @Entity -@Table(name = "fangjia.sqmetre_rent") +@Table(name = "fangjia.sqmetre_rent_2") public class SqmetreRent implements MongoEntity { /** @@ -22,18 +22,16 @@ public class SqmetreRent implements MongoEntity { private String city; private String region; private String districtName; - private Double avgPrice; - private int markup; + private Integer avgPrice; + private Integer calcAvgPrice; + private Double markup; private Date weekend; private String cat; private Date creationDate; private Date modificationDate; - private String sampleEnum; - private double credit; - private String cluster; - - private Double oldValue; - private String oldSampleEnum; + private Double credit; + private String valueType; + private Integer priceToRent; @Id @GeneratedValue @@ -76,22 +74,47 @@ public class SqmetreRent implements MongoEntity { } @Column(name = "avg_price") - public Double getAvgPrice() { + public Integer getAvgPrice() { return avgPrice; } - public void setAvgPrice(Double avgPrice) { + public void setAvgPrice(Integer avgPrice) { this.avgPrice = avgPrice; } - + @Column(name = "calc_avg_price") + public Integer getCalcAvgPrice() { + return calcAvgPrice; + } + + public void setCalcAvgPrice(Integer calcAvgPrice) { + this.calcAvgPrice = calcAvgPrice; + } + + @Column(name = "value_type") + public String getValueType() { + return valueType; + } + + public void setValueType(String valueType) { + this.valueType = valueType; + } + + @Column(name = "price_to_rent") + public Integer getPriceToRent() { + return priceToRent; + } + + public void setPriceToRent(Integer priceToRent) { + this.priceToRent = priceToRent; + } @Column(name = "markup") - public int getMarkup() { + public Double getMarkup() { return markup; } - public void setMarkup(int markup) { + public void setMarkup(Double markup) { this.markup = markup; } @@ -123,52 +146,15 @@ public class SqmetreRent implements MongoEntity { } - @Column(name = "sample_enum") - public String getSampleEnum() { - return sampleEnum; - } - - public void setSampleEnum(String sampleEnum) { - this.sampleEnum = sampleEnum; - } - - @Column(name = "credit") - public double getCredit() { + public Double getCredit() { return credit; } - public void setCredit(double credit) { + public void setCredit(Double credit) { this.credit = credit; } - @Column(name = "cluster") - public String getCluster() { - return cluster; - } - - public void setCluster(String cluster) { - this.cluster = cluster; - } - - @Column(name = "old_value") - public Double getOldValue() { - return oldValue; - } - - public void setOldValue(Double oldValue) { - this.oldValue = oldValue; - } - - @Column(name = "old_sample_enum") - public String getOldSampleEnum() { - return oldSampleEnum; - } - - public void setOldSampleEnum(String oldSampleEnum) { - this.oldSampleEnum = oldSampleEnum; - } - @Column(name = "cat") public String getCat() { return cat; 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 eded73b3f..d884547cf 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 @@ -1042,7 +1042,7 @@ public class EvaluationServiceImpl implements EvaluationService { evaluation.setTotalPrice(((Number) (totalPrice)).intValue()); - evaluation.setEvaluateWay(sqmetreRent.getSampleEnum()); + evaluation.setEvaluateWay(sqmetreRent.getValueType()); evaluation.setCredit(sqmetreRent.getCredit()); }else{ evaluation.setTotalPrice(null); diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentService.java b/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentService.java index 540d00721..ace5f5629 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentService.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentService.java @@ -4,6 +4,7 @@ import java.util.Date; import java.util.List; import java.util.Map; +import com.fangjia.dal.common.DistrictKey; import com.fangjia.dal.mongo.model.SqmetreRent; public interface SqmetreRentService { @@ -28,4 +29,5 @@ public interface SqmetreRentService { SqmetreRent findNearestSqmetreRent(String city, String region, String name, String cat); + List findAllAvgPriceByKeys(DistrictKey districtKey, String cat); } diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentServiceImpl.java b/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentServiceImpl.java index 60cb7cc97..56630bc77 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentServiceImpl.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentServiceImpl.java @@ -5,6 +5,7 @@ import java.util.Date; import java.util.List; import java.util.Map; +import com.fangjia.dal.common.DistrictKey; import org.apache.commons.lang.StringUtils; import org.apache.http.impl.cookie.DateUtils; @@ -216,6 +217,21 @@ public class SqmetreRentServiceImpl implements SqmetreRentService{ } return sqmetreRent; } - - + + @Override + public List findAllAvgPriceByKeys(DistrictKey key, String cat) { + List params = new ArrayList(); + params.add(new QueryParam("city", key.getCity())); + if (StringUtils.isNotBlank(key.getRegion())) { + params.add(new QueryParam("region", key.getRegion())); + } + if (StringUtils.isNotBlank(key.getName())) { + params.add(new QueryParam("districtName", key.getName())); + } + params.add(new QueryParam("cat", cat)); + List sortParams = new ArrayList(); + sortParams.add(new SortParam("weekend", true)); + return sqmetreRentDao.findAllByParams(params, sortParams,0,Integer.MAX_VALUE, + new String[]{"weekend", "credit", "cat", "avgPrice", "calcAvgPrice"}); + } } From 0dad9ea218192ead9f7e369d5f21241db74fe244 Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Mon, 8 Aug 2022 15:30:33 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A7=9F=E9=87=91?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RentPriceUpdateController.java | 1166 +++++++++++++++++ .../controllers/SqMetreRentController.java | 6 +- .../bkoff/model/RentPriceUpdateModel.java | 341 +++++ .../src/main/webapp/district/list.ftl | 1 + .../main/webapp/rentPriceUpdate/detail.ftl | 470 +++++++ .../webapp/rentPriceUpdate/districtDetail.ftl | 946 +++++++++++++ .../webapp/rentPriceUpdate/districtList.ftl | 344 +++++ .../webapp/rentPriceUpdate/doCreatTask.ftl | 278 ++++ .../webapp/rentPriceUpdate/guidingList.ftl | 192 +++ .../webapp/rentPriceUpdate/guidingPrice.ftl | 111 ++ .../main/webapp/rentPriceUpdate/listQR.ftl | 125 ++ .../main/webapp/rentPriceUpdate/listSQR.ftl | 110 ++ .../webapp/rentPriceUpdate/loadQRData.ftl | 102 ++ .../webapp/rentPriceUpdate/loadSQRData.ftl | 49 + .../main/webapp/rentPriceUpdate/taskList.ftl | 160 +++ .../fangjia/dal/mongo/model/SqmetreRent.java | 92 +- .../datastore/EvaluationServiceImpl.java | 2 +- .../service/district/SqmetreRentService.java | 2 + .../district/SqmetreRentServiceImpl.java | 20 +- 19 files changed, 4458 insertions(+), 59 deletions(-) create mode 100644 projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/RentPriceUpdateController.java create mode 100644 projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/RentPriceUpdateModel.java create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/detail.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtDetail.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtList.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/doCreatTask.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingList.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingPrice.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listQR.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listSQR.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadQRData.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadSQRData.ftl create mode 100644 projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/taskList.ftl diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/RentPriceUpdateController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/RentPriceUpdateController.java new file mode 100644 index 000000000..7964e3813 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/RentPriceUpdateController.java @@ -0,0 +1,1166 @@ +package com.fangjia.bkoff.controllers; + +import com.fangjia.bkoff.model.AvgPriceUpdateModel; +import com.fangjia.bkoff.model.GuidingAvgPriceUpdateModel; +import com.fangjia.bkoff.model.JsonModel; +import com.fangjia.bkoff.model.RentPriceUpdateModel; +import com.fangjia.core.RegionData; +import com.fangjia.core.util.AnalyticsUtil; +import com.fangjia.core.util.DataUtil; +import com.fangjia.core.util.DateUtil; +import com.fangjia.core.util.RandomUtil; +import com.fangjia.dal.common.DistrictKey; +import com.fangjia.dal.common.ServerAreaData; +import com.fangjia.dal.mongo.dao.*; +import com.fangjia.dal.mongo.fangjia.model.ServerArea; +import com.fangjia.dal.mongo.model.DistrictStat; +import com.fangjia.dal.mongo.model.RegionStat; +import com.fangjia.dal.mongo.model.SqmetreRent; +import com.fangjia.dal.mongo.model.bkoff.*; +import com.fangjia.dal.seawater.model.Seawater; +import com.fangjia.dal.seaweed.model.District; +import com.fangjia.service.bo.AvgUpdateBo; +import com.fangjia.service.bo.DistrictStatBo; +import com.fangjia.service.datastore.DistrictService; +import com.fangjia.service.datastore.RegionStatService; +import com.fangjia.service.district.DistrictStatService; +import com.fangjia.service.district.SqmetreRentService; +import com.fangjia.service.mongo.bkoff.*; +import com.fangjia.service.mongo.fangjia.DealPriceService; +import com.fangjia.service.mongo.fangjia.SeawaterService; +import com.ibm.icu.text.MessageFormat; +import com.mongodb.BasicDBObject; +import com.mongodb.DBObject; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.time.DateUtils; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.BooleanClause; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.TermQuery; +import org.apache.solr.client.solrj.util.ClientUtils; +import org.bson.types.ObjectId; +import org.sothis.core.util.Pager; +import org.sothis.web.mvc.annotation.Param; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; +import java.util.*; + +/** + * 负责租金更新任务的管理工作 + */ +public class RentPriceUpdateController { + + private RegionStatService regionStatService; + private CalcCommandService calcCommandService; + private DistrictStatService districtStatService; + private SqmetreRentService sqmetreRentService; + private CalcDistrictStatDao calcDistrictStatDao; + private AvgBaseDao avgBaseDao; + private DistrictService districtService; + private AverageStatisticsDao averageStatisticsDao; + private DealPriceService dealPriceService; + private GuidingPriceService guidingPriceService; + private CalcConfigService calcConfigService; + private AveragerQualityReportService averagerQualityReportService; + private SampleQualityReportService sampleQualityReportService; + private ComparePriceDao comparePriceDao; + private ComparePriceCityDao comparePriceCityDao; + private SeawaterService seawaterService; + private static final List IPS = Arrays.asList("fangjia-priceanalysis-0"); + + private static final List HOT_CITIES = Arrays.asList("上海", "北京", "广州", "深圳", "天津", "重庆", "成都", "杭州", "南京", "长沙", + "武汉", "西安", "沈阳"); + + public Object listQRAction(AvgPriceUpdateModel model) { + if(StringUtils.isBlank(model.getCityDisplay())) { + model.setCityDisplay("全国"); + } + + if(model.getSdateStart() <= 0 || model.getSdateEnd() <= 0) { + Date sunday = DateUtil.getThisSunday(new Date()); + model.setSdateStart(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(DateUtil.getBeforeDay(sunday, 13 * 7)))); //最近一季度 + model.setSdateEnd(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(sunday))); + } + + if(StringUtils.isBlank(model.getStype())) { + model.setStype("1"); + } + + if(StringUtils.isBlank(model.getVts())) { + model.setVts("1"); + } + + return model; + } + + public Object listSQRAction(AvgPriceUpdateModel model) { + if(StringUtils.isBlank(model.getCityDisplay())) { + model.setCityDisplay("全国"); + } + + if(model.getSdateStart() <= 0 || model.getSdateEnd() <= 0) { + Date sunday = DateUtil.getThisSunday(new Date()); + model.setSdateStart(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(DateUtil.getBeforeDay(sunday, 13 * 7)))); //最近一季度 + model.setSdateEnd(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(sunday))); + } + + if(StringUtils.isBlank(model.getStype())) { + model.setStype("1"); + } + + if(StringUtils.isBlank(model.getVts())) { + model.setVts("1"); + } + return model; + } + + public Object loadQRDataAction(AvgPriceUpdateModel model) { + if(StringUtils.isBlank(model.getCityDisplay())) { + model.setCityDisplay("全国"); + } + + if(model.getSdateStart() <= 0 || model.getSdateEnd() <= 0) { + Date sunday = DateUtil.getThisSunday(new Date()); + model.setSdateStart(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(DateUtil.getBeforeDay(sunday, 13)))); //最近一季度 + model.setSdateEnd(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(sunday))); + } + + if(StringUtils.isBlank(model.getStype())) { + model.setStype("1"); + } + + JSONArray series = createQualitySeries(model.getCityDisplay(), model.getStype(), model.getVts(), DateUtil.parseDate(String.valueOf(model.getSdateStart()), "yyyyMMdd"), DateUtil.parseDate(String.valueOf(model.getSdateEnd()), "yyyyMMdd")); + model.setSeries(series.toString().replace("\"name\"", "name").replace("\"data\"", "data").replace("\"visible\"", "visible")); + return model; + } + + public Object loadSQRDataAction(AvgPriceUpdateModel model) { + if(StringUtils.isBlank(model.getCityDisplay())) { + model.setCityDisplay("全国"); + } + + if(model.getSdateStart() <= 0 || model.getSdateEnd() <= 0) { + Date sunday = DateUtil.getThisSunday(new Date()); + model.setSdateStart(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(DateUtil.getBeforeDay(sunday, 13)))); //最近一季度 + model.setSdateEnd(Integer.parseInt(DateUtil.formatToTightYYYYMMDD(sunday))); + } + + if(StringUtils.isBlank(model.getStype())) { + model.setStype("1"); + } + + JSONArray series = createSampleSeries(model.getCityDisplay(), model.getStype(), model.getVts(), DateUtil.parseDate(String.valueOf(model.getSdateStart()), "yyyyMMdd"), DateUtil.parseDate(String.valueOf(model.getSdateEnd()), "yyyyMMdd")); + model.setSeries(series.toString().replace("\"name\"", "name").replace("\"data\"", "data").replace("\"visible\"", "visible")); + return model; + } + + private JSONArray createSampleSeries(String city, String stype, String vts, Date startDate, Date endDate) { + List sampleQualityReports = sampleQualityReportService.findQualityReports(city, Integer.parseInt(DateUtil.formatToTightYYYYMMDD(startDate)), + Integer.parseInt(DateUtil.formatToTightYYYYMMDD(endDate))); + + JSONArray ret = new JSONArray(); + JSONObject jo1 = new JSONObject(), jo2 = new JSONObject(), jo3 = new JSONObject(),jo4 = new JSONObject(), + jo5 = new JSONObject(), jo6 = new JSONObject(), jo7 = new JSONObject(), jo8 = new JSONObject(); + JSONArray pt1 = new JSONArray(), pt2 = new JSONArray(), pt3 = new JSONArray(), pt4 = new JSONArray(), + pt5 = new JSONArray(), pt6 = new JSONArray(), pt7 = new JSONArray(), pt8 = new JSONArray(); + + if("1".equals(stype)) { + jo1.put("name", "一个月<10小区量"); + jo2.put("name", "一个月<30小区量"); + jo3.put("name", "一个月<100小区量"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + sqr.getMonthCount1() + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + sqr.getMonthCount2() + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + sqr.getMonthCount3() + "]")); + } + }else if("2".equals(stype)) { + jo1.put("name", "一个月<10比例"); + jo2.put("name", "一个月<30比例"); + jo3.put("name", "一个月<100比例"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getMonthCount1() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getMonthCount2() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getMonthCount3() / (double)sqr.getDistrictCount() * 1000.0) / 10.0+ "]")); + } + }else if("3".equals(stype)) { + jo1.put("name", "季度<10小区量"); + jo2.put("name", "季度<30小区量"); + jo3.put("name", "季度<100小区量"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + sqr.getQuarCount1() + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + sqr.getQuarCount2() + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + sqr.getQuarCount3() + "]")); + } + }else if("4".equals(stype)) { + jo1.put("name", "季度<10比例"); + jo2.put("name", "季度<30比例"); + jo3.put("name", "季度<100比例"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getQuarCount1() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getQuarCount2() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getQuarCount3() / (double)sqr.getDistrictCount() * 1000.0) / 10.0+ "]")); + } + }else if("5".equals(stype)) { + jo1.put("name", "半年<10小区量"); + jo2.put("name", "半年<30小区量"); + jo3.put("name", "半年<100小区量"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + sqr.getHalfCount1() + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + sqr.getHalfCount2() + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + sqr.getHalfCount3() + "]")); + } + }else if("6".equals(stype)) { + jo1.put("name", "半年<10比例"); + jo2.put("name", "半年<30比例"); + jo3.put("name", "半年<100比例"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getHalfCount1() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getHalfCount2() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getHalfCount3() / (double)sqr.getDistrictCount() * 1000.0) / 10.0+ "]")); + } + }else if("7".equals(stype)) { + jo1.put("name", "一年<10小区量"); + jo2.put("name", "一年<30小区量"); + jo3.put("name", "一年<100小区量"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + sqr.getYearCount1() + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + sqr.getYearCount2() + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + sqr.getYearCount3() + "]")); + } + }else if("8".equals(stype)) { + jo1.put("name", "一年<10比例"); + jo2.put("name", "一年<30比例"); + jo3.put("name", "一年<100比例"); + for(SampleQualityReport sqr : sampleQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(sqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getYearCount1() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getYearCount2() / (double)sqr.getDistrictCount() * 1000.0) / 10.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)sqr.getYearCount3() / (double)sqr.getDistrictCount() * 1000.0) / 10.0+ "]")); + } + } + + + jo1.put("color", "#79434D"); + jo2.put("color", "#BBBD81"); + jo3.put("color", "#C877C8"); + + jo1.put("data", pt1); + jo2.put("data", pt2); + jo3.put("data", pt3); + + ret.add(jo1); + ret.add(jo2); + ret.add(jo3); + + return ret; + } + + private JSONArray createQualitySeries(String city, String stype, String vts, Date startDate, Date endDate) { + List averagerQualityReports = averagerQualityReportService.findQualityReports(city, Integer.parseInt(DateUtil.formatToTightYYYYMMDD(startDate)), + Integer.parseInt(DateUtil.formatToTightYYYYMMDD(endDate))); + JSONArray ret = new JSONArray(); + JSONObject jo1 = new JSONObject(), jo2 = new JSONObject(), jo3 = new JSONObject(),jo4 = new JSONObject(), + jo5 = new JSONObject(), jo6 = new JSONObject(), jo7 = new JSONObject(), jo8 = new JSONObject(); + JSONArray pt1 = new JSONArray(), pt2 = new JSONArray(), pt3 = new JSONArray(), pt4 = new JSONArray(), + pt5 = new JSONArray(), pt6 = new JSONArray(), pt7 = new JSONArray(), pt8 = new JSONArray(); + if("1".equals(stype)) { + jo1.put("name", "小区量(全部)"); + jo2.put("name", "小区量(无法计算)"); + jo3.put("name", "小区量(指导价)"); + jo4.put("name", "小区量(自身样本)"); + jo5.put("name", "小区量(第三方)"); + jo6.put("name", "小区量(成交数据)"); + jo7.put("name", "小区量(周边小区)"); + jo8.put("name", "小区量(推算)"); + for(AveragerQualityReport aqr : averagerQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(aqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + aqr.getDistrictCount() + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + aqr.getNoneCount() + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + aqr.getGuidingCount() + "]")); + pt4.add(JSONArray.fromObject("[" + tms + "," + aqr.getOwnCount() + "]")); + pt5.add(JSONArray.fromObject("[" + tms + "," + aqr.getThirdCount() + "]")); + pt6.add(JSONArray.fromObject("[" + tms + "," + aqr.getDealCount() + "]")); + pt7.add(JSONArray.fromObject("[" + tms + "," + aqr.getAroundCount() + "]")); + pt8.add(JSONArray.fromObject("[" + tms + "," + aqr.getDeriCount() + "]")); + } + }else if("2".equals(stype)) { + jo1.put("name", "平均可信度(全部)"); + jo2.put("name", "平均可信度(无法计算)"); + jo3.put("name", "平均可信度(指导价)"); + jo4.put("name", "平均可信度(自身样本)"); + jo5.put("name", "平均可信度(第三方)"); + jo6.put("name", "平均可信度(成交数据)"); + jo7.put("name", "平均可信度(周边小区)"); + jo8.put("name", "平均可信度(推算)"); + for(AveragerQualityReport aqr : averagerQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(aqr.getWeekend()), "yyyyMMdd").getTime(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getAvgCredit() * 100000) + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getNoneCredit() * 100000) + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getGuidingCredit() * 100000) + "]")); + pt4.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getOwnCredit() * 100000) + "]")); + pt5.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getThirdCredit() * 100000) + "]")); + pt6.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getDealCredit() * 100000) + "]")); + pt7.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getAroundCredit() * 100000) + "]")); + pt8.add(JSONArray.fromObject("[" + tms + "," + (int)(aqr.getDeriCredit() * 100000) + "]")); + } + }else if("3".equals(stype)) { + jo1.put("name", "测试案例数量(全部)"); + jo2.put("name", "测试案例数量(无法计算)"); + jo3.put("name", "测试案例数量(指导价)"); + jo4.put("name", "测试案例数量(自身样本)"); + jo5.put("name", "测试案例数量(第三方)"); + jo6.put("name", "测试案例数量(成交数据)"); + jo7.put("name", "测试案例数量(周边小区)"); + jo8.put("name", "测试案例数量(推算)"); + for(AveragerQualityReport aqr : averagerQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(aqr.getWeekend()), "yyyyMMdd").getTime(); + int allTest = aqr.getNoneTest() + aqr.getGuidingTest() + aqr.getOwnTest() + aqr.getThirdTest() + aqr.getDealTest() + aqr.getAroundTest() + aqr.getDeriTest(); + pt1.add(JSONArray.fromObject("[" + tms + "," + allTest + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + aqr.getNoneTest() + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + aqr.getGuidingTest() + "]")); + pt4.add(JSONArray.fromObject("[" + tms + "," + aqr.getOwnTest() + "]")); + pt5.add(JSONArray.fromObject("[" + tms + "," + aqr.getThirdTest() + "]")); + pt6.add(JSONArray.fromObject("[" + tms + "," + aqr.getDealTest() + "]")); + pt7.add(JSONArray.fromObject("[" + tms + "," + aqr.getAroundTest() + "]")); + pt8.add(JSONArray.fromObject("[" + tms + "," + aqr.getDeriTest() + "]")); + } + }else if("4".equals(stype)) { + jo1.put("name", "案例差比<10%量(全部)"); + jo2.put("name", "案例差比<10%量(无法计算)"); + jo3.put("name", "案例差比<10%量(指导价)"); + jo4.put("name", "案例差比<10%量(自身样本)"); + jo5.put("name", "案例差比<10%量(第三方)"); + jo6.put("name", "案例差比<10%量(成交数据)"); + jo7.put("name", "案例差比<10%量(周边小区)"); + jo8.put("name", "案例差比<10%量(推算)"); + for(AveragerQualityReport aqr : averagerQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(aqr.getWeekend()), "yyyyMMdd").getTime(); + int allTest = aqr.getNoneTest() + aqr.getGuidingTest() + aqr.getOwnTest() + aqr.getThirdTest() + aqr.getDealTest() + aqr.getAroundTest() + aqr.getDeriTest(); + int allAccu1 = aqr.getNoneAccu1() + aqr.getGuidingAccu1() + aqr.getOwnAccu1() + aqr.getThirdAccu1() + aqr.getDealAccu1() + aqr.getAroundAccu1() + aqr.getDeriAccu1(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)allAccu1 / (double)allTest * 10000) / 100.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getNoneAccu1() / (double)allTest * 10000) / 100.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getGuidingAccu1() / (double)allTest * 10000) / 100.0 + "]")); + pt4.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getOwnAccu1() / (double)allTest * 10000) / 100.0 + "]")); + pt5.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getThirdAccu1() / (double)allTest * 10000) / 100.0 + "]")); + pt6.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getDealAccu1() / (double)allTest * 10000) / 100.0 + "]")); + pt7.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getAroundAccu1() / (double)allTest * 10000) / 100.0 + "]")); + pt8.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getDeriAccu1() / (double)allTest * 10000) / 100.0 + "]")); + } + }else if("5".equals(stype)) { + jo1.put("name", "案例差比<20%量(全部)"); + jo2.put("name", "案例差比<20%量(无法计算)"); + jo3.put("name", "案例差比<20%量(指导价)"); + jo4.put("name", "案例差比<20%量(自身样本)"); + jo5.put("name", "案例差比<20%量(第三方)"); + jo6.put("name", "案例差比<20%量(成交数据)"); + jo7.put("name", "案例差比<20%量(周边小区)"); + jo8.put("name", "案例差比<20%量(推算)"); + for(AveragerQualityReport aqr : averagerQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(aqr.getWeekend()), "yyyyMMdd").getTime(); + int allTest = aqr.getNoneTest() + aqr.getGuidingTest() + aqr.getOwnTest() + aqr.getThirdTest() + aqr.getDealTest() + aqr.getAroundTest() + aqr.getDeriTest(); + int allAccu2 = aqr.getNoneAccu2() + aqr.getGuidingAccu2() + aqr.getOwnAccu2() + aqr.getThirdAccu2() + aqr.getDealAccu2() + aqr.getAroundAccu2() + aqr.getDeriAccu2(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)allAccu2 / (double)allTest * 10000) / 100.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getNoneAccu2() / (double)allTest * 10000) / 100.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getGuidingAccu2() / (double)allTest * 10000) / 100.0 + "]")); + pt4.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getOwnAccu2() / (double)allTest * 10000) / 100.0 + "]")); + pt5.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getThirdAccu2() / (double)allTest * 10000) / 100.0 + "]")); + pt6.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getDealAccu2() / (double)allTest * 10000) / 100.0 + "]")); + pt7.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getAroundAccu2() / (double)allTest * 10000) / 100.0 + "]")); + pt8.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getDeriAccu2() / (double)allTest * 10000) / 100.0 + "]")); + } + }else if("6".equals(stype)) { + jo1.put("name", "案例差比<30%量(全部)"); + jo2.put("name", "案例差比<30%量(无法计算)"); + jo3.put("name", "案例差比<30%量(指导价)"); + jo4.put("name", "案例差比<30%量(自身样本)"); + jo5.put("name", "案例差比<30%量(第三方)"); + jo6.put("name", "案例差比<30%量(成交数据)"); + jo7.put("name", "案例差比<30%量(周边小区)"); + jo8.put("name", "案例差比<30%量(推算)"); + for(AveragerQualityReport aqr : averagerQualityReports) { + long tms = DateUtil.parseDate(String.valueOf(aqr.getWeekend()), "yyyyMMdd").getTime(); + int allTest = aqr.getNoneTest() + aqr.getGuidingTest() + aqr.getOwnTest() + aqr.getThirdTest() + aqr.getDealTest() + aqr.getAroundTest() + aqr.getDeriTest(); + int allAccu3 = aqr.getNoneAccu3() + aqr.getGuidingAccu3() + aqr.getOwnAccu3() + aqr.getThirdAccu3() + aqr.getDealAccu3() + aqr.getAroundAccu3() + aqr.getDeriAccu3(); + pt1.add(JSONArray.fromObject("[" + tms + "," + (int)((double)allAccu3 / (double)allTest * 10000) / 100.0 + "]")); + pt2.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getNoneAccu3() / (double)allTest * 10000) / 100.0 + "]")); + pt3.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getGuidingAccu3() / (double)allTest * 10000) / 100.0 + "]")); + pt4.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getOwnAccu3() / (double)allTest * 10000) / 100.0 + "]")); + pt5.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getThirdAccu3() / (double)allTest * 10000) / 100.0 + "]")); + pt6.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getDealAccu3() / (double)allTest * 10000) / 100.0 + "]")); + pt7.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getAroundAccu3() / (double)allTest * 10000) / 100.0 + "]")); + pt8.add(JSONArray.fromObject("[" + tms + "," + (int)((double)aqr.getDeriAccu3() / (double)allTest * 10000) / 100.0 + "]")); + } + } + + jo1.put("color", "#79434D"); + jo2.put("color", "#BBBD81"); + jo3.put("color", "#C877C8"); + jo4.put("color", "#3A696F"); + jo5.put("color", "#6BB7C5"); + jo6.put("color", "#729827"); + jo7.put("color", "#DD9F19"); + jo8.put("color", "#CAB0A2"); + + jo1.put("data", pt1); + jo2.put("data", pt2); + jo3.put("data", pt3); + jo4.put("data", pt4); + jo5.put("data", pt5); + jo6.put("data", pt6); + jo7.put("data", pt7); + jo8.put("data", pt8); + + List vtss = Arrays.asList(vts.split("-")); + if(vtss.contains("1")) { + ret.add(jo1); + } + if(vtss.contains("2")) { + ret.add(jo2); + } + if(vtss.contains("3")) { + ret.add(jo3); + } + if(vtss.contains("4")) { + ret.add(jo4); + } + if(vtss.contains("5")) { + ret.add(jo5); + } + if(vtss.contains("6")) { + ret.add(jo6); + } + if(vtss.contains("7")) { + ret.add(jo7); + } + if(vtss.contains("8")) { + ret.add(jo8); + } + return ret; + } + + public Object doCreatTaskAction(AvgPriceUpdateModel model) { + // model.setAvgUpdateBos(regionStatService.findAvgPriceData(null,null,null)); + + Map> avgUpdateBoMap = new LinkedHashMap>(); + List avgUpdateBoList = regionStatService.findAvgPriceData(null, null, null); + + Map regionStatMap = new LinkedHashMap(); + for (AvgUpdateBo bo : avgUpdateBoList) { + regionStatMap.put(bo.getCity(), bo); + } + + List serverAreas = ServerAreaData.getServerAreaList(); + Collections.sort(serverAreas, new Comparator() { + @Override + public int compare(ServerArea o1, ServerArea o2) { + return ((Integer)o1.getCityGrade()).compareTo(o2.getCityGrade()); + } + }); + + for (ServerArea serverArea : serverAreas) { + String w = String.valueOf(DataUtil.hanyuJianpin(serverArea.getDisplay()).toCharArray()[0]).toUpperCase(); + if (HOT_CITIES.contains(serverArea.getDisplay())) { + w = "HOT"; + } + + AvgUpdateBo bo = regionStatMap.get(serverArea.getDisplay()); + if(bo == null) { + bo = new AvgUpdateBo(); + bo.setCity(serverArea.getDisplay()); + } + if (avgUpdateBoMap.containsKey(w)) { + List list = avgUpdateBoMap.get(w); + list.add(bo); + avgUpdateBoMap.put(w, list); + } else { + List list = new ArrayList(); + list.add(bo); + avgUpdateBoMap.put(w, list); + } + } + + model.setAvgUpdateBoMap(avgUpdateBoMap); + return model; + } + + public Object reComputeAction(@Param(name = "data") String data, HttpServletRequest request) { + + JsonModel model = new JsonModel(); + Map json = new HashMap(); + model.setJsonModel(json); + JSONObject jsonObject = JSONObject.fromObject(data); + String calcRange = null; + String _startDate = null; + String _endDate = null; + if(jsonObject.containsKey("calcRange")) { + calcRange = jsonObject.getString("calcRange"); + } + if(jsonObject.containsKey("startDate")) { + _startDate = jsonObject.getString("startDate"); + } + if(jsonObject.containsKey("endDate")) { + _endDate = jsonObject.getString("endDate"); + } + String realName = (String) request.getSession().getAttribute("realName"); + String ip = AnalyticsUtil.getIpAddress(request); + String remark = MessageFormat.format("userName:{0},ip:{1}", new String[] { realName, ip }); + + JSONArray commands = jsonObject.getJSONArray("commands"); + + Date startDate = null; + Date endDate = null; + + List cmds = new ArrayList(); + + if(StringUtils.isNotBlank(calcRange)) { + Date currentDate = new Date(); + endDate = new Date(); + if("week".equals(calcRange)) { + startDate = DateUtil.getBeforeDay(currentDate, 7); + }else if("month".equals(calcRange)) { + startDate = DateUtil.getBeforeDay(currentDate, 30); + }else if("quarter".equals(calcRange)) { + startDate = DateUtil.getBeforeDay(currentDate, 30 * 3); + }else if("year".equals(calcRange)) { + startDate = DateUtil.getBeforeDay(currentDate, 365); + }else if("all".equals(calcRange)) { +// for (int i = 0, len = commands.size(); i < len; i++) { +// JSONObject command = (JSONObject) commands.get(i); +// cmds.add(commandToCalcCommand(command, null, remark)); +// } + // startDate取createYear或buildYear最小值 + JSONObject command = (JSONObject) commands.get(0); + District district = districtService.findByName(command.getString("city"), command.getString("region"), command.getString("name"), "district"); + Integer createYear = null; + if (StringUtils.isNotBlank(district.getCreateYear())) { + createYear = Integer.parseInt(district.getCreateYear().substring(0, 4)); + } + if (StringUtils.isNotBlank(district.getFinishBuildingDate())) { + Integer finishYear = Integer.parseInt(district.getFinishBuildingDate().substring(0, 4)); + if ((createYear != null && createYear > finishYear) || createYear == null) { + createYear = finishYear; + } + } + if (createYear == null) { + // 重算一年 + createYear = Integer.valueOf(DateUtil.formatByPattern(DateUtils.addYears(new Date(), -1), "yyyy")); + } else if (Integer.valueOf(DateUtil.formatByPattern(new Date(), "yyyy")) - createYear > 2) { + // 对于大于两年取两年 + createYear = Integer.valueOf(DateUtil.formatByPattern(DateUtils.addYears(new Date(), -2), "yyyy")); + } + startDate = DateUtil.parseDate(String.valueOf(createYear), "yyyy"); + } + }else if (StringUtils.isNotBlank(_startDate) || StringUtils.isNotBlank(_endDate)) { + if (StringUtils.isNotBlank(_startDate)) { + startDate = DateUtil.parseDate(_startDate, "yyyyMMdd"); + } else { + startDate = DateUtil.parseDate("20070101", "yyyyMMdd"); + } + if (StringUtils.isNotBlank(_endDate)) { + endDate = DateUtil.parseDate(_endDate, "yyyyMMdd"); + } else { + endDate = new Date(); + } + }else { + for (int i = 0, len = commands.size(); i < len; i++) { + JSONObject command = (JSONObject) commands.get(i); + cmds.add(commandToCalcCommand(command, null, remark)); + } + } + + if(startDate != null && endDate != null) { + List months = DateUtil.getLastDayBetweenDates(startDate, endDate); + if (months.isEmpty()) { + json.put("msg", "你选择的日期不包含周末,请重新选择"); + return model; + } + for (Date month : months) { + for (int i = 0, len = commands.size(); i < len; i++) { + JSONObject command = (JSONObject) commands.get(i); + CalcCommand cmd = commandToCalcCommand(command, month, remark); + if (cmd != null) { + cmds.add(cmd); + } + + } + } + } + + calcCommandService.save(cmds); + json.put("msg", "任务保存成功,共保存" + cmds.size() + "条任务"); + return model; + } + + private CalcCommand commandToCalcCommand(JSONObject command, Date weekend, String remark) { + CalcCommand cmd = new CalcCommand(); + cmd.setCity(command.getString("city")); + if (command.containsKey("region")) { + cmd.setRegion(command.getString("region")); + } else { + cmd.setRegion(null); + } + if (command.containsKey("block")) { + cmd.setBlock(command.getString("block")); + } else { + cmd.setBlock(null); + } + if (command.containsKey("name")) { + cmd.setName(command.getString("name")); + } else { + cmd.setName(null); + } + if (command.containsKey("estateType")) { + cmd.setEstateType(command.getString("estateType")); + } else { + cmd.setEstateType(null); + } + if (weekend == null) { + cmd.setCalcType(1); + } else { + if (command.containsKey("startDate") && StringUtils.isNotBlank(command.getString("startDate"))) { + Date startDate = DateUtil.parseDate(command.getString("startDate"), "yyyy-MM-dd");// 均价开始时间 + if (weekend.before(startDate)) { + return null; + } + } + cmd.setCalcType(0); + } + cmd.setStatus(0); + cmd.setPriority(2); + cmd.setCalcDate(weekend); + cmd.setRemark(remark); + cmd.setCategory("square_rent"); + cmd.setIp(IPS.get(RandomUtil.nextInt(IPS.size()))); + cmd.setCreationDate(new Date()); + return cmd; + } + + public Object deleteAction(AvgPriceUpdateModel model) { + JsonModel ret = new JsonModel(); + if(model.getId() != null) { + regionStatService.deleteById(model.getId()); + } + return ret; + } + + public Object loadAvgPriceDataAction(AvgPriceUpdateModel model) { + JsonModel json = new JsonModel(); + json.setJsonModel(regionStatService.findAvgPriceData(model.getCityName(), model.getRegion(), model.getBlock())); + return json; + } + + public Object loadAllAvgPriceAction(AvgPriceUpdateModel model) { + JsonModel json = new JsonModel(); + Pager pager = model.getPager(); + if (pager == null) { + pager = model.getPager(15); + } + Map data = new HashMap(); + data.put("data", + regionStatService.findAllAvgPriceData(model.getCityName(), model.getRegion(), model.getBlock(), model.getPager(), false)); + data.put("pager", pager); + json.setJsonModel(data); + return json; + } + + public Object updateAvgPriceAction(AvgPriceUpdateModel model) { + JsonModel jsonModel = new JsonModel(); + RegionStat regionStat = regionStatService.findById(model.getId()); + if (regionStat != null) { + regionStat.setAvgPrice(model.getAvgPrice()); + regionStatService.save(regionStat); + } + return jsonModel; + } + + + public Object addAvgPriceAction(AvgPriceUpdateModel model) { + JsonModel jsonModel = new JsonModel(); + Map resMap = new HashMap(); + if(model.getAvgPrice() <= 0) { + resMap.put("msg", "价格错误!"); + jsonModel.setJsonModel(resMap); + return jsonModel; + } + + if(model.getWeekend() == null || model.getWeekend().getDay() > 0) { + resMap.put("msg", "日期错误!"); + jsonModel.setJsonModel(resMap); + return jsonModel; + } + + String city = null; + String region = null; + String block = null; + String cat = null; + if(StringUtils.isNotBlank(model.getCityDisplay()) && StringUtils.isNotBlank(model.getRegion()) && StringUtils.isNotBlank(model.getBlock())) { + city = model.getCityDisplay(); + region = model.getRegion(); + block = model.getBlock(); + cat = "板块"; + }else if(StringUtils.isNotBlank(model.getCityDisplay()) && StringUtils.isNotBlank(model.getRegion()) && StringUtils.isBlank(model.getBlock())) { + city = model.getCityDisplay(); + region = model.getRegion(); + cat = "区域"; + }else if(StringUtils.isNotBlank(model.getCityDisplay()) && StringUtils.isBlank(model.getRegion()) && StringUtils.isBlank(model.getBlock())) { + city = model.getCityDisplay(); + cat = "城市"; + } + + if(city == null || region == null || block == null) { + resMap.put("msg", "城市区域板块错误!"); + jsonModel.setJsonModel(resMap); + return jsonModel; + } + + RegionStat regionStat = regionStatService.findRegionStat(city, region, block, model.getWeekend()); + if (regionStat != null) { + resMap.put("msg", "均价数据已存在!"); + jsonModel.setJsonModel(resMap); + return jsonModel; + } + + RegionStat entity = new RegionStat(); + entity.setCity(city); + entity.setRegion(region); + entity.setBlock(block); + entity.setWeekend(model.getWeekend()); + entity.setAvgPrice(model.getAvgPrice()); + entity.setCalcValue(model.getAvgPrice()); + entity.setCoverage(0); + entity.setCredit(0.6); + entity.setCat(cat); + entity.setWeekendMarkup(0); + regionStatService.save(entity); + return jsonModel; + } + + public Object districtListAction(AvgPriceUpdateModel model) { + Pager pager = model.getPager(15); + String sort = model.getSort(); + if (StringUtils.isNotBlank(sort)) { + String[] sortArr = sort.split("_"); + if (sortArr.length == 2) { + model.setAvgUpdateBos(districtStatService.findAvgPriceData(model.getCityDisplay(), model.getRegion(), + model.getBlock(), model.getName(), model.getMinCredit(), model.getMaxCredit(), model.getValueType(), + pager,sortArr[0], sortArr[1])); + } + } else { + model.setAvgUpdateBos(districtStatService.findAvgPriceData(model.getCityDisplay(), model.getRegion(), + model.getBlock(), model.getName(), model.getMinCredit(), model.getMaxCredit(), model.getValueType(), pager, + "","")); + } + return model; + } + + public Object loadAllDistrictRentPriceAction(RentPriceUpdateModel model) { + JsonModel json = new JsonModel(); + Map data = new HashMap(); + DistrictKey key = new DistrictKey(model.getCityName(), model.getRegion(), model.getName()); + List bos = sqmetreRentService.findAllAvgPriceByKeys(key, "district"); + data.put("data", bos); + json.setJsonModel(data); + return json; + } + + /**a + * 加载某个小区的房源信息 + * + * @param model + * @return + */ + public Object loadHouseInfoAction(AvgPriceUpdateModel model) { + JsonModel json = new JsonModel(); + Map data = new HashMap(); + District district = this.districtService.findDistrict(new DistrictKey(model.getCityName(), model.getRegion(), model.getName()), false, new String[]{"city", "region", "name", "alias"}); + List districtAlias = null; + if(district != null && district.getAlias() != null) { + districtAlias = district.getAlias(); + } + + List regionAlias = RegionData.getRegionAlias(model.getCityName(), model.getRegion()); + List sells = seawaterService.findSeawatersFromEs("rent", model.getCityName(), model.getRegion(), model.getName(), districtAlias, regionAlias, null,null,null,null,"p_date",false,0,1000,null,"latest_seawater"); + data.put("data", sells); + json.setJsonModel(data); + return json; + + } + + + private long findSeawatersCount(String city, String region, String name, Date startDate, Date endDate) { + District district = this.districtService.findDistrict(new DistrictKey(city, region, name), false, new String[]{"city", "region", "name", "alias"}); + List districtAlias = null; + if(district != null && district.getAlias() != null) { + districtAlias = district.getAlias(); + } + List regionAlias = RegionData.getRegionAlias(city, region); + Integer sd = null; + Integer ed = null; + if(startDate != null) { + sd = Integer.parseInt(DateUtil.formatToTightYYYYMMDD(startDate)); + } + + if(endDate != null) { + ed = Integer.parseInt(DateUtil.formatToTightYYYYMMDD(endDate)); + } + + return seawaterService.findSeawatersCountFromEs("rent", city, region, name, districtAlias, regionAlias, sd, ed, null, null,"seawater"); + } + + private DBObject buildQueryDBObject(District district, Date startDate, Date endDate, boolean isCaseRegion, boolean isUseRegionAlias, boolean isUseAlias) { + Set namesList = new LinkedHashSet(); + namesList.add(district.getName()); + + if (district != null && district.getAlias() != null) { + namesList.addAll(district.getAlias()); + } + + Set regionsList = new LinkedHashSet(); + regionsList.add(district.getRegion()); + //只有进行区域区分,才可以使用区域别名 + if (isCaseRegion && isUseRegionAlias) { + List regionAlias = RegionData.getRegionAlias(district.getCity(), district.getRegion()); + if (regionAlias != null) { + for (String p : regionAlias) { + if (StringUtils.isNotBlank(p)) { + regionsList.add(p); + } + } + } + } + + BooleanQuery srQuery = new BooleanQuery(); + if (isCaseRegion) { + BooleanQuery regionQuery = new BooleanQuery(); + for (String region : regionsList) { + regionQuery.add(new TermQuery(new Term("region", region)), BooleanClause.Occur.SHOULD); + } + srQuery.add(regionQuery, BooleanClause.Occur.MUST); + } + + BooleanQuery nameQuery = new BooleanQuery(); + for (String name : namesList) { + name = name.trim(); + if (StringUtils.isNotBlank(name) && name.length() < 20) { + nameQuery.add(new TermQuery(new Term("district_name", ClientUtils.escapeQueryChars(name))), BooleanClause.Occur.SHOULD); + } + } + + if (StringUtils.isBlank(nameQuery.toString())) { + return null; + } + srQuery.add(nameQuery, BooleanClause.Occur.MUST); + + DBObject q = new BasicDBObject(); + q.put("cat", "rent"); + q.put("city", district.getCity()); + q.put("$sr", new BasicDBObject("sr.query", srQuery.toString())); + if (startDate != null && endDate != null) { + q.put("p_date", new BasicDBObject("$gt", Integer.parseInt(DateUtil.formatToTightYYYYMMDD(startDate))) + .append("$lt", Integer.parseInt(DateUtil.formatToTightYYYYMMDD(endDate)))); + } else if (startDate != null && endDate == null) { + q.put("p_date", new BasicDBObject("$gt", Integer.parseInt(DateUtil.formatToTightYYYYMMDD(startDate)))); + } else if (startDate == null && endDate != null) { + q.put("p_date", new BasicDBObject("$lt", Integer.parseInt(DateUtil.formatToTightYYYYMMDD(endDate)))); + } + + return q; + } + + public Object loadAllAvgPriceForChartAction(AvgPriceUpdateModel model) { + JsonModel json = new JsonModel(); + Map data = new HashMap(); + List bos = regionStatService.findAllAvgPriceData(model.getCityName(), model.getRegion(), model.getBlock(), + null, true); + data.put("data", bos); + json.setJsonModel(data); + return json; + + } + + public Object detailAction(AvgPriceUpdateModel model) { + return model; + } + + public Object districtDetailAction(RentPriceUpdateModel model) { + District district = null; + if (StringUtils.isNotBlank(model.getId())) { + district = districtService.findById(model.getId()); + } else { + district = districtService.findDistrict(new DistrictKey(model.getCityDisplay(), model.getRegion(), model.getName()), + "district"); + } + + + if (district == null) { + return null; + } + + if (district.getEstateType2() != null && district.getEstateType2().indexOf("别墅") > -1) { + district.setEstateType2("别墅"); + } else { + district.setEstateType2("普通住宅"); + } + + model.setId(district.getId()); + Date thisMonth = DateUtil.getFirstDayOfMonth(new Date()); + Date lastMonth = DateUtil.getFirstDayOfLastMonth(DateUtil.getFirstDayOfLastMonth(new Date())); + Date thisWeekend = DateUtil.getThisSunday(new Date()); + + DistrictKey districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName()); + + model.setCalcDistrictStat(this.calcDistrictStatDao.findCalcDistrictStat(district.getCity(), district.getRegion(), + district.getName(), district.getEstateType2(), thisWeekend)); + + List guidingPrices = guidingPriceService.findByDistrictKey(districtKey); + if(guidingPrices!=null && guidingPrices.size()>0) { + List t = new ArrayList(); + t.add(guidingPrices.get(guidingPrices.size()-1)); + model.setGuidingPrices(t); + }else { + model.setGuidingPrices(new ArrayList()); + } + Pager pager = new Pager(1); + pager.setCurrentPage(1); + model.setDealPriceCount(dealPriceService.findDealPriceCountByDistrictKey(districtKey)); + model.setAverageStatistics(averageStatisticsDao.findDistrictAverageStatistics(district.getCity(), district.getRegion(), + district.getName(), Integer.parseInt(DateUtil.formatByPattern(lastMonth, "yyyyMM")), + Integer.parseInt(DateUtil.formatByPattern(thisMonth, "yyyyMM")))); + model.setAvgBases(avgBaseDao.findAll(district.getCity(), district.getRegion(),district.getName(),0,null,null,null)); + Map distribution = new HashMap(); + /*distribution.put("QiTian", findSeawatersCount(district.getCity(), district.getRegion(), district.getName(), DateUtil.add(new Date(), Calendar.DATE, -7), null)); + distribution.put("YiYue", findSeawatersCount(district.getCity(), district.getRegion(), district.getName(), DateUtil.add(new Date(), Calendar.MONTH, -1), null)); + distribution.put("SanYue", findSeawatersCount(district.getCity(), district.getRegion(), district.getName(), DateUtil.add(new Date(), Calendar.MONTH, -3), null)); + distribution.put("BanNian", findSeawatersCount(district.getCity(), district.getRegion(), district.getName(), DateUtil.add(new Date(), Calendar.MONTH, -6), null)); + distribution.put("YiNian", findSeawatersCount(district.getCity(), district.getRegion(), district.getName(), DateUtil.add(new Date(), Calendar.YEAR, -1), null)); + distribution.put("All", findSeawatersCount(district.getCity(), district.getRegion(), district.getName(), null, null));*/ + List calcConfigs = calcConfigService.findDateByQuery(districtKey.getCity(), districtKey.getRegion(), + districtKey.getName()); + if (!calcConfigs.isEmpty()) { + model.setCalcConfig(calcConfigs.get(0)); + } + model.setDistrict(district); + model.setDistribution(distribution); + + Date week = DateUtil.truncateDay(DateUtil.getLastDayOfMonth(new Date(), -1)); + SqmetreRent sqmetreRent = sqmetreRentService.findSqmetreRent(districtKey.getCity(), districtKey.getRegion(), districtKey.getName(), "district", week); + model.setSqmetreRent(sqmetreRent); + + return model; + } + + public Object addGuidingPriceAction(@Param(name = "guidingDate") String guidingDate, + @Param(name = "guidingPrice") int guidingPrice, @Param(name = "id") String id,HttpServletRequest request) { + HttpSession session=request.getSession(); + District district = districtService.findById(id); + GuidingPrice guiding = new GuidingPrice(); + guiding.setGuidingPerson(session.getAttribute("realName").toString()); + guiding.setCat("district"); + guiding.setCreationDate(new Date()); + guiding.setGuidingValue(guidingPrice); + guiding.setGuidingDate(DateUtil.parseDate(guidingDate, "yyyyMMdd")); + guiding.setCity(district.getCity()); + guiding.setRegion(district.getRegion()); + guiding.setName(district.getName()); + guiding.setEstateType(district.getEstateType2().indexOf("别墅") > -1 ? "别墅" : "普通住宅"); + guidingPriceService.save(guiding); + + JsonModel model = new JsonModel(); + return model; + } + public Object guidingListAction(GuidingAvgPriceUpdateModel model) { + District district = districtService.findById(model.getId()); + model.setDistrict(district); + DistrictKey districtKey = new DistrictKey(district.getCity(), district.getRegion(), district.getName()); + List guidingPrices = guidingPriceService.findByDistrictKey(districtKey); + model.setGuidingPrices(guidingPrices); + return model; + } + public Object guidingPriceAction(GuidingAvgPriceUpdateModel model) { + District district = districtService.findById(model.getId()); + if(StringUtils.isNotBlank(model.getGid())){ + GuidingPrice gp = guidingPriceService.findById(model.getGid()); + String gd = DateUtil.formatToTightYYYYMMDD(gp.getGuidingDate()); + model.setGuidingDate(gd); + model.setGuidingPrice(gp.getGuidingValue()); + } + model.setDistrict(district); + return model; + } + + public Object deleteGuidingPriceNewAction(GuidingAvgPriceUpdateModel model) { + JsonModel json = new JsonModel(); + guidingPriceService.deleteById(model.getGid()); + return json; + } + + public Object saveGuidingPriceAction(HttpServletRequest request,GuidingAvgPriceUpdateModel model) { + JsonModel json = new JsonModel(); + HttpSession session=request.getSession(); + District district = districtService.findById(model.getId()); + GuidingPrice guiding = new GuidingPrice(); + if(StringUtils.isNotBlank(model.getGid())){ + guiding = guidingPriceService.findById(model.getGid()); + } + guiding.setGuidingPerson(session.getAttribute("realName").toString()); + guiding.setCat("district"); + guiding.setCreationDate(new Date()); + guiding.setGuidingValue(model.getGuidingPrice()); + guiding.setGuidingDate(DateUtil.parseDate(model.getGuidingDate(), "yyyyMMdd")); + guiding.setCity(district.getCity()); + guiding.setRegion(district.getRegion()); + guiding.setName(district.getName()); + guiding.setEstateType(district.getEstateType2().indexOf("别墅") > -1 ? "别墅" : "普通住宅"); + guidingPriceService.save(guiding); + json.setJsonModel(model); + return json; + } + + public Object updateCalcConfigAction(@Param(name = "maxPrice") Integer maxPrice, @Param(name = "minPrice") Integer minPrice, + @Param(name = "id") String id, @Param(name = "configId") String configId) { + CalcConfig calcConfig; + if (StringUtils.isNotBlank(configId) && ObjectId.isValid(configId)) { + calcConfig = calcConfigService.findById(configId); + if (calcConfig.getLogicalMaxValue() != null && calcConfig.getLogicalMaxValue().equals(maxPrice)) { + calcConfig.getMarkMap().put("logical_max_value", 1); + } + if (calcConfig.getLogicalMinValue() != null && calcConfig.getLogicalMinValue().equals(minPrice)) { + calcConfig.getMarkMap().put("logical_min_value", 1); + } + } else { + District district = districtService.findById(id); + calcConfig = new CalcConfig(); + calcConfig.setCategory("district"); + calcConfig.setCreationDate(new Date()); + calcConfig.setCity(district.getCity()); + calcConfig.setRegion(district.getRegion()); + calcConfig.setName(district.getName()); + calcConfig.setEstateType(district.getEstateType2()); + } + calcConfig.setLogicalMaxValue(maxPrice); + calcConfig.setLogicalMinValue(minPrice); + calcConfigService.save(calcConfig); + JsonModel model = new JsonModel(); + return model; + } + + public Object updateDistrictCalcConfigAction(AvgPriceUpdateModel model) { + JsonModel ret = new JsonModel(); + + + return ret; + } + + public Object taskListAction(AvgPriceUpdateModel model) { + Pager pager = model.getPager(15); + pager.setTotalRows(calcCommandService.findAllCommondCount(model.getStype(), model.getCityDisplay(), model.getKeyword(), + model.getStatus(), model.getStartDate(), model.getEndDate())); + model.setCalcCommands(calcCommandService.findCommandByquery(model.getStype(), model.getCityDisplay(), model.getKeyword(), + model.getStatus(), model.getStartDate(), model.getEndDate(), pager.getStartRow(), pager.getPageSize())); + return model; + } + + public Object deleteGuidingPriceAction(@Param(name = "id") String id) { + JsonModel model = new JsonModel(); + guidingPriceService.deleteById(id); + return model; + } + + public RegionStatService getRegionStatService() { + return regionStatService; + } + + public void setRegionStatService(RegionStatService regionStatService) { + this.regionStatService = regionStatService; + } + + public CalcCommandService getCalcCommandService() { + return calcCommandService; + } + + public void setCalcCommandService(CalcCommandService calcCommandService) { + this.calcCommandService = calcCommandService; + } + + public DistrictStatService getDistrictStatService() { + return districtStatService; + } + + public void setDistrictStatService(DistrictStatService districtStatService) { + this.districtStatService = districtStatService; + } + + public void setDistrictService(DistrictService districtService) { + this.districtService = districtService; + } + + public SqmetreRentService getSqmetreRentService() { + return sqmetreRentService; + } + + public void setSqmetreRentService(SqmetreRentService sqmetreRentService) { + this.sqmetreRentService = sqmetreRentService; + } + + public void setAverageStatisticsDao(AverageStatisticsDao averageStatisticsDao) { + this.averageStatisticsDao = averageStatisticsDao; + } + + public void setDealPriceService(DealPriceService dealPriceService) { + this.dealPriceService = dealPriceService; + } + + public void setGuidingPriceService(GuidingPriceService guidingPriceService) { + this.guidingPriceService = guidingPriceService; + } + + public void setCalcConfigService(CalcConfigService calcConfigService) { + this.calcConfigService = calcConfigService; + } + + public void setCalcDistrictStatDao(CalcDistrictStatDao calcDistrictStatDao) { + this.calcDistrictStatDao = calcDistrictStatDao; + } + + public void setAveragerQualityReportService(AveragerQualityReportService averagerQualityReportService) { + this.averagerQualityReportService = averagerQualityReportService; + } + + public void setSampleQualityReportService(SampleQualityReportService sampleQualityReportService) { + this.sampleQualityReportService = sampleQualityReportService; + } + + public ComparePriceDao getComparePriceDao() { + return comparePriceDao; + } + + public void setComparePriceDao(ComparePriceDao comparePriceDao) { + this.comparePriceDao = comparePriceDao; + } + + public ComparePriceCityDao getComparePriceCityDao() { + return comparePriceCityDao; + } + + public void setComparePriceCityDao(ComparePriceCityDao comparePriceCityDao) { + this.comparePriceCityDao = comparePriceCityDao; + } + + public void setSeawaterService(SeawaterService seawaterService) { + this.seawaterService = seawaterService; + } + + public void setAvgBaseDao(AvgBaseDao avgBaseDao) { + this.avgBaseDao = avgBaseDao; + } +} diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/SqMetreRentController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/SqMetreRentController.java index 4c369289e..8e2662190 100644 --- a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/SqMetreRentController.java +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/SqMetreRentController.java @@ -102,7 +102,7 @@ public class SqMetreRentController { JSONObject row = new JSONObject(); row.put("x",DateUtil.add(rent.getWeekend(), 1).getTime()); row.put("y",rent.getAvgPrice()); - row.put("sampleEnum",rent.getSampleEnum()); + row.put("sampleEnum",rent.getValueType()); datas.add(row); } @@ -136,7 +136,7 @@ public class SqMetreRentController { Date statDate = DateUtil.parseFormatDate(model.getStatDate()); SqmetreRent stat = sqmetreRentService.findSqmetreRent(model.getCityDisplay(), model.getRegion(), model.getDistrictName(), model.getCat(), statDate); if(null != stat){ - stat.setAvgPrice(model.getValue()); + stat.setAvgPrice(model.getValue().intValue()); stat.setModificationDate(new Date()); sqmetreRentService.updateSqmetreRent(stat); } @@ -204,7 +204,7 @@ public class SqMetreRentController { rent.setDistrictName(model.getDistrictName()); rent.setWeekend(statDate); rent.setCat(model.getCat()); - rent.setAvgPrice(model.getValue()); + rent.setAvgPrice(model.getValue().intValue()); rent.setCreationDate(new Date()); rent.setModificationDate(new Date()); sqmetreRentService.save(rent); diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/RentPriceUpdateModel.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/RentPriceUpdateModel.java new file mode 100644 index 000000000..5245c5e0b --- /dev/null +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/RentPriceUpdateModel.java @@ -0,0 +1,341 @@ +package com.fangjia.bkoff.model; + +import com.fangjia.dal.mongo.model.*; +import com.fangjia.dal.mongo.model.bkoff.CalcCommand; +import com.fangjia.dal.mongo.model.bkoff.CalcConfig; +import com.fangjia.dal.mongo.model.bkoff.GuidingPrice; +import com.fangjia.dal.seaweed.model.District; +import com.fangjia.service.bo.AvgUpdateBo; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +public class RentPriceUpdateModel extends BaseModel { + + /** + * + */ + private static final long serialVersionUID = 1L; + + private List avgUpdateBos; + private Map> avgUpdateBoMap; + private String region; + private String block; + private String cityDisplay; + private String id; + private int avgPrice; + private Double minCredit; + private Double maxCredit; + private Integer valueType; + private String name; + private District district; + private List averageStatistics; + private List avgBases; + private CalcDistrictStat calcDistrictStat; + private DistrictStat districtStat; + private SqmetreRent sqmetreRent; + private long dealPriceCount; + private List guidingPrices; + private Map distribution; + private CalcConfig calcConfig; + private String stype; + private String keyword; + private Integer status; + private List calcCommands; + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date startDate; + @DateTimeFormat(pattern = "yyyy-MM-dd") + private Date endDate; + private String estateType; + private String sort; + private Date weekend; + private int sdateStart; + private int sdateEnd; + private String series; + private String vts; + private String category; + + public List getAvgUpdateBos() { + return avgUpdateBos; + } + + public void setAvgUpdateBos(List avgUpdateBos) { + this.avgUpdateBos = avgUpdateBos; + } + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getBlock() { + return block; + } + + public void setBlock(String block) { + this.block = block; + } + + public String getCityDisplay() { + return cityDisplay; + } + + public void setCityDisplay(String cityDisplay) { + this.cityDisplay = cityDisplay; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public int getAvgPrice() { + return avgPrice; + } + + public void setAvgPrice(int avgPrice) { + this.avgPrice = avgPrice; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public District getDistrict() { + return district; + } + + public void setDistrict(District district) { + this.district = district; + } + + public List getAverageStatistics() { + return averageStatistics; + } + + public void setAverageStatistics(List averageStatistics) { + this.averageStatistics = averageStatistics; + } + + public long getDealPriceCount() { + return dealPriceCount; + } + + public void setDealPriceCount(long dealPriceCount) { + this.dealPriceCount = dealPriceCount; + } + + public List getGuidingPrices() { + return guidingPrices; + } + + public void setGuidingPrices(List guidingPrices) { + this.guidingPrices = guidingPrices; + } + + public Map getDistribution() { + return distribution; + } + + public void setDistribution(Map distribution) { + this.distribution = distribution; + } + + public CalcConfig getCalcConfig() { + return calcConfig; + } + + public void setCalcConfig(CalcConfig calcConfig) { + this.calcConfig = calcConfig; + } + + public String getStype() { + return stype; + } + + public void setStype(String stype) { + this.stype = stype; + } + + public String getKeyword() { + return keyword; + } + + public void setKeyword(String keyword) { + this.keyword = keyword; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getStartDate() { + return startDate; + } + + public void setStartDate(Date startDate) { + this.startDate = startDate; + } + + public Date getEndDate() { + return endDate; + } + + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + + public List getCalcCommands() { + return calcCommands; + } + + public void setCalcCommands(List calcCommands) { + this.calcCommands = calcCommands; + } + + public String getEstateType() { + return estateType; + } + + public void setEstateType(String estateType) { + this.estateType = estateType; + } + + public Map> getAvgUpdateBoMap() { + return avgUpdateBoMap; + } + + public void setAvgUpdateBoMap(Map> avgUpdateBoMap) { + this.avgUpdateBoMap = avgUpdateBoMap; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public Double getMinCredit() { + return minCredit; + } + + public void setMinCredit(Double minCredit) { + this.minCredit = minCredit; + } + + public Double getMaxCredit() { + return maxCredit; + } + + public void setMaxCredit(Double maxCredit) { + this.maxCredit = maxCredit; + } + + public Integer getValueType() { + return valueType; + } + + public void setValueType(Integer valueType) { + this.valueType = valueType; + } + + public CalcDistrictStat getCalcDistrictStat() { + return calcDistrictStat; + } + + public void setCalcDistrictStat(CalcDistrictStat calcDistrictStat) { + this.calcDistrictStat = calcDistrictStat; + } + + public DistrictStat getDistrictStat() { + return districtStat; + } + + public void setDistrictStat(DistrictStat districtStat) { + this.districtStat = districtStat; + } + + public Date getWeekend() { + return weekend; + } + + public void setWeekend(Date weekend) { + this.weekend = weekend; + } + + + public int getSdateStart() { + return sdateStart; + } + + public void setSdateStart(int sdateStart) { + this.sdateStart = sdateStart; + } + + public int getSdateEnd() { + return sdateEnd; + } + + public void setSdateEnd(int sdateEnd) { + this.sdateEnd = sdateEnd; + } + + public String getSeries() { + return series; + } + + public void setSeries(String series) { + this.series = series; + } + + public String getVts() { + return vts; + } + + public void setVts(String vts) { + this.vts = vts; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public List getAvgBases() { + return avgBases; + } + + public void setAvgBases(List avgBases) { + this.avgBases = avgBases; + } + + + public SqmetreRent getSqmetreRent() { + return sqmetreRent; + } + + public void setSqmetreRent(SqmetreRent sqmetreRent) { + this.sqmetreRent = sqmetreRent; + } +} diff --git a/projects/fangjia-bkoff/src/main/webapp/district/list.ftl b/projects/fangjia-bkoff/src/main/webapp/district/list.ftl index a3ff35d00..60e42be0a 100644 --- a/projects/fangjia-bkoff/src/main/webapp/district/list.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/district/list.ftl @@ -686,6 +686,7 @@ 閰嶅 鍧囦环 + 绉熼噾 鏍锋湰 鏁版嵁瀵规瘮 澶嶅埗 diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/detail.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/detail.ftl new file mode 100644 index 000000000..2757fd165 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/detail.ftl @@ -0,0 +1,470 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + ${cityDisplay}<#if region?? && region!=''>-${region}<#if block?? && block!=''>-${block}</#if></#if> 鍩庡競绉熼噾璇︾粏淇℃伅 + + + + + + <#include "/common_js.ftl" /> + + + + + + + + + +<#include "/layout/header.ftl" /> +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
鏌ヨ鏉′欢绉熼噾鏇存柊绉熼噾鏂板
+ + + <@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" name="cityDisplay"/> + + 鏃ユ湡锛� + + + + 鏂板鏃ユ湡锛� + + +
+ + + + + 瑕嗙洊鐜�: + + + + 瑕嗙洊鐜�: + + +
+ + + + + 鍙俊搴�: + + + + 鍙俊搴�: + + +
+ + / + + + + + + + +
+ 鏇存柊绉熼噾 + 鍒犻櫎 + + 鏂板浠锋牸 +
+
+ + + + + + +
+
+
+ + + + + + + + + + + + + +
鏃ユ湡绉熼噾璁$畻绉熼噾鍛ㄥ悓姣�鍙俊搴�瑕嗙洊鐜�
+
+
+
+ + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtDetail.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtDetail.ftl new file mode 100644 index 000000000..ecab150c2 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtDetail.ftl @@ -0,0 +1,946 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + <#if district??>${district.name!}</#if> 绉熼噾璇︾粏淇℃伅 + + + + + <#include "/common_js.ftl" /> + + + + + + + + + + +<#include "/layout/header.ftl" /> +
+

+ + ${district.city!}- + ${district.region!}- + ${district.name!}(${district.estateType2!}) + 绉熼噾璇︾粏淇℃伅 + 閲嶇畻绉熼噾 +

+
+

+ <#if sqmetreRent??> + 鏈�鏂�(${t_util.formatDate(sqmetreRent.weekend!)}) + 绉熼噾锛�${sqmetreRent.avgPrice!}鍏�/骞崇背  +<#-- 2B绉熼噾锛�${districtStat.avg_price_2b!}鍏�/骞崇背 --> + 璁$畻鏂瑰紡锛� + <#if (sqmetreRent.valueType)??> + <#if sqmetreRent.valueType=='own'> + 鑷韩鏍锋湰 + + <#if sqmetreRent.valueType=='around'> + 鍛ㄨ竟 + + + 鍙俊搴︼細${(sqmetreRent.credit!)?string("#.#######")} + <#if sqmetreRent.markup??> +  鐜瘮涓婃湀锛�<#if sqmetreRent.markup gt 0>鈫�<#elseif sqmetreRent.markup lt 0>鈫�${(sqmetreRent.markup!/100.0)?string("#.##")}% + + <#else> + 鏈湀绉熼噾鏆傛棤 + +

+
+

${district.name!}-浠锋牸璧板娍鍥�

+ +
+ +<#--
--> +<#--

${district.name!}-鎸囧浠�

--> +<#--
--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> + +<#-- <#list guidingPrices as it>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#list guidingPrices as it>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#list guidingPrices as it>--> +<#-- --> +<#--
--> +<#--
--> +<#-- --> +<#-- --> +<#-- --> +<#--
--> +<#--
鏃ユ湡 ${it.guidingDate?string("yyyy-MM-dd")} --> +<#--
浠锋牸${it.guidingValue!}
娣诲姞浜�${it.guidingPerson!}
--> +<#--
--> +<#--
--> +<#--
--> +<#--

${district.name!}-鍙傝�冧环

--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (avgBases??&&avgBases?size>0)>--> +<#-- <#list avgBases as it>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if avgBases?size == 0>--> +<#-- --> +<#-- --> +<#-- --> +<#--
浠锋牸璋冩煡鏃堕棿璋冩煡浜�
--> +<#-- ${it.price}--> +<#-- --> +<#-- ${it.creationDate?string("yyyy-MM-dd")}--> +<#-- --> +<#-- <#if it.userName??>--> +<#-- ${it.userName}--> +<#-- --> +<#--
鏆傛棤鏁版嵁
--> +<#--
--> +<#--
--> +<#-- --> +<#--

${district.name!}-绗笁鏂逛环鏍煎姣�

--> +<#-- --> +<#-- <#list averageStatistics as it>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.xiaozijiaNewPrice)?? || (it.xiaozijiaEsfPrice)??> --> +<#-- --> +<#-- --> +<#-- <#if (it.lianjiaNewPrice)?? || (it.lianjiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.anjukeNewPrice)?? || (it.anjukeEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.zhugezhaofangNewPrice)?? || (it.zhugezhaofangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.beikeNewPrice)?? || (it.beikeEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.fangguguNewPrice)?? || (it.fangguguEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.fangdoudouNewPrice)?? || (it.fangdoudouEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.soufangNewPrice)?? || (it.soufangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.cityhouseNewPrice)?? || (it.cityhouseEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangtanNewPrice)?? || (it.fangtanEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.tuboshiNewPrice)?? || (it.tuboshiEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.centanetNewPrice)?? || (it.centanetEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.leyoujiaNewPrice)?? || (it.leyoujiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.qfangNewPrice)?? || (it.qfangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.sinaNewPrice)?? || (it.sinaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.cricNewPrice)?? || (it.cricEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.ganjiNewPrice)?? || (it.ganjiEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- <#if (it.yungujiaNewPrice)?? || (it.yungujiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.xiaozijiaNewPrice)?? || (it.xiaozijiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.lianjiaNewPrice)?? || (it.lianjiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.anjukeNewPrice)?? || (it.anjukeEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.zhugezhaofangNewPrice)?? || (it.zhugezhaofangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.beikeNewPrice)?? || (it.beikeEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangguguNewPrice)?? || (it.fangguguEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangdoudouNewPrice)?? || (it.fangdoudouEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.soufangNewPrice)?? || (it.soufangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.cityhouseNewPrice)?? || (it.cityhouseEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangtanNewPrice)?? || (it.fangtanEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.tuboshiNewPrice)?? || (it.tuboshiEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.centanetNewPrice)?? || (it.centanetEsfPrice)??> --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.leyoujiaNewPrice)?? || (it.leyoujiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.qfangNewPrice)?? || (it.qfangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.sinaNewPrice)?? || (it.sinaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.cricNewPrice)?? || (it.cricEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.ganjiNewPrice)?? || (it.ganjiEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.yungujiaNewPrice)?? || (it.yungujiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.xiaozijiaNewPrice)?? || (it.xiaozijiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.lianjiaNewPrice)?? || (it.lianjiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.anjukeNewPrice)?? || (it.anjukeEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.zhugezhaofangNewPrice)?? || (it.zhugezhaofangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.beikeNewPrice)?? || (it.beikeEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangguguNewPrice)?? || (it.fangguguEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangdoudouNewPrice)?? || (it.fangdoudouEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.soufangNewPrice)?? || (it.soufangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.cityhouseNewPrice)?? || (it.cityhouseEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.fangtanNewPrice)?? || (it.fangtanEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.tuboshiNewPrice)?? || (it.tuboshiEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.centanetNewPrice)?? || (it.centanetEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.leyoujiaNewPrice)?? || (it.leyoujiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.qfangNewPrice)?? || (it.qfangEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.sinaNewPrice)?? || (it.sinaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.cricNewPrice)?? || (it.cricEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.ganjiNewPrice)?? || (it.ganjiEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if (it.yungujiaNewPrice)?? || (it.yungujiaEsfPrice)??>--> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if averageStatistics?size == 0>--> +<#-- --> +<#-- --> +<#--
鏃ユ湡鎴夸环缃�灏忚祫瀹�閾惧瀹夊眳瀹�璇歌憶璐濆3鎴夸及浼�鎴垮厹鍏�鎼滄埧cityhouse鎴挎帰鍏斿崥澹�涓師鍦颁骇涔愭湁瀹�Q鎴�鏂版氮鍏嬪皵鐟�璧堕泦缃�浜戜及浠�
鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�鏂版埧浜屾墜鎴�
${(t_util.parseDate(it.shortDate?string, 'yyyyMM'))?string("yyyy骞碝M鏈�")}${it.fangjiaPrice!}${it.xiaozijiaNewPrice!}${it.xiaozijiaEsfPrice!}${it.lianjiaNewPrice!}${it.lianjiaEsfPrice!}${it.anjukeNewPrice!}${it.anjukeEsfPrice!}${it.zhugezhaofangNewPrice!}${it.zhugezhaofangEsfPrice!}${it.beikeNewPrice!}${it.beikeEsfPrice!}${it.fangguguNewPrice!}${it.fangguguEsfPrice!}${it.fangdoudouNewPrice!}${it.fangdoudouEsfPrice!}${it.soufangNewPrice!}${it.soufangEsfPrice!}${it.cityhouseNewPrice!}${it.cityhouseEsfPrice!}${it.fangtanNewPrice!}${it.fangtanEsfPrice!}${it.tuboshiNewPrice!}${it.tuboshiEsfPrice!}${it.centanetNewPrice!}${it.centanetEsfPrice!}${it.leyoujiaNewPrice!}${it.leyoujiaEsfPrice!}${it.qfangNewPrice!}${it.qfangEsfPrice!}${it.sinaNewPrice!}${it.sinaEsfPrice!}${it.cricNewPrice!}${it.cricEsfPrice!}${it.ganjiNewPrice!}${it.ganjiEsfPrice!}${it.yungujiaNewPrice!}${it.yungujiaEsfPrice!}
鏆傛棤鏁版嵁
--> +<#-- --> +<#--
--> +<#-- <#if !(calcDistrictStat??)>
鏈湀娌℃湁鍒╃敤绗笁鏂圭殑璇︾粏鏁版嵁锛�
--> +<#--
--> +<#-- <#if calcDistrictStat?? && calcDistrictStat.thirdpartDetails??>--> +<#-- <#macro greet pt> --> +<#-- <#assign ret=0>--> +<#-- <#list calcDistrictStat.thirdpartDetails as detail>--> +<#-- <#if detail['name'] == pt && detail['val']??>--> +<#-- <#assign ret>${detail['val']!}--> +<#-- --> +<#-- --> +<#-- ${ret}--> +<#-- --> +<#-- --> + +

+ ${district.name!}-鏍锋湰鏁e垪鍥� + 鎴挎簮鏍锋湰鍒楄〃 +<#-- 浜ゆ槗鏁版嵁鍒楄〃(${dealPriceCount!})--> +

+ <#-- + + +
涓冨ぉ涓�涓湀涓変釜鏈�鍗婂勾涓�骞�鍏ㄩ儴
${distribution['QiTian']}${distribution['YiYue']}${distribution['SanYue']}${distribution['BanNian']}${distribution['YiNian']}${distribution['All']}
--> +

${district.name!}-鎴挎簮鏁e垪鍥�

+
+<#--

${district.name!}-鏍锋湰杩囨护瑙勫垯

--> +<#--
--> +<#-- <#if calcConfig??>--> +<#-- --> +<#-- <#else>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if calcConfig??>--> +<#-- --> +<#-- <#else>--> +<#-- --> +<#-- --> +<#-- --> +<#-- <#if calcConfig??>--> +<#-- --> +<#-- <#else>--> +<#-- --> +<#-- --> +<#-- (璇疯缃緝澶у尯闂�)--> +<#--
--> +<#--

--> +<#--
--> +<#-- --> +<#--
--> +<#--


--> +
+ + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtList.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtList.ftl new file mode 100644 index 000000000..b5846cabb --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/districtList.ftl @@ -0,0 +1,344 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + ${cityDisplay}<#if region?? && region!=''>-${region}<#if block?? && block!=''>-${block}</#if></#if> 灏忓尯鍧囦环鎿嶄綔鍒楄〃 + + + + + <#include "/common_js.ftl" /> + + + + + + + + + + +<#include "/layout/header.ftl" /> +<#setting number_format="0.###########"/> +
+ + + + + + + +
鏌ヨ鏉′欢
+
+ <@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" name="cityDisplay"/> + + + + + + + - + + + + + + + + + +
+
+ 鏌ヨ鍒�${pager.totalRows!}鏉¤褰� + + + + + + + + + + + + + + <#if avgUpdateBos??> + <#list avgUpdateBos as it> + + + + + + + + + + + + + + + + + + + +
鍖哄煙灏忓尯鍚�鍒悕鐗╀笟绫诲瀷 + <#if sort?? && sort == 'price_desc'> + 鍧囦环鈫� + <#elseif sort?? && sort == 'price_asc'> + 鍧囦环鈫� + <#else> + 鍧囦环 + + 鏃堕棿 + <#if sort?? && sort == 'credit_desc'>鍙俊搴�鈫� + <#elseif sort?? && sort == 'credit_asc'>鍙俊搴�鈫� + <#else>鍙俊搴� + + 璁$畻绫诲瀷鎿嶄綔
${it.region!}${it.districtName!} + ${t_util.join(it.alias!, ',')} + ${it.estateType!}${it.avgPrice!}${it.weekend!}${it.credit} + <#if it.valueType?? && it.valueType == 1> + 鎸囧浠� + <#elseif it.valueType?? && it.valueType == 2> + 鑷韩鏍锋湰 + <#elseif it.valueType?? && it.valueType == 3> + 绗笁鏂� + <#elseif it.valueType?? && it.valueType == 4> + 浜ゆ槗鏁版嵁 + <#elseif it.valueType?? && it.valueType == 5> + 鍛ㄨ竟妤肩洏 + + + 璋冩煡 + 鏍锋湰 + 璁剧疆 +
+ <@d_pager action = "districtList" currentPage = pager.currentPage controller = "rentPriceUpdate" totalPages = pager.totalPages pagerCount=12 theme="full"/> +
+
+ + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/doCreatTask.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/doCreatTask.ftl new file mode 100644 index 000000000..2cc00dfbe --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/doCreatTask.ftl @@ -0,0 +1,278 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + 鍧囦环鎿嶄綔鍚庡彴 + + + + + + <#include "/common_js.ftl" /> + + + + +<#include "/layout/header.ftl" /> +
+ <#-- + + + + + + + + + + + + + + +
椤�鍊�
鍩庡競
鍖哄煙
鏉垮潡
璧锋鏃堕棿 + + - +
鎿嶄綔 +
+ --> +
+ <#assign seqIndex = 0 /> + + + + + + + + <#list ['HOT', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] as key> + <#if avgUpdateBoMap[key]?? && avgUpdateBoMap[key]?size gt 0> + + + + <#list avgUpdateBoMap[key] as it> + + + + + + + + + + +
+ <#list ['HOT', 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] as key> + ${key}     + +
搴忓彿鍚嶇О鏈�鏂板潎浠�璧峰鏃ユ湡鎿嶄綔
  ${key}
<#assign seqIndex = seqIndex +1 />${seqIndex} +  ${it.city} + ${it.avgPrice!}${it.startDate!} + 璇︾粏淇℃伅 + 鏌ョ湅灏忓尯 + 鏍锋湰鎴挎簮 +
+ + + + +<#-- + +--> + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingList.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingList.ftl new file mode 100644 index 000000000..e12ac9f88 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingList.ftl @@ -0,0 +1,192 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + 鎸囧浠锋暟鎹� + + + + + + +<#include "/common_js.ftl" /> +<#include "/layout/header.ftl" /> +<#setting number_format="0.####"> +
+ +
+
+
+
+ +
+ + + + + + + + + + + +
鍩庡競鍖哄煙灏忓尯鍚�鏃ユ湡娣诲姞浜�娣诲姞浠锋牸鎿嶄綔
+
+ + + <#list guidingPrices! as guid> + + + + + + + + + + + +
${guid.city!''}${guid.region!}${guid.name!}${guid.guidingDate?string("yyyy-MM-dd")}${guid.guidingPerson!}${guid.guidingValue!} + 缂栬緫 + 鍒犻櫎 + +
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingPrice.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingPrice.ftl new file mode 100644 index 000000000..a6a5a6580 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/guidingPrice.ftl @@ -0,0 +1,111 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + 娣诲姞鎸囧浠� + + + + +<#include "/common_js.ftl" /> + <#include "/layout/header.ftl" /> +
+
+
+ + + + + + + + + + + + + + + + + + +
+ 鍩庡競 + + +
+ 鍖哄煙 + + +
+ 灏忓尯鍚� + + +
+ 鏃ユ湡* + +
+ 鎸囧浠锋牸* + +
+ + + + + +
+ +
+ +
+
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listQR.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listQR.ftl new file mode 100644 index 000000000..781677cd0 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listQR.ftl @@ -0,0 +1,125 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + 鍧囦环绯荤粺-${cityDisplay!}浠锋牸璐ㄩ噺璺熻釜 + + + + + <#include "/common_js.ftl" /> + + + + + + + + + + + <#setting number_format="0.###########"/> + <#include "/layout/header.ftl" /> + +
+ + + + + + + +
鏌ヨ鏉′欢
+
+
+ <@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" showCountry="1" name="cityDisplay"/> +
+
+ + +  -  + + +
+ +
+
+ +
+ cur"> + 灏忓尯閲� + + cur"> + 骞冲潎鍙俊搴� + + cur"> + 娴嬭瘯妗堜緥鏁伴噺 + + cur"> + 妗堜緥宸瘮<10%閲� + + cur"> + 妗堜緥宸瘮<20%閲� + + cur"> + 妗堜緥宸瘮<30%閲� + + <#-- + class="cur" style="border: 1px solid #e0e0e0; padding: 8px 10px; margin-top: 10px;cursor:pointer;border-left:none;"> + 鎴挎簮鏍锋湰閲� + + --> +
+ +
+ +
+ + + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listSQR.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listSQR.ftl new file mode 100644 index 000000000..2cd6e67b5 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/listSQR.ftl @@ -0,0 +1,110 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + 鍧囦环绯荤粺-${cityDisplay!}鏍锋湰璐ㄩ噺璺熻釜 + + + + + <#include "/common_js.ftl" /> + + + + + + + + + + + <#setting number_format="0.###########"/> + <#include "/layout/header.ftl" /> + +
+ + + + + + + +
鏌ヨ鏉′欢
+
+
+ <@d_city defaultValue="${cityDisplay!}" callback="changeCity" callbackField="display" showCountry="1" name="cityDisplay"/> +
+
+ + +  -  + + +
+ +
+
+ + + +
+
+ + + + + + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadQRData.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadQRData.ftl new file mode 100644 index 000000000..c706f6731 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadQRData.ftl @@ -0,0 +1,102 @@ +
+ + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadSQRData.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadSQRData.ftl new file mode 100644 index 000000000..12e6095c6 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/loadSQRData.ftl @@ -0,0 +1,49 @@ +
+ + \ No newline at end of file diff --git a/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/taskList.ftl b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/taskList.ftl new file mode 100644 index 000000000..f32d1be97 --- /dev/null +++ b/projects/fangjia-bkoff/src/main/webapp/rentPriceUpdate/taskList.ftl @@ -0,0 +1,160 @@ +<#ftl attributes={"content_type":"text/html; charset=UTF-8"}> +<#compress> + + + + + 鍧囦环鏇存柊 + + + + + <#include "/common_js.ftl" /> + + + + + + + + + + +<#include "/layout/header.ftl" /> +
+ + + + + + + +
鏌ヨ鏉′欢
+
+ <@d_city defaultValue="${cityDisplay!}" callbackField="display" name="cityDisplay"/> + + + + + + <#if startDate??> + + <#else> + + + + <#if endDate??> + + <#else> + + + + 鍒涘缓浠诲姟 +
+
+ + + <#list calcCommands as it> + + + + + + + + + + + + + + + + +
鍩庡競鍖哄煙鏉垮潡灏忓尯鍚�璁$畻绫诲瀷璁$畻鏃堕棿鐘舵��浼樺厛绾�鐗╀笟绫诲瀷绉嶇被鍒涘缓鏃堕棿澶囨敞
${it.city!}${it.region!}${it.block!}${it.name} + <#if it.calcType ==0>鎸囧畾鏃ユ湡<#elseif it.calcType ==1 >鍏ㄩ儴璁$畻 + + <#if it.calcDate??> + ${it.calcDate?string("yyyy-MM-dd")} + <#if it.status ==0> + 鍒濆鐘舵�� + <#elseif it.status == 1> + 姝e湪澶勭悊 + <#elseif it.status == 2> + 澶勭悊瀹屾垚 + <#elseif it.status == 3> + 澶勭悊寮傚父 + + + <#if it.priority ==0> + 0 + <#elseif it.priority == 1> + 1 + <#elseif it.priority == 2> + 2 + + ${it.estateType!}${it.category!}${it.creationDate?string("yyyy-MM-dd HH:mm")}${it.remark!}
+ <@d_pager action = "taskList" currentPage = pager.currentPage controller = "rentPriceUpdate" totalPages = pager.totalPages/> +
+
+ + + + + \ No newline at end of file diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java index a5bb8b9a4..3b142528e 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java @@ -11,7 +11,7 @@ import javax.persistence.Table; import com.fangjia.dal.MongoEntity; @Entity -@Table(name = "fangjia.sqmetre_rent") +@Table(name = "fangjia.sqmetre_rent_2") public class SqmetreRent implements MongoEntity { /** @@ -22,18 +22,16 @@ public class SqmetreRent implements MongoEntity { private String city; private String region; private String districtName; - private Double avgPrice; - private int markup; + private Integer avgPrice; + private Integer calcAvgPrice; + private Double markup; private Date weekend; private String cat; private Date creationDate; private Date modificationDate; - private String sampleEnum; - private double credit; - private String cluster; - - private Double oldValue; - private String oldSampleEnum; + private Double credit; + private String valueType; + private Integer priceToRent; @Id @GeneratedValue @@ -76,22 +74,47 @@ public class SqmetreRent implements MongoEntity { } @Column(name = "avg_price") - public Double getAvgPrice() { + public Integer getAvgPrice() { return avgPrice; } - public void setAvgPrice(Double avgPrice) { + public void setAvgPrice(Integer avgPrice) { this.avgPrice = avgPrice; } - + @Column(name = "calc_avg_price") + public Integer getCalcAvgPrice() { + return calcAvgPrice; + } + + public void setCalcAvgPrice(Integer calcAvgPrice) { + this.calcAvgPrice = calcAvgPrice; + } + + @Column(name = "value_type") + public String getValueType() { + return valueType; + } + + public void setValueType(String valueType) { + this.valueType = valueType; + } + + @Column(name = "price_to_rent") + public Integer getPriceToRent() { + return priceToRent; + } + + public void setPriceToRent(Integer priceToRent) { + this.priceToRent = priceToRent; + } @Column(name = "markup") - public int getMarkup() { + public Double getMarkup() { return markup; } - public void setMarkup(int markup) { + public void setMarkup(Double markup) { this.markup = markup; } @@ -123,52 +146,15 @@ public class SqmetreRent implements MongoEntity { } - @Column(name = "sample_enum") - public String getSampleEnum() { - return sampleEnum; - } - - public void setSampleEnum(String sampleEnum) { - this.sampleEnum = sampleEnum; - } - - @Column(name = "credit") - public double getCredit() { + public Double getCredit() { return credit; } - public void setCredit(double credit) { + public void setCredit(Double credit) { this.credit = credit; } - @Column(name = "cluster") - public String getCluster() { - return cluster; - } - - public void setCluster(String cluster) { - this.cluster = cluster; - } - - @Column(name = "old_value") - public Double getOldValue() { - return oldValue; - } - - public void setOldValue(Double oldValue) { - this.oldValue = oldValue; - } - - @Column(name = "old_sample_enum") - public String getOldSampleEnum() { - return oldSampleEnum; - } - - public void setOldSampleEnum(String oldSampleEnum) { - this.oldSampleEnum = oldSampleEnum; - } - @Column(name = "cat") public String getCat() { return cat; 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 eded73b3f..d884547cf 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 @@ -1042,7 +1042,7 @@ public class EvaluationServiceImpl implements EvaluationService { evaluation.setTotalPrice(((Number) (totalPrice)).intValue()); - evaluation.setEvaluateWay(sqmetreRent.getSampleEnum()); + evaluation.setEvaluateWay(sqmetreRent.getValueType()); evaluation.setCredit(sqmetreRent.getCredit()); }else{ evaluation.setTotalPrice(null); diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentService.java b/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentService.java index 540d00721..ace5f5629 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentService.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentService.java @@ -4,6 +4,7 @@ import java.util.Date; import java.util.List; import java.util.Map; +import com.fangjia.dal.common.DistrictKey; import com.fangjia.dal.mongo.model.SqmetreRent; public interface SqmetreRentService { @@ -28,4 +29,5 @@ public interface SqmetreRentService { SqmetreRent findNearestSqmetreRent(String city, String region, String name, String cat); + List findAllAvgPriceByKeys(DistrictKey districtKey, String cat); } diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentServiceImpl.java b/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentServiceImpl.java index 60cb7cc97..56630bc77 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentServiceImpl.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/district/SqmetreRentServiceImpl.java @@ -5,6 +5,7 @@ import java.util.Date; import java.util.List; import java.util.Map; +import com.fangjia.dal.common.DistrictKey; import org.apache.commons.lang.StringUtils; import org.apache.http.impl.cookie.DateUtils; @@ -216,6 +217,21 @@ public class SqmetreRentServiceImpl implements SqmetreRentService{ } return sqmetreRent; } - - + + @Override + public List findAllAvgPriceByKeys(DistrictKey key, String cat) { + List params = new ArrayList(); + params.add(new QueryParam("city", key.getCity())); + if (StringUtils.isNotBlank(key.getRegion())) { + params.add(new QueryParam("region", key.getRegion())); + } + if (StringUtils.isNotBlank(key.getName())) { + params.add(new QueryParam("districtName", key.getName())); + } + params.add(new QueryParam("cat", cat)); + List sortParams = new ArrayList(); + sortParams.add(new SortParam("weekend", true)); + return sqmetreRentDao.findAllByParams(params, sortParams,0,Integer.MAX_VALUE, + new String[]{"weekend", "credit", "cat", "avgPrice", "calcAvgPrice"}); + } } From 94ae1bd09cabaef8597edcbd901fafe2f2b323ec Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Thu, 11 Aug 2022 09:36:06 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java index 3b142528e..839d829bc 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/SqmetreRent.java @@ -11,7 +11,7 @@ import javax.persistence.Table; import com.fangjia.dal.MongoEntity; @Entity -@Table(name = "fangjia.sqmetre_rent_2") +@Table(name = "fangjia.sqmetre_rent") public class SqmetreRent implements MongoEntity { /**