diff options
| author | 李皓宸 <[email protected]> | 2019-06-21 15:53:08 +0800 |
|---|---|---|
| committer | 李皓宸 <[email protected]> | 2019-06-21 15:53:08 +0800 |
| commit | 8e15b0b019141ff9bb9508c3e3bf3c2d1539fb9d (patch) | |
| tree | 597e663cfa6226896dce117634ccb77be15ebd2f | |
| parent | 1daea740369d1ba57b9807a6817ac211b5e81797 (diff) | |
阻断监测统计接口 修改五分钟粒度 数据返回日期格式
| -rw-r--r-- | src/main/java/com/nis/web/service/restful/TrafficReportService.java | 13 |
1 files 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<String, Comparable> m = new HashMap<String, Comparable>();
- 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<Date> dateRangeList = new ArrayList<Date>();
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);
}
|
