From 1cb32f7ef8d292140a090bb838aae09b413825b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=81=A5?= Date: Fri, 13 Jun 2025 10:58:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=9D=BF=E5=9D=97=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E9=80=A0=E5=9F=8E=E5=B8=82=E5=9D=87=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coresite/controllers/TrendController.java | 31 +++++++++++------ .../src/main/webapp/trend/trend.ftl | 34 +++++++++++-------- 2 files changed, 39 insertions(+), 26 deletions(-) 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 9d83f1f56..c57c15dbb 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 @@ -669,6 +669,7 @@ public class TrendController { private List buildStatJson(String city, String region, String block, int weeks) { List regionStatList = null; + List citySellStatList = null; Map oprions = new HashMap(); Date currentDate = new Date(); if (city != null && region != null && block != null) { @@ -678,22 +679,30 @@ public class TrendController { regionStatList = regionStatService.findRegionStat(city, region, null, currentDate, weeks); oprions.put("name", region); } else if (city != null) { - regionStatList = regionStatService.findRegionStat(city, null, null, currentDate, weeks); + //regionStatList = regionStatService.findRegionStat(city, null, null, currentDate, weeks); + int month = weeks / 4; + citySellStatList = citySellStatService.getAllWithMonths(city, month); oprions.put("name", city); } List ret = new ArrayList(); - if (regionStatList == null) { - return null; - } - JSONArray splineJa = new JSONArray(); - for (RegionStat re : regionStatList) { - JSONArray ja = new JSONArray(); - ja.put(DateUtil.getBeforeDay(re.getWeekend(), -1).getTime()); - ja.put(re.getAvgPrice()); - splineJa.put(ja); + if (CollectionUtils.isNotEmpty(regionStatList)) { + for (RegionStat re : regionStatList) { + JSONArray ja = new JSONArray(); + ja.put(DateUtil.getBeforeDay(re.getWeekend(), -1).getTime()); + ja.put(re.getAvgPrice()); + splineJa.put(ja); + } + } else if (CollectionUtils.isNotEmpty(citySellStatList)) { + for (int i = citySellStatList.size() - 1; i >= 0; i--) { + CitySellStat re = citySellStatList.get(i); + JSONArray ja = new JSONArray(); + ja.put(DateUtil.getBeforeDay(DateUtil.parseDate(re.getDate().toString(), "yyyyMM"), -1).getTime()); + ja.put(re.getAvgPrice()); + splineJa.put(ja); + } } if (splineJa.length() > 0) { @@ -822,7 +831,7 @@ public class TrendController { private CitySellStatBo getNearestCitySellStat(String city) { CitySellStatBo ret = null; List citySellStats = null; - Integer startDate = Integer.valueOf(DateUtil.formatToTightYYYYMMDD(DateUtils.addMonths(new Date(), -3))); + Integer startDate = Integer.valueOf(DateUtil.formatByPattern(DateUtils.addMonths(new Date(), -3), "yyyyMM")); citySellStats = citySellStatService.findNearCityStat(city, startDate, 2); if(citySellStats!=null && citySellStats.size()>0){ CitySellStatBo bo = new CitySellStatBo(); diff --git a/projects/fangjia-coresite/src/main/webapp/trend/trend.ftl b/projects/fangjia-coresite/src/main/webapp/trend/trend.ftl index c3fbbf0d3..7ba92620a 100644 --- a/projects/fangjia-coresite/src/main/webapp/trend/trend.ftl +++ b/projects/fangjia-coresite/src/main/webapp/trend/trend.ftl @@ -113,12 +113,16 @@
- <#if districtStatBo?? || regionStatBo??> + <#if districtStatBo?? || regionStatBo?? || citySellStatBo??> <#if count??>
${count!}
<#if districtStatBo??>
<#if districtStatBo.lastTimeDistrictStat??>${districtStatBo.lastTimeDistrictStat.avgPrice}<#else>暂无
<#if districtStatBo.districtStat??>${districtStatBo.districtStat.avgPrice}<#else>暂无
${(districtStatBo.districtStat.weekendMarkup/100)?string('0.00')}%
+ <#elseif citySellStatBo??> +
${citySellStatBo.lastTimeAvgPrice!}
+
${citySellStatBo.avgPrice!}
+
${(citySellStatBo.monthMarkup/100)?string('0.00')}%
<#elseif regionStatBo??>
${regionStatBo.lastTimeAvgPrice!}
${regionStatBo.avgPrice!}
@@ -145,21 +149,21 @@
- <#if blockItems?? && blockItems?size gt 0> - <#if block??>${block!}<#else>板块 - - - +<#-- <#if blockItems?? && blockItems?size gt 0>--> +<#-- <#if block??>${block!}<#else>板块--> +<#-- --> +<#-- --> +<#-- -->
- <#if districtStatBo?? || regionStatBo??> + <#if districtStatBo?? || regionStatBo?? || citySellStatBo??>
  • 下载
  • 打印
  • @@ -181,7 +185,7 @@
    - <#if districtStatBo?? || regionStatBo??> + <#if districtStatBo?? || regionStatBo?? || citySellStatBo??> <#else>
    @@ -478,7 +482,7 @@ var down_pic_temp = 0; $(document).ready(function(){ //走势图 - <#if districtStatBo?? || regionStatBo??> + <#if districtStatBo?? || regionStatBo?? || citySellStatBo??> <#if type??> <#if type == '4' || type == 'quarter'> var url = Constants.cityUrl + '/trend/quarterData?defaultCityName=${cityName}&districtName=${districtName!}®ion=${region!}&block=${block!}&keyword=${keyword!}';