diff --git a/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/TrendController.java b/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/TrendController.java index 76020e4b8..bc5a60732 100644 --- a/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/TrendController.java +++ b/projects/fangjia-coresite/src/main/java/com/fangjia/coresite/controllers/TrendController.java @@ -1,6 +1,7 @@ package com.fangjia.coresite.controllers; import java.io.Serializable; +import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -14,6 +15,7 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import com.fangjia.coresite.model.*; +import com.fangjia.service.bo.*; import net.sf.json.JSONObject; import org.apache.commons.collections.CollectionUtils; @@ -45,11 +47,6 @@ import com.fangjia.dal.mongo.model.DistrictTradeStat; import com.fangjia.dal.mongo.model.RegionBlock; import com.fangjia.dal.mongo.model.RegionStat; import com.fangjia.dal.seaweed.model.District; -import com.fangjia.service.bo.DistrictInfo; -import com.fangjia.service.bo.DistrictStatBo; -import com.fangjia.service.bo.DistrictStatInfoBo; -import com.fangjia.service.bo.HouseBo; -import com.fangjia.service.bo.RegionStatBo; import com.fangjia.service.datastore.DistrictSellStatService; import com.fangjia.service.datastore.DistrictService; import com.fangjia.service.datastore.HouseService; @@ -146,15 +143,16 @@ public class TrendController { } //List upDistricts = districtService.findTop(city, 10, false); - model.setUpTop5(findDistrictsAvgPrice(city, 10, false)); +// model.setUpTop5(findDistrictsAvgPrice(city, 10, false)); //List downDistricts = districtService.findTop(city, 10, true); - model.setDownTop5(findDistrictsAvgPrice(city, 10, true)); +// model.setDownTop5(findDistrictsAvgPrice(city, 10, true)); prepareRegionBlock(city, model); model.setRegionItems(getRegionItems(model)); model.setBlockItems(getRegionBlocks(model)); + model.setCityStatInfoBos(findCitysAvgPrice(10)); model.setDefaultCityName(city); TrendView trendView = TrendViewFactory.getInstance().create(model); if (trendView == null) { @@ -258,6 +256,67 @@ public class TrendController { return Collections.EMPTY_LIST; } + /** + * ³ÇÊз¿¼ÛÅÅÐÐ + */ + private List findCitysAvgPrice(int limit){ + + List cityStatInfoBos = new ArrayList(); + + Date date = new Date(); + //µ±ǰ³ÇÊоù¼Û + Date weekend = DateUtil.getFirstDayOfWeek(date); + List regionStats = regionStatService.findCityStatByWeekend(weekend,limit); + + List cityNames = new ArrayList(); + for(RegionStat regionStat : regionStats){ + cityNames.add(regionStat.getCity()); + } + //ÉϸöÔ³ÇÊоù¼Û + Date lastMonthDate = DateUtil.getThisWeekInLastMonth(-1); + Date lastWeekend = DateUtil.getFirstDayOfWeek(lastMonthDate); + List lastMonthRegionStats = regionStatService.findCityStatByWeekend(lastWeekend,cityNames,limit); + //ȥÄê³ÇÊоù¼Û + Date lastYearDate = DateUtil.getThisWeekInLastYear(); + Date lastYearWeekend = DateUtil.getFirstDayOfWeek(lastYearDate); + List lastYearRegionStats = regionStatService.findCityStatByWeekend(lastYearWeekend,cityNames,limit); + + DecimalFormat df = new DecimalFormat("0.00%"); + + for(int i=0;i cityStatInfoBos; private List relatedCityStats; private List upTop5; private List downTop5; @@ -325,4 +322,12 @@ public class TrendModel extends BaseModel implements TrendViewModel { public void setCount(int count) { this.count = count; } + + public List getCityStatInfoBos() { + return cityStatInfoBos; + } + + public void setCityStatInfoBos(List cityStatInfoBos) { + this.cityStatInfoBos = cityStatInfoBos; + } } diff --git a/projects/fangjia-coresite/src/main/webapp/evaluation/reportNew.ftl b/projects/fangjia-coresite/src/main/webapp/evaluation/reportNew.ftl index 93afbcb41..5eecf2652 100644 --- a/projects/fangjia-coresite/src/main/webapp/evaluation/reportNew.ftl +++ b/projects/fangjia-coresite/src/main/webapp/evaluation/reportNew.ftl @@ -1,28 +1,23 @@ - -${cityName}房产在线评估 - 房价网 fangjia.com - - + + ${cityName}房产在线评估 - 房价网 fangjia.com + + - - - - - - - - - - + + + + + -<#include "/header/v5/_footer.ftl"/> +<#include "/header/v6/_footer.ftl"/> <#include "../citys.ftl"/> @@ -926,8 +887,10 @@ function errorMsg(id) { var reg = /^[0-9]+.?[0-9]*$/; if(id=="selectedCity" && $("#selectedCity").val().trim()==""){ + alert("selectedCity is null") $("#selectedCityError").show(); }else{ + alert("selectedCity is not null") $("#selectedCityError").hide(); } if(id=="districtName" && $("#districtName").val().trim()==""){ diff --git a/projects/fangjia-coresite/src/main/webapp/header/v6/_city_select.ftl b/projects/fangjia-coresite/src/main/webapp/header/v6/_city_select.ftl new file mode 100644 index 000000000..589aa1dde --- /dev/null +++ b/projects/fangjia-coresite/src/main/webapp/header/v6/_city_select.ftl @@ -0,0 +1,491 @@ + + + +<#if controllerName == "rentHouseSearch" && actionName = "list"> + <#assign _city_uri>zufang +<#elseif controllerName == "rentHouse" && actionName = "show"> + <#assign _city_uri>zufang +<#elseif controllerName == "sellHouseSearch" && actionName = "list"> + <#assign _city_uri>ershoufang +<#elseif controllerName == "apartment" && actionName = "list"> + <#assign _city_uri>apartment/list +<#elseif controllerName == "house" && actionName = "show"> + <#assign _city_uri>ershoufang +<#elseif controllerName == "trend" && actionName = "trend"> + <#assign _city_uri>zoushi +<#elseif controllerName == "districtReport" && actionName = "intro"> + <#assign _city_uri>diaocha +<#elseif controllerName == "evaluation" && (actionName = "reportNew"|| actionName = "evalResult" || actionName == 'goReport')> + <#assign _city_uri>gujia +<#else> + <#assign _city_uri>index + + + + + + + + + + + \ No newline at end of file diff --git a/projects/fangjia-coresite/src/main/webapp/header/v6/_header.ftl b/projects/fangjia-coresite/src/main/webapp/header/v6/_header.ftl index 6d9ebb206..1efe3809f 100644 --- a/projects/fangjia-coresite/src/main/webapp/header/v6/_header.ftl +++ b/projects/fangjia-coresite/src/main/webapp/header/v6/_header.ftl @@ -66,18 +66,18 @@
  • 房产大数据 -
  • -
  • 行业动态
  • +<#--
  • 行业动态
  • -->