From 8185e5cdc2bbdf7fb4ca46a10864106893a01ed3 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期三, 20 十一月 2024 15:30:12 +0800
Subject: [PATCH] 1

---
 src/main/java/com/yssh/controller/WarningAnalyseController.java |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/yssh/controller/WarningAnalyseController.java b/src/main/java/com/yssh/controller/WarningAnalyseController.java
index cd189ee..7032820 100644
--- a/src/main/java/com/yssh/controller/WarningAnalyseController.java
+++ b/src/main/java/com/yssh/controller/WarningAnalyseController.java
@@ -1,5 +1,6 @@
 package com.yssh.controller;
 
+import com.yssh.config.InitConfig;
 import com.yssh.entity.Report;
 import com.yssh.utils.CacheUtils;
 import com.yssh.utils.DateUtils;
@@ -54,7 +55,7 @@
     private Integer getStartTime(Date start, Date end) {
         do {
             if (null == start && null == end) {
-                start = DateUtils.getAPeriodOfTime(new Date(), -5, Calendar.HOUR_OF_DAY);
+                start = DateUtils.getAPeriodOfTime(InitConfig.getDate(), -5, Calendar.HOUR_OF_DAY);
                 break;
             }
             if (null != start && null == end) {
@@ -74,7 +75,7 @@
     private Integer getEndTime(Date start, Date end) {
         do {
             if (null == start && null == end) {
-                end = new Date();
+                end = InitConfig.getDate();
                 break;
             }
             if (null != start && null == end) {
@@ -95,21 +96,21 @@
     @ApiOperation(value = "鏈湀棰勮鎶ヨ缁熻", notes = "鏈湀棰勮鎶ヨ缁熻锛岃繑鍥炲弬鏁癮larmNumber瀵瑰簲鍊间负鏈湀鎶ヨ鏁版嵁閲忥紝鍙傛暟warningNumber瀵瑰簲鍊间负鏈湀棰勮鏁版嵁閲�")
     @GetMapping("/monthCount")
     public Result thisMonthCount(@RequestParam(value = "date", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
-        return Result.OK(warningService.monthCount(null == date ? new Date() : date));
+        return Result.OK(warningService.monthCount(null == date ? InitConfig.getDate() : date));
     }
 
     @ApiOperationSupport(order = 4)
     @ApiOperation(value = "涓�鍛ㄩ璀︽姤璀︽暟閲忓彉鍖栬秼鍔�", notes = "涓�鍛ㄩ璀︽姤璀︽暟閲忓彉鍖栬秼鍔匡紝杩斿洖鍙傛暟alarmDayCount涓轰竴鍛ㄦ瘡鏃ユ姤璀︾粺璁℃暟閲忓垪琛紝鍙傛暟warningDayCount涓轰竴鍛ㄦ瘡鏃ラ璀︾粺璁℃暟閲忓垪琛�")
     @GetMapping("/everydayCount")
     public Result everydayCount(@RequestParam(value = "date", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
-        return Result.OK(warningService.everydayCount(null == date ? new Date() : date));
+        return Result.OK(warningService.everydayCount(null == date ? InitConfig.getDate() : date));
     }
 
     @ApiOperationSupport(order = 5)
     @ApiOperation(value = "涓夊皬鏃剁洃娴嬬珯鐐规暟鎹彉鍖栬秼鍔�", notes = "杩斿洖鍊间负涓夊皬鏃剁洃娴嬬珯鐐圭洃娴嬫暟鎹紝杩斿洖鍊间负map闆嗗悎锛屽叾涓璳ey涓虹珯鐐瑰悕绉帮紝value涓簂ist闆嗗悎锛屼繚瀛樻瘡澶╃洃娴嬫暟鍊兼暟鎹�")
     @GetMapping("/locationDataChange")
     public Result locationDataChange(@RequestParam(value = "end", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) {
-        return Result.OK(warningService.select3Hours(null == date ? new Date() : date));
+        return Result.OK(warningService.select3Hours(null == date ? InitConfig.getDate() : date));
     }
 
     @ApiOperationSupport(order = 6)

--
Gitblit v1.9.3