From 8e15b0b019141ff9bb9508c3e3bf3c2d1539fb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=9A=93=E5=AE=B8?= Date: Fri, 21 Jun 2019 15:53:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=BB=E6=96=AD=E7=9B=91=E6=B5=8B=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=8E=A5=E5=8F=A3=20=E4=BF=AE=E6=94=B9=E4=BA=94?= =?UTF-8?q?=E5=88=86=E9=92=9F=E7=B2=92=E5=BA=A6=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=97=A5=E6=9C=9F=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/restful/TrafficReportService.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/nis/web/service/restful/TrafficReportService.java b/src/main/java/com/nis/web/service/restful/TrafficReportService.java index 7188966..fee55c5 100644 --- a/src/main/java/com/nis/web/service/restful/TrafficReportService.java +++ b/src/main/java/com/nis/web/service/restful/TrafficReportService.java @@ -320,12 +320,17 @@ public class TrafficReportService extends BaseLogService { // entrance1.addAll(entrance2); if (!StringUtil.isEmpty(entrance1)) { // Map m = new HashMap(); - Date beginDate = DateUtils.parseDate(begin); - Date endDate = DateUtils.parseDate(end); +// Date beginDate = ; + + Long beginDate = DateUtils.getTimeByType(DateUtils.parseDate(begin).getTime(), + (Integer.valueOf(searchBusinessType) - 1)); + Long endDate = DateUtils.getTimeByType(DateUtils.parseDate(end).getTime(), + (Integer.valueOf(searchBusinessType) - 1)); + Date endDateTimes = new Date(endDate); List dateRangeList = new ArrayList(); Calendar calendar = Calendar.getInstance(); - calendar.setTime(beginDate); + calendar.setTime(new Date(beginDate)); // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); int trend_time_interval = 0; int unit = 0; @@ -345,7 +350,7 @@ public class TrafficReportService extends BaseLogService { unit = Calendar.YEAR; trend_time_interval = 1; } - while (calendar.getTime().compareTo(endDate) < 0) { + while (calendar.getTime().compareTo(endDateTimes) < 0) { dateRangeList.add(calendar.getTime()); calendar.add(unit, trend_time_interval); }