From 6bd20938e6af96936ca18731dad1b3373d8d4ea8 Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Mon, 8 Aug 2022 15:30:33 +0800 Subject: [PATCH 1/6] =?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/6] =?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/6] =?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 { /** From 485cd44eeb3a5013ba1ce1566ba54f3158021cd0 Mon Sep 17 00:00:00 2001 From: xuhe Date: Fri, 12 Aug 2022 11:16:01 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=8C=85=E5=90=AB=E5=95=86=E5=8A=A1?= =?UTF-8?q?=E3=80=81=E5=95=86=E4=B8=9A=E5=88=A4=E6=96=AD=E4=B8=BA=E5=95=86?= =?UTF-8?q?=E4=BD=8F=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/webapp/avgPriceUpdate/districtDetail.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/fangjia-bkoff/src/main/webapp/avgPriceUpdate/districtDetail.ftl b/projects/fangjia-bkoff/src/main/webapp/avgPriceUpdate/districtDetail.ftl index 963c8feb8..a3cb6949e 100644 --- a/projects/fangjia-bkoff/src/main/webapp/avgPriceUpdate/districtDetail.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/avgPriceUpdate/districtDetail.ftl @@ -771,7 +771,7 @@ y:Math.round(item.totalPrice/item.area), data:item }) - }else if((item.estateType!=null) && ((item.estateType.indexOf('鍟嗕綇') > -1) || (item.estateType.indexOf('鍏瘬閰掑簵') > -1))){ + }else if((item.estateType!=null) && ((item.estateType.indexOf('鍟嗕綇') > -1) || (item.estateType.indexOf('鍟嗕笟') > -1) || (item.estateType.indexOf('鍟嗗姟') > -1) || (item.estateType.indexOf('鍏瘬閰掑簵') > -1))){ series_arry_1.push({ x:new Date(ds), y:Math.round(item.totalPrice/item.area), From 105d71c782e04a3e649e2566fb65b30b638ef789 Mon Sep 17 00:00:00 2001 From: xuhe Date: Mon, 15 Aug 2022 11:27:57 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=88=BF=E6=BA=90=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bkoff/controllers/SeawaterController.java | 68 ++- .../fangjia/bkoff/model/SeawaterModel.java | 69 ++- .../src/main/webapp/seawater/houseList.ftl | 155 +++++- .../java/com/fangjia/dal/SeawaterQuery.java | 242 +++++++++ .../fangjia/dal/seawater/dao/SeawaterDao.java | 9 + .../dal/seawater/dao/SeawaterDaoImpl.java | 463 +++++++++++++++++- .../mongo/fangjia/SeawaterService.java | 8 + .../mongo/fangjia/SeawaterServiceImpl.java | 21 +- 8 files changed, 1007 insertions(+), 28 deletions(-) create mode 100644 projects/fangjia-dal/src/main/java/com/fangjia/dal/SeawaterQuery.java diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/SeawaterController.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/SeawaterController.java index a223c1674..4db96b47b 100644 --- a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/SeawaterController.java +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/controllers/SeawaterController.java @@ -3,6 +3,7 @@ package com.fangjia.bkoff.controllers; import com.fangjia.bkoff.model.JsonModel; import com.fangjia.bkoff.model.SeawaterModel; import com.fangjia.core.RegionData; +import com.fangjia.dal.SeawaterQuery; import com.fangjia.dal.common.DistrictKey; import com.fangjia.dal.seawater.model.Seawater; import com.fangjia.dal.seaweed.dao.DistrictDao; @@ -13,6 +14,7 @@ import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang.StringUtils; import org.sothis.core.util.Pager; import org.sothis.web.mvc.annotation.Param; +import org.springframework.beans.BeanUtils; import java.io.UnsupportedEncodingException; import java.util.Arrays; @@ -49,6 +51,8 @@ public class SeawaterController { pager.setTotalRows(0); } }else { + SeawaterQuery query = new SeawaterQuery(); + BeanUtils.copyProperties(model, query, new String[] {"sortField", "regionAlias", "districtAlias", "keys", "table"}); String sort = model.getSort(); String sortField = null; boolean order = false; @@ -62,6 +66,8 @@ public class SeawaterController { if (sortField == null) { sortField = "p_date"; } + query.setOrder(order); + query.setSortField(sortField); List regionAlias = null; List districtAlias = null; @@ -80,9 +86,15 @@ public class SeawaterController { regionAlias = RegionData.getRegionAlias(city, model.getRegion()); } + query.setDistrictAlias(districtAlias); + query.setRegionAlias(regionAlias); + query.setTable("seawater"); + +// pager.setTotalRows((int) seawaterService.findSeawatersCountFromEs(model.getCat(), city, model.getRegion(),model.getDistrictName(), districtAlias, regionAlias, model.getStartDate(), model.getEndDate(), model.getRoom(), model.getRootName(),"seawater")); +// List seawaterList = seawaterService.findSeawatersFromEs(model.getCat(), city, model.getRegion(),model.getDistrictName(), districtAlias, regionAlias, model.getStartDate(), model.getEndDate(), model.getRoom(), model.getRootName(), sortField, order, pager.getStartRow(), pager.getPageSize(), null,"seawater"); + pager.setTotalRows((int)seawaterService.findSeawatersCountByQuery(query)); + List seawaterList = seawaterService.findSeawatersByQuery(query); - pager.setTotalRows((int) seawaterService.findSeawatersCountFromEs(model.getCat(), city, model.getRegion(),model.getDistrictName(), districtAlias, regionAlias, model.getStartDate(), model.getEndDate(), model.getRoom(), model.getRootName(),"seawater")); - List seawaterList = seawaterService.findSeawatersFromEs(model.getCat(), city, model.getRegion(),model.getDistrictName(), districtAlias, regionAlias, model.getStartDate(), model.getEndDate(), model.getRoom(), model.getRootName(), sortField, order, pager.getStartRow(), pager.getPageSize(), null,"seawater"); Map tagsMap = new HashMap(); for(Seawater seawater : seawaterList) { if(StringUtils.isBlank(seawater.getName())){ @@ -125,6 +137,58 @@ public class SeawaterController { return ret; } + /** + * 按条件批量删除数据(小区名称只匹配主名不匹配别名,查询时匹配别名) + * @param model + * @return + */ + public Object batchDeleteByParamsAction(SeawaterModel model) { + JsonModel ret = new JsonModel(); + + String city = model.getCityDisplay(); + if(StringUtils.isBlank(model.getCat())) { + model.setCat("sell"); + } + SeawaterQuery query = new SeawaterQuery(); + BeanUtils.copyProperties(model, query, new String[] {"sortField", "regionAlias", "districtAlias", "keys", "table"}); + List regionAlias = null; + model.setDistrictName(model.getDistrictName().trim()); + if(StringUtils.isNotBlank(model.getRegion())) { + regionAlias = RegionData.getRegionAlias(city, model.getRegion()); + } + query.setRegionAlias(regionAlias); + query.setTable("seawater"); + seawaterService.batchDeleteByParams(query); + + return ret; + } + + /** + * 按条件批量修改物业类型(小区名称只匹配主名不匹配别名,查询时匹配别名) + * @param model + * @return + */ + public Object batchUpdateEstateTypeAction(SeawaterModel model) { + JsonModel ret = new JsonModel(); + + String city = model.getCityDisplay(); + if(StringUtils.isBlank(model.getCat())) { + model.setCat("sell"); + } + SeawaterQuery query = new SeawaterQuery(); + BeanUtils.copyProperties(model, query, new String[] {"sortField", "regionAlias", "districtAlias", "keys", "table"}); + List regionAlias = null; + model.setDistrictName(model.getDistrictName().trim()); + if(StringUtils.isNotBlank(model.getRegion())) { + regionAlias = RegionData.getRegionAlias(city, model.getRegion()); + } + query.setRegionAlias(regionAlias); + query.setTable("seawater"); + seawaterService.batchUpdateEstateType(query); + + return ret; + } + public void setSeawaterService(SeawaterService seawaterService) { this.seawaterService = seawaterService; } diff --git a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/SeawaterModel.java b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/SeawaterModel.java index 9b923244b..35660d045 100644 --- a/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/SeawaterModel.java +++ b/projects/fangjia-bkoff/src/main/java/com/fangjia/bkoff/model/SeawaterModel.java @@ -35,12 +35,19 @@ public class SeawaterModel extends BaseModel { private Seawater seawater; private List seawaterList; private Map tagsMap; - private Integer order; + private Boolean order; private Integer StartDate; private Integer endDate; private String sort; private String url; private String rootName; + private String estateType; + private Double startArea; + private Double endArea; + private Integer startPrice; + private Integer endPrice; + private Integer status; + private String editEstateType; public String getId() { return id; } @@ -156,10 +163,10 @@ public class SeawaterModel extends BaseModel { public void setCityDisplay(String cityDisplay) { this.cityDisplay = cityDisplay; } - public Integer getOrder() { + public Boolean getOrder() { return order; } - public void setOrder(Integer order) { + public void setOrder(Boolean order) { this.order = order; } @@ -220,4 +227,60 @@ public class SeawaterModel extends BaseModel { public void setTagsMap(Map tagsMap) { this.tagsMap = tagsMap; } + + public String getEstateType() { + return estateType; + } + + public void setEstateType(String estateType) { + this.estateType = estateType; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getStartPrice() { + return startPrice; + } + + public void setStartPrice(Integer startPrice) { + this.startPrice = startPrice; + } + + public Integer getEndPrice() { + return endPrice; + } + + public void setEndPrice(Integer endPrice) { + this.endPrice = endPrice; + } + + public Double getStartArea() { + return startArea; + } + + public void setStartArea(Double startArea) { + this.startArea = startArea; + } + + public Double getEndArea() { + return endArea; + } + + public void setEndArea(Double endArea) { + this.endArea = endArea; + } + + public String getEditEstateType() { + return editEstateType; + } + + public void setEditEstateType(String editEstateType) { + this.editEstateType = editEstateType; + } } diff --git a/projects/fangjia-bkoff/src/main/webapp/seawater/houseList.ftl b/projects/fangjia-bkoff/src/main/webapp/seawater/houseList.ftl index af17b04e3..5e55e3fbd 100644 --- a/projects/fangjia-bkoff/src/main/webapp/seawater/houseList.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/seawater/houseList.ftl @@ -72,7 +72,9 @@ - + + + - - + + + + + - + + - + + + - + + + + @@ -142,6 +160,7 @@ 鏈濆悜 鐗╀笟绫诲瀷 鏉ユ簮 + 鐘舵�� 鎿嶄綔 <#if seawaterList??> @@ -173,7 +192,7 @@ ${it.area!' '} - ${(it.totalPrice / it.area)?string('#')} + ${it.avgPrice!' '} ${it.totalPrice!' '} ${it.pDate!} ${it.room!'-'}/${it.hall!'-'}/${it.toilet!'-'} @@ -189,6 +208,13 @@ -- + + <#if it.status == 0> + 姝e父 + <#else> + 宸插垹闄� + + detail-name="${it.name}" <#if it.address??>detail-address="${it.address!}"<#if it.mobile??>detail-mobile="${it.mobile}"<#if it.category??>detail-category="${it.category}">璇︽儏 鍒犻櫎 @@ -219,7 +245,26 @@ - + + + @@ -385,6 +430,106 @@ } }); + $("#batchDeleteByParam").click(function(){ + if(confirm('纭瑕佸垹闄ゅ綋鍓嶆煡璇㈡潯浠朵笅鐨勬墍鏈夋暟鎹悧锛�')) { + var cityDisplay = $("input[name='cityDisplay']").val() + var region = $("select[name='region']").val() + var districtName = $("input[name='districtName']").val() + var estateType = $("input[name='estateType']").val() + var cat = $("select[name='cat']").val() + var status = $("select[name='status']").val() + var rootName = $("input[name='rootName']").val() + var startDate = $("input[name='startDate']").val() + var endDate = $("input[name='endDate']").val() + var startArea = $("input[name='startArea']").val() + var endArea = $("input[name='endArea']").val() + var startPrice = $("input[name='startPrice']").val() + var endPrice = $("input[name='endPrice']").val() + if(cityDisplay == "" || region == "" || districtName == ""){ + alert("鍩庡競銆佸尯鍩熴�佸皬鍖哄悕绉板繀濉�") + return false; + } + var data = {"cityDisplay": cityDisplay, "region": region, "districtName": districtName, + "estateType": estateType, "cat": cat, "status": status, + "rootName": rootName, "startDate": startDate, "endDate": endDate, + "startArea": startArea, "endArea": endArea, "startPrice": startPrice, + "endPrice": endPrice} + jQuery.ajax({ + type: 'POST', + url: '../seawater/batchDeleteByParams', + data: data, + dataType: 'json', + timeout: 100000, + success: function(model) { + alert("鎵归噺鍒犻櫎鎿嶄綔鎴愬姛"); + location.reload(); + }, + error : function() { + } + }); + } + }); + $("#batchUpdateEstateType").click(function(){ + $('#estateTypeModal').modal('show'); + }); + + $("#editSubmit").click(function(){ + var editEstateType = $("input[name='editEstateType']").val() + if(editEstateType == ""){ + alert("鐗╀笟绫诲瀷蹇呭~") + return false; + } + if(confirm('纭瑕佷慨鏀瑰綋鍓嶆煡璇㈡潯浠朵笅鐨勭墿涓氱被鍨嬪悧锛�')) { + var cityDisplay = $("input[name='cityDisplay']").val() + var region = $("select[name='region']").val() + var districtName = $("input[name='districtName']").val() + var estateType = $("input[name='estateType']").val() + var cat = $("select[name='cat']").val() + var status = $("select[name='status']").val() + var rootName = $("input[name='rootName']").val() + var startDate = $("input[name='startDate']").val() + var endDate = $("input[name='endDate']").val() + var startArea = $("input[name='startArea']").val() + var endArea = $("input[name='endArea']").val() + var startPrice = $("input[name='startPrice']").val() + var endPrice = $("input[name='endPrice']").val() + if(cityDisplay == "" || region == "" || districtName == ""){ + alert("鍩庡競銆佸尯鍩熴�佸皬鍖哄悕绉板繀濉�") + return false; + } + console.log(startArea) + console.log(endArea) + console.log(startPrice) + console.log(endPrice) + console.log(estateType) + if(startArea == "" && endArea == "" && startPrice == "" && endPrice == "" && estateType == ""){ + alert("闈㈢Н锛屼环鏍硷紝鐗╀笟绫诲瀷蹇呴』鑷冲皯涓�椤规湁鍊�") + return false; + } + + var data = {"cityDisplay": cityDisplay, "region": region, "districtName": districtName, + "estateType": estateType, "cat": cat, "status": status, + "rootName": rootName, "startDate": startDate, "endDate": endDate, + "startArea": startArea, "endArea": endArea, "startPrice": startPrice, + "endPrice": endPrice, "editEstateType": editEstateType} + jQuery.ajax({ + type: 'POST', + url: '../seawater/batchUpdateEstateType', + data: data, + dataType: 'json', + timeout: 100000, + success: function(model) { + alert("鎵归噺淇敼鎿嶄綔鎴愬姛"); + location.reload(); + }, + error : function() { + alert("鎵归噺淇敼鎿嶄綔澶辫触"); + location.reload(); + } + }); + $('#estateTypeModal').modal('hide'); + } + }); \ No newline at end of file diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/SeawaterQuery.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/SeawaterQuery.java new file mode 100644 index 000000000..66cc39114 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/SeawaterQuery.java @@ -0,0 +1,242 @@ +package com.fangjia.dal; +import org.sothis.core.util.Pager; + +import java.util.List; + +public class SeawaterQuery { + + private String id; + private String cat; + private String region; + private String districtName; + private String cityDisplay; + private Integer room; + private String direction; + private String fitment; + private String sort; + private Boolean order; + private Integer StartDate; + private Integer endDate; + private String estateType; + private Double startArea; + private Double endArea; + private Integer startPrice; + private Integer endPrice; + private Integer status; + private String rootName; + private String sortField; + private List regionAlias; + private List districtAlias; + private String[] keys; + private String table; + private Pager pager; + private String editEstateType; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCat() { + return cat; + } + + public void setCat(String cat) { + this.cat = cat; + } + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public String getDistrictName() { + return districtName; + } + + public void setDistrictName(String districtName) { + this.districtName = districtName; + } + + public Integer getRoom() { + return room; + } + + public void setRoom(Integer room) { + this.room = room; + } + + public String getDirection() { + return direction; + } + + public void setDirection(String direction) { + this.direction = direction; + } + + public String getFitment() { + return fitment; + } + + public void setFitment(String fitment) { + this.fitment = fitment; + } + + public Boolean getOrder() { + return order; + } + + public void setOrder(Boolean order) { + this.order = order; + } + + public Integer getStartDate() { + return StartDate; + } + + public void setStartDate(Integer startDate) { + StartDate = startDate; + } + + public Integer getEndDate() { + return endDate; + } + + public void setEndDate(Integer endDate) { + this.endDate = endDate; + } + + public String getEstateType() { + return estateType; + } + + public void setEstateType(String estateType) { + this.estateType = estateType; + } + + public Integer getStartPrice() { + return startPrice; + } + + public void setStartPrice(Integer startPrice) { + this.startPrice = startPrice; + } + + public Integer getEndPrice() { + return endPrice; + } + + public void setEndPrice(Integer endPrice) { + this.endPrice = endPrice; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getSortField() { + return sortField; + } + + public void setSortField(String sortField) { + this.sortField = sortField; + } + + public List getRegionAlias() { + return regionAlias; + } + + public void setRegionAlias(List regionAlias) { + this.regionAlias = regionAlias; + } + + public List getDistrictAlias() { + return districtAlias; + } + + public void setDistrictAlias(List districtAlias) { + this.districtAlias = districtAlias; + } + + public String[] getKeys() { + return keys; + } + + public void setKeys(String[] keys) { + this.keys = keys; + } + + public String getTable() { + return table; + } + + public void setTable(String table) { + this.table = table; + } + + public String getRootName() { + return rootName; + } + + public void setRootName(String rootName) { + this.rootName = rootName; + } + + public Double getStartArea() { + return startArea; + } + + public void setStartArea(Double startArea) { + this.startArea = startArea; + } + + public Double getEndArea() { + return endArea; + } + + public void setEndArea(Double endArea) { + this.endArea = endArea; + } + + public Pager getPager() { + return pager; + } + + public void setPager(Pager pager) { + this.pager = pager; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public String getCityDisplay() { + return cityDisplay; + } + + public void setCityDisplay(String cityDisplay) { + this.cityDisplay = cityDisplay; + } + + public String getEditEstateType() { + return editEstateType; + } + + public void setEditEstateType(String editEstateType) { + this.editEstateType = editEstateType; + } +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDao.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDao.java index edbd0546e..ecb61ff6f 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDao.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDao.java @@ -2,6 +2,7 @@ package com.fangjia.dal.seawater.dao; import java.util.List; +import com.fangjia.dal.SeawaterQuery; import com.fangjia.dal.seawater.model.Seawater; /** @@ -18,4 +19,12 @@ public interface SeawaterDao extends com.fangjia.dal.SeawaterDao { Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root, String sort, boolean order, int start, int limit , String table); List findHouses(String city, String region, List alias, Integer minPrice, Integer maxPrice, Integer limit); + + List findSeawatersByQuery(SeawaterQuery query); + + long findSeawatersCountByQuery(SeawaterQuery query); + + void batchDeleteByParams(SeawaterQuery query); + + void batchUpdateEstateType(SeawaterQuery query); } diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDaoImpl.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDaoImpl.java index 69108673a..55c659222 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDaoImpl.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDaoImpl.java @@ -2,6 +2,7 @@ package com.fangjia.dal.seawater.dao; import java.util.*; +import com.fangjia.dal.SeawaterQuery; import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang.StringUtils; @@ -29,7 +30,12 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i @Override public Seawater findByIdFromEs(String id,String table) { Seawater seawater = null; - List jsonList = queryList(id,null,null,null,null,null,null,null,null, null, null, null, null, null,null,null,false,-1,-1,table); + SeawaterQuery query = new SeawaterQuery(); + query.setId(id); + query.setTable(table); + query.getPager().setStartRow(-1); + query.getPager().setPageSize(-1); + List jsonList = queryList(query); if(jsonList == null){ return null; }else{ @@ -44,7 +50,26 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i @Override public List findSeawatersFromEs(String category, String city, String region, String name, List alias, List regionAlias, Integer startDate, Integer endDate, Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root, String sort, boolean order, int start, int limit, String table) { List seawaterList= new ArrayList(); - List jsonList = queryList(null,category,city,region,name,alias,regionAlias,startDate,endDate, startArea, endArea, startPrice, endPrice, room,root,sort,order,start,limit,table); + SeawaterQuery query = new SeawaterQuery(); + query.setCat(category); + query.setCityDisplay(city); + query.setRegion(region); + query.setDistrictName(name); + query.setDistrictAlias(alias); + query.setRegionAlias(regionAlias); + query.setStartDate(startDate); + query.setEndDate(endDate); + query.setStartArea(startArea); + query.setEndArea(endArea); + query.setStartPrice(startPrice); + query.setEndPrice(endPrice); + query.setRoom(room); + query.setRootName(root); + query.setOrder(order); + query.getPager().setStartRow(-1); + query.getPager().setPageSize(-1); + query.setTable(table); + List jsonList = queryList(query); if(jsonList == null){ return null; }else{ @@ -53,6 +78,23 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i return seawaterList; } + @Override + public List findSeawatersByQuery(SeawaterQuery query){ + List seawaterList= new ArrayList(); + List jsonList = queryList(query); + if(jsonList == null){ + return null; + }else{ + seawaterList = wrapSeawater(jsonList); + } + return seawaterList; + } + + @Override + public long findSeawatersCountByQuery(SeawaterQuery query) { + int count = queryCount(query); + return count; + } @Override public List findHouses(String city, String region, List alias, Integer minPrice, Integer maxPrice, Integer limit) { @@ -136,6 +178,42 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i } } + @Override + public void batchDeleteByParams(SeawaterQuery query) { + HttpRequest request = new HttpRequest(); + + JSONObject reqBody = wrapQueryParams(query); + + JSONObject script = new JSONObject(); + script.put("source", "ctx._source.status=1"); + script.put("lang", "painless"); + reqBody.put("script", script); + + try { + request.postWithBody("http://es.fangjia.com:9200/seawater/_update_by_query", reqBody, this.buildHeader(), "UTF-8"); + } catch (HttpRequestException e) { + e.printStackTrace(); + } + } + + @Override + public void batchUpdateEstateType(SeawaterQuery query) { + HttpRequest request = new HttpRequest(); + + JSONObject reqBody = wrapQueryParams(query); + + JSONObject script = new JSONObject(); + script.put("source", "ctx._source.estate_type="+"'"+query.getEditEstateType()+"'"); + script.put("lang", "painless"); + reqBody.put("script", script); + + try { + request.postWithBody("http://es.fangjia.com:9200/seawater/_update_by_query", reqBody, this.buildHeader(), "UTF-8"); + } catch (HttpRequestException e) { + e.printStackTrace(); + } + } + private JSONObject addMatch(String name, String value){ JSONObject term = new JSONObject(); JSONObject match = new JSONObject(); @@ -256,6 +334,9 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i if(source.containsKey("build_type")){ seawater.setBuildType(source.getString("build_type")); } + if(source.containsKey("status")){ + seawater.setStatus(source.getInt("status")); + } seawaterList.add(seawater); } return seawaterList; @@ -431,29 +512,379 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i } return null; } - - private List queryList(String id,String category, String city, String region, String name, List alias, - List regionAlias, Integer startDate, Integer endDate, Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root,String sort, boolean order, int start, int limit,String table){ - JSONObject json = query(id,category,city,region,name,alias,regionAlias,startDate,endDate, startArea, endArea, startPrice, endPrice, room,root,sort,order,start,limit,table); + + private JSONObject query(SeawaterQuery query){ + long time1 = System.currentTimeMillis(); + JSONObject reqBody = new JSONObject(); + JSONObject q = new JSONObject(); + JSONObject queryJson = new JSONObject(); + List jsonList = new ArrayList(); + if(StringUtils.isNotBlank(query.getId())) { + JSONObject param = new JSONObject(); + param.put("_id", query.getId()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + if(StringUtils.isNotBlank(query.getCat())) { + JSONObject param = new JSONObject(); + param.put("cat", query.getCat()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + + Set namesList = new LinkedHashSet(); + if(StringUtils.isNotBlank(query.getDistrictName())) { + namesList.add(query.getDistrictName()); + } + if (query.getDistrictAlias() != null) { + namesList.addAll(query.getDistrictAlias()); + } + if(namesList != null && namesList.size() > 0){ + JSONObject param = new JSONObject(); + param.put("district_name", namesList); + JSONObject temp = new JSONObject(); + temp.put("terms", param); + jsonList.add(temp); + } + + Set regionsList = new LinkedHashSet(); + if(StringUtils.isNotBlank(query.getRegion())) { + regionsList.add(query.getRegion()); + } + if (query.getRegionAlias() != null) { + regionsList.addAll(query.getRegionAlias()); + } + if(regionsList != null && regionsList.size() > 0){ + JSONObject param = new JSONObject(); + param.put("region", regionsList); + JSONObject temp = new JSONObject(); + temp.put("terms", param); + jsonList.add(temp); + } + + if(StringUtils.isNotBlank(query.getCityDisplay())){ + JSONObject param = new JSONObject(); + param.put("city", query.getCityDisplay()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + if(StringUtils.isNotBlank(query.getEstateType())) { + JSONObject param = new JSONObject(); + param.put("estate_type", query.getEstateType()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + if(query.getRoom() != null) { + JSONObject param = new JSONObject(); + param.put("room", query.getRoom()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + if(StringUtils.isNotBlank(query.getRootName())) { + JSONObject param = new JSONObject(); + param.put("root", query.getRootName()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + + if(query.getStartDate() != null || query.getEndDate() != null){ + JSONObject param = new JSONObject(); + JSONObject temp = new JSONObject(); + JSONObject temp2 = new JSONObject(); + if(query.getStartDate() != null){ + temp2.put("gte", query.getStartDate()); + } + if(query.getEndDate() != null){ + temp2.put("lte", query.getEndDate()); + } + param.put("p_date", temp2); + temp.put("range", param); + jsonList.add(temp); + } + + + if(query.getStartArea() != null || query.getEndArea() != null){ + JSONObject param = new JSONObject(); + JSONObject temp = new JSONObject(); + JSONObject temp2 = new JSONObject(); + if(query.getStartArea() != null){ + temp2.put("gte", query.getStartArea()); + } + if(query.getEndArea() != null){ + temp2.put("lte", query.getEndArea()); + } + param.put("area", temp2); + temp.put("range", param); + jsonList.add(temp); + } + + if(query.getStartPrice() != null || query.getEndPrice() != null){ + JSONObject param = new JSONObject(); + JSONObject temp = new JSONObject(); + JSONObject temp2 = new JSONObject(); + if(query.getStartPrice() != null){ + temp2.put("gte", query.getStartPrice()); + } + if(query.getEndPrice() != null){ + temp2.put("lte", query.getEndPrice()); + } + param.put("avg_price", temp2); + temp.put("range", param); + jsonList.add(temp); + } + + if(StringUtils.isNotBlank(query.getSort())){ + JSONObject jsonOrder = new JSONObject(); + if(query.getOrder()){ + jsonOrder.put("order", "asc"); + }else{ + jsonOrder.put("order", "desc"); + } + JSONObject jsonSort = new JSONObject(); + jsonSort.put(query.getOrder(), jsonOrder); + List sortJsonList = new ArrayList(); + sortJsonList.add(jsonSort); + reqBody.put("sort", sortJsonList); + } + + if(query.getPager().getStartRow() >= 0){ + reqBody.put("from", query.getPager().getStartRow()); + } + if(query.getPager().getPageSize() >= 0){ + reqBody.put("size", query.getPager().getPageSize()); + } + + if(query.getStatus() != null){ + JSONObject param = new JSONObject(); + param.put("status", query.getStatus()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + + queryJson.put("must", jsonList); + q.put("bool", queryJson); + reqBody.put("query", q); + //用户名:密码 + Base64 token = new Base64(); + String authenticationEncoding = token.encodeAsString(new String(""+ES_USER+":"+ES_PASSWORD+"").getBytes()); + HttpRequest request = new HttpRequest(); + Map headers = new HashMap(); + headers.put("Content-Type", "application/json"); + headers.put("Authorization", "Basic "+authenticationEncoding+""); + try { + String response = request.postWithBody("http://es.fangjia.com:9200/"+query.getTable()+"/_search?rest_total_hits_as_int=true", reqBody, headers, "UTF-8"); + JSONObject json = JSONObject.fromObject(response); + long time2 = System.currentTimeMillis(); + System.out.println(time2-time1); + return json; + } catch (HttpRequestException e) { + e.printStackTrace(); + } + return null; + } + +// private List queryList(String id,String category, String city, String region, String name, List alias, +// List regionAlias, Integer startDate, Integer endDate, Double startArea, Double endArea, Integer startPrice, Integer endPrice, Integer room, String root,String sort, boolean order, int start, int limit,String table){ +// JSONObject json = query(id,category,city,region,name,alias,regionAlias,startDate,endDate, startArea, endArea, startPrice, endPrice, room,root,sort,order,start,limit,table); +// if(!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("hits")){ +// return null; +// } +// JSONArray hits = json.getJSONObject("hits").getJSONArray("hits"); +// List results = new ArrayList(); +// for(int i=0 ;i < hits.size(); i++){ +// JSONObject jsonObject = hits.getJSONObject(i); +// results.add(jsonObject); +// } +// return results; +// } + + private List queryList(SeawaterQuery query){ + JSONObject json = query(query); if(!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("hits")){ - return null; - } - JSONArray hits = json.getJSONObject("hits").getJSONArray("hits"); - List results = new ArrayList(); - for(int i=0 ;i < hits.size(); i++){ - JSONObject jsonObject = hits.getJSONObject(i); - results.add(jsonObject); - } - return results; + return null; + } + JSONArray hits = json.getJSONObject("hits").getJSONArray("hits"); + List results = new ArrayList(); + for(int i=0 ;i < hits.size(); i++){ + JSONObject jsonObject = hits.getJSONObject(i); + results.add(jsonObject); + } + return results; } private int queryCount(String id,String category, String city, String region, String name, List alias, List regionAlias, Integer startDate, Integer endDate, Integer room, String root,String sort, boolean order, int start, int limit,String table){ - JSONObject json = query(id,category,city,region,name,alias,regionAlias,startDate,endDate,null, null, null, null, room,root,sort,order,start,limit,table); + SeawaterQuery query = new SeawaterQuery(); + query.setCat(category); + query.setCityDisplay(city); + query.setRegion(region); + query.setDistrictName(name); + query.setDistrictAlias(alias); + query.setRegionAlias(regionAlias); + query.setStartDate(startDate); + query.setEndDate(endDate); + query.setRoom(room); + query.setRootName(root); + query.setOrder(order); + query.getPager().setStartRow(-1); + query.getPager().setPageSize(-1); + query.setTable(table); + JSONObject json = query(query); if(!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("total")){ return 0; } return json.getJSONObject("hits").getInt("total"); } + private int queryCount(SeawaterQuery query){ + JSONObject json = query(query); + if(!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("total")){ + return 0; + } + return json.getJSONObject("hits").getInt("total"); + } + + private JSONObject wrapQueryParams(SeawaterQuery query){ + JSONObject reqBody = new JSONObject(); + JSONObject q = new JSONObject(); + JSONObject queryJson = new JSONObject(); + List jsonList = new ArrayList(); + if(StringUtils.isNotBlank(query.getId())) { + JSONObject param = new JSONObject(); + param.put("_id", query.getId()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + if(StringUtils.isNotBlank(query.getCat())) { + JSONObject param = new JSONObject(); + param.put("cat", query.getCat()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + + Set namesList = new LinkedHashSet(); + if(StringUtils.isNotBlank(query.getDistrictName())) { + namesList.add(query.getDistrictName()); + } + if(namesList != null && namesList.size() > 0){ + JSONObject param = new JSONObject(); + param.put("district_name", namesList); + JSONObject temp = new JSONObject(); + temp.put("terms", param); + jsonList.add(temp); + } + + Set regionsList = new LinkedHashSet(); + if(StringUtils.isNotBlank(query.getRegion())) { + regionsList.add(query.getRegion()); + } + if (query.getRegionAlias() != null) { + regionsList.addAll(query.getRegionAlias()); + } + if(regionsList != null && regionsList.size() > 0){ + JSONObject param = new JSONObject(); + param.put("region", regionsList); + JSONObject temp = new JSONObject(); + temp.put("terms", param); + jsonList.add(temp); + } + + if(StringUtils.isNotBlank(query.getCityDisplay())){ + JSONObject param = new JSONObject(); + param.put("city", query.getCityDisplay()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + if(StringUtils.isNotBlank(query.getEstateType())) { + JSONObject param = new JSONObject(); + param.put("estate_type", query.getEstateType()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + if(query.getRoom() != null) { + JSONObject param = new JSONObject(); + param.put("room", query.getRoom()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + if(StringUtils.isNotBlank(query.getRootName())) { + JSONObject param = new JSONObject(); + param.put("root", query.getRootName()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + + if(query.getStartDate() != null || query.getEndDate() != null){ + JSONObject param = new JSONObject(); + JSONObject temp = new JSONObject(); + JSONObject temp2 = new JSONObject(); + if(query.getStartDate() != null){ + temp2.put("gte", query.getStartDate()); + } + if(query.getEndDate() != null){ + temp2.put("lte", query.getEndDate()); + } + param.put("p_date", temp2); + temp.put("range", param); + jsonList.add(temp); + } + + + if(query.getStartArea() != null || query.getEndArea() != null){ + JSONObject param = new JSONObject(); + JSONObject temp = new JSONObject(); + JSONObject temp2 = new JSONObject(); + if(query.getStartArea() != null){ + temp2.put("gte", query.getStartArea()); + } + if(query.getEndArea() != null){ + temp2.put("lte", query.getEndArea()); + } + param.put("area", temp2); + temp.put("range", param); + jsonList.add(temp); + } + + if(query.getStartPrice() != null || query.getEndPrice() != null){ + JSONObject param = new JSONObject(); + JSONObject temp = new JSONObject(); + JSONObject temp2 = new JSONObject(); + if(query.getStartPrice() != null){ + temp2.put("gte", query.getStartPrice()); + } + if(query.getEndPrice() != null){ + temp2.put("lte", query.getEndPrice()); + } + param.put("avg_price", temp2); + temp.put("range", param); + jsonList.add(temp); + } + + if(query.getStatus() != null){ + JSONObject param = new JSONObject(); + param.put("status", query.getStatus()); + JSONObject temp = new JSONObject(); + temp.put("term", param); + jsonList.add(temp); + } + + queryJson.put("must", jsonList); + q.put("bool", queryJson); + reqBody.put("query", q); + return reqBody; + } + } diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/mongo/fangjia/SeawaterService.java b/projects/fangjia-service/src/main/java/com/fangjia/service/mongo/fangjia/SeawaterService.java index 4fafa6663..f03e13be6 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/mongo/fangjia/SeawaterService.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/mongo/fangjia/SeawaterService.java @@ -4,6 +4,7 @@ import java.util.Date; import java.util.List; import java.util.Map; +import com.fangjia.dal.SeawaterQuery; import com.fangjia.dal.seawater.model.Seawater; public interface SeawaterService { @@ -37,9 +38,16 @@ public interface SeawaterService { */ void deleteByIds(String ids); + void batchDeleteByParams(SeawaterQuery query); + + void batchUpdateEstateType(SeawaterQuery query); + @Deprecated List findAllSeawater(String category, String city, String name, String region, Integer room, String root, String sort, Integer startDate, Integer endDate, int start, int limit, boolean order, String[] fields); @Deprecated int findAllSeawaterCount(String category, String city, String name, String region, Integer room, String root, Integer startDate, Integer endDate); + + List findSeawatersByQuery(SeawaterQuery query); + long findSeawatersCountByQuery(SeawaterQuery query); } diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/mongo/fangjia/SeawaterServiceImpl.java b/projects/fangjia-service/src/main/java/com/fangjia/service/mongo/fangjia/SeawaterServiceImpl.java index 2dc484035..29a491729 100644 --- a/projects/fangjia-service/src/main/java/com/fangjia/service/mongo/fangjia/SeawaterServiceImpl.java +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/mongo/fangjia/SeawaterServiceImpl.java @@ -1,5 +1,6 @@ package com.fangjia.service.mongo.fangjia; +import com.fangjia.dal.SeawaterQuery; import com.fangjia.dal.seawater.dao.SeawaterDao; import com.fangjia.dal.seawater.model.Seawater; import com.fangjia.datastore.driver.DSCollection; @@ -191,6 +192,16 @@ public class SeawaterServiceImpl implements SeawaterService { seawaterDao.deleteByIds(Arrays.asList(idArr)); } + @Override + public void batchDeleteByParams(SeawaterQuery query) { + seawaterDao.batchDeleteByParams(query); + } + + @Override + public void batchUpdateEstateType(SeawaterQuery query) { + seawaterDao.batchUpdateEstateType(query); + } + public void setSeawaterDao(SeawaterDao seawaterDao) { this.seawaterDao = seawaterDao; } @@ -237,7 +248,13 @@ public class SeawaterServiceImpl implements SeawaterService { sort,order,start,limit,table); } + @Override + public List findSeawatersByQuery(SeawaterQuery query){ + return seawaterDao.findSeawatersByQuery(query); + } - - + @Override + public long findSeawatersCountByQuery(SeawaterQuery query){ + return seawaterDao.findSeawatersCountByQuery(query); + } } From 6b941432cdac83059107bafa3f407648ddc87d6d Mon Sep 17 00:00:00 2001 From: xuhe Date: Mon, 15 Aug 2022 15:42:33 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=88=BF=E6=BA=90=E6=A0=B7=E6=9C=ACbug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/webapp/seawater/houseList.ftl | 6 ++--- .../dal/seawater/dao/SeawaterDaoImpl.java | 27 ++++++++++++------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/projects/fangjia-bkoff/src/main/webapp/seawater/houseList.ftl b/projects/fangjia-bkoff/src/main/webapp/seawater/houseList.ftl index 5e55e3fbd..38771bc5d 100644 --- a/projects/fangjia-bkoff/src/main/webapp/seawater/houseList.ftl +++ b/projects/fangjia-bkoff/src/main/webapp/seawater/houseList.ftl @@ -149,9 +149,9 @@ 闈㈢Н 鍗曚环 鎬讳环 - <#if sort?? && sort == 'p_date_desc'>鍙戝竷鏃堕棿鈫� - <#elseif sort?? && sort == 'p_date_asc'>鍙戝竷鏃堕棿鈫� - <#else>鍙戝竷鏃堕棿鈫� + <#if sort?? && sort == 'p_date_desc'>鍙戝竷鏃堕棿鈫� + <#elseif sort?? && sort == 'p_date_asc'>鍙戝竷鏃堕棿鈫� + <#else>鍙戝竷鏃堕棿鈫� 瀹ゅ巺鍗� 妤煎眰 diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDaoImpl.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDaoImpl.java index 55c659222..9ca810b1a 100644 --- a/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDaoImpl.java +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/seawater/dao/SeawaterDaoImpl.java @@ -12,6 +12,7 @@ import com.fangjia.dal.seawater.model.Seawater; import net.sf.json.JSONArray; import net.sf.json.JSONObject; +import org.sothis.core.util.Pager; public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl implements SeawaterDao { @@ -33,8 +34,10 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i SeawaterQuery query = new SeawaterQuery(); query.setId(id); query.setTable(table); - query.getPager().setStartRow(-1); - query.getPager().setPageSize(-1); + Pager pager = new Pager(); + pager.setStartRow(-1); + pager.setPageSize(-1); + query.setPager(pager); List jsonList = queryList(query); if(jsonList == null){ return null; @@ -66,8 +69,10 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i query.setRoom(room); query.setRootName(root); query.setOrder(order); - query.getPager().setStartRow(-1); - query.getPager().setPageSize(-1); + Pager pager = new Pager(); + pager.setStartRow(start); + pager.setPageSize(limit); + query.setPager(pager); query.setTable(table); List jsonList = queryList(query); if(jsonList == null){ @@ -80,7 +85,7 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i @Override public List findSeawatersByQuery(SeawaterQuery query){ - List seawaterList= new ArrayList(); + List seawaterList; List jsonList = queryList(query); if(jsonList == null){ return null; @@ -190,7 +195,7 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i reqBody.put("script", script); try { - request.postWithBody("http://es.fangjia.com:9200/seawater/_update_by_query", reqBody, this.buildHeader(), "UTF-8"); + request.postWithBody("http://es.fangjia.com:9200/seawater/_update_by_query?conflicts=proceed&wait_for_completion=false", reqBody, this.buildHeader(), "UTF-8"); } catch (HttpRequestException e) { e.printStackTrace(); } @@ -208,7 +213,7 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i reqBody.put("script", script); try { - request.postWithBody("http://es.fangjia.com:9200/seawater/_update_by_query", reqBody, this.buildHeader(), "UTF-8"); + request.postWithBody("http://es.fangjia.com:9200/seawater/_update_by_query?conflicts=proceed&wait_for_completion=false", reqBody, this.buildHeader(), "UTF-8"); } catch (HttpRequestException e) { e.printStackTrace(); } @@ -647,7 +652,7 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i jsonOrder.put("order", "desc"); } JSONObject jsonSort = new JSONObject(); - jsonSort.put(query.getOrder(), jsonOrder); + jsonSort.put(query.getSortField(), jsonOrder); List sortJsonList = new ArrayList(); sortJsonList.add(jsonSort); reqBody.put("sort", sortJsonList); @@ -733,8 +738,10 @@ public class SeawaterDaoImpl extends com.fangjia.dal.SeawaterDaoImpl i query.setRoom(room); query.setRootName(root); query.setOrder(order); - query.getPager().setStartRow(-1); - query.getPager().setPageSize(-1); + Pager pager = new Pager(); + pager.setStartRow(start); + pager.setPageSize(limit); + query.setPager(pager); query.setTable(table); JSONObject json = query(query); if(!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("total")){