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/service/WarningAnalyseService.java |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/yssh/service/WarningAnalyseService.java b/src/main/java/com/yssh/service/WarningAnalyseService.java
index e1ee99c..ddc29a7 100644
--- a/src/main/java/com/yssh/service/WarningAnalyseService.java
+++ b/src/main/java/com/yssh/service/WarningAnalyseService.java
@@ -3,6 +3,7 @@
 import java.util.*;
 import java.util.concurrent.CountDownLatch;
 
+import com.yssh.config.InitConfig;
 import com.yssh.entity.*;
 import com.yssh.mapper.DictRecordMapper;
 import com.yssh.mapper.QxshMapper;
@@ -71,10 +72,11 @@
         List<Qxsh> list = CacheUtils.getListByKey(key);
         if (null == list) {
             list = qxshMapper.selectAlarmByBeginAndEnd(start, end);
+            copeHasSuYuan(list);
             CacheUtils.putListByKey(key, list);
         }
 
-        return copeHasSuYuan(list);
+        return list;
     }
 
     /**
@@ -86,10 +88,11 @@
         List<Qxsh> list = CacheUtils.getListByKey(key);
         if (null == list) {
             list = qxshMapper.selectWarnByBeginAndEnd(start, end);
+            copeHasSuYuan(list);
             CacheUtils.putListByKey(key, list);
         }
 
-        return copeHasSuYuan(list);
+        return list;
     }
 
     /**
@@ -184,7 +187,7 @@
      * 鑾峰彇鏈湀鐩戞祴绔欑偣鏈�澶у�糡OP10
      */
     public List<Qxsh> selectMonthTop10() {
-        String time = DateUtils.getYyyyMm(new Date());
+        String time = DateUtils.getYyyyMm(InitConfig.getDate());
         //List<Qxsh> list = qxshMapper.selectMonthTop10(time + "%");
 
         String key = "qxshMapper.selectMonthTop10." + time;
@@ -201,7 +204,7 @@
      * 鑾峰彇鏈懆鐩戞祴绔欑偣鏈�澶у�糡OP10
      */
     public List<Qxsh> selectWeekTop10() {
-        Date now = new Date();
+        Date now = InitConfig.getDate();
         int weekOfYear = DateUtils.getWeekOfYear(now);
         int year = Integer.parseInt(DateUtils.parseDateToStr(DateUtils.YYYY, now));
         Date lastSun = DateUtils.getWeekOfYearForSun(year, weekOfYear);
@@ -225,7 +228,7 @@
      * 鑾峰彇鏈棩鐩戞祴绔欑偣鏈�澶у�糡OP10
      */
     public List<Qxsh> selectDayTop10() {
-        String time = DateUtils.getYyyyMmDd(new Date());
+        String time = DateUtils.getYyyyMmDd(InitConfig.getDate());
         //List<Qxsh> list = qxshMapper.selectDayTop10(time + "%");
 
         String key = "qxshMapper.selectDayTop10." + time;
@@ -262,12 +265,20 @@
 
             WarningDetail wd = new WarningDetail(0L, tab, suYuanId, qxsh.getName(), null, 0, qxsh.getValue());
             DistanceSuYuan suYuan = suYuanMapper.getSuYuanById(tab, suYuanId);
+            if (null == suYuan) {
+                String[] strs = suYuanId.split("_");
+                suYuan = new DistanceSuYuan(null, null, 0.0, suYuanId, Integer.parseInt(strs[0]), Integer.parseInt(strs[1]), 0, 0, null, 0.0, 0.0, 0.0, 0.0);
+            }
             //List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(point, 50);
             //DistanceSuYuan suMax = suYuanMapper.getSuYuan500Max(tab, ids3d);
 
             //String filter = CalculateUtils.getFilterByExtend(point, 50);
             String filter = getFilterByPoint(point, 50);
             DistanceSuYuan suMax = suYuanMapper.getSuYuan500MaxByFilter(tab, filter);
+            if (null == suMax) {
+                String[] strs = suYuanId.split("_");
+                suMax = new DistanceSuYuan(null, null, 0.0, suYuanId, Integer.parseInt(strs[0]), Integer.parseInt(strs[1]), 0, 0, null, 0.0, 0.0, 0.0, 0.0);
+            }
             suMax.setAddr(getAddr(suMax.getId()));
 
             Report report = Report.calcReport(wd, suYuan, suMax);

--
Gitblit v1.9.3