From b546994ced2db809d4efe9a7a338892c4df27e75 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期五, 16 六月 2023 17:43:47 +0800
Subject: [PATCH] 1

---
 src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java b/src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java
index afb8bf4..28381b2 100644
--- a/src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java
+++ b/src/main/java/com/yssh/service/impl/WarningAnalyseServiceImpl.java
@@ -368,7 +368,7 @@
     }
 
     @Override
-    public List<WarningVo> getAlarmAndWarnByTime(Date begin, Date end) {
+    public List<Report> getAlarmAndWarnByTime(Date begin, Date end) {
         String startTime = ymdhms.format(begin);
         String endTime = ymdhms.format(end);
 
@@ -379,10 +379,22 @@
         List<WarningDetail> rsBj = warningDetailMapper.selectByTimeForBj(startTime, endTime);
         if (null != rsBj && rsBj.size() > 0) rs.addAll(rsBj);
 
-        List<WarningVo> list = new ArrayList<>();
+        List<Report> list = new ArrayList<>();
         for (WarningDetail wd : rs) {
-            String time = ymdh.format(wd.getCreateTime());
-            list.add(new WarningVo(wd.getLocationName(), wd.getSuYuanId(), 0.0, 0.0, wd.getValue(), time));
+            //String time = ymdh.format(wd.getCreateTime());
+            //list.add(new WarningVo(wd.getLocationName(), wd.getSuYuanId(), 0.0, 0.0, wd.getValue(), time));
+
+            int rows = suYuanMapper.isTableExists(wd.getTableName());
+
+            DistanceSuYuan suYuan = null;
+            if (rows > 0) {
+                MonitorPointPosition point = commonService.select3dCheckPointByName(wd.getLocationName());
+                List<String> ids3d = CalculateUtils.aloneCrosswiseExtend(point, 50);
+                suYuan = suYuanMapper.getSuYuan500Max(wd.getTableName(), ids3d);
+            }
+
+            Report report = Report.calcReport(wd, suYuan);
+            list.add(report);
         }
 
         return list;

--
Gitblit v1.9.3