From 97d38f7b7f7d95fe38cdbb79960106c15454b6ba Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期二, 19 十一月 2024 15:23:51 +0800
Subject: [PATCH] 预警信息

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
index 0c2d4f5..b358b99 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java
@@ -23,6 +23,7 @@
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * @author PanZhibao
@@ -334,6 +335,15 @@
             default:
                 break;
         }
+
+        if (!CollectionUtils.isEmpty(dataView.getCurData())) {
+            List<Double> curList = dataView.getCurData().stream().map(t -> {
+                return new Double(t[1].toString());
+            }).collect(Collectors.toList());
+            dataView.setPreMax(new BigDecimal(curList.stream().mapToDouble(Double::doubleValue).max().getAsDouble()).setScale(2, BigDecimal.ROUND_HALF_UP));
+            dataView.setPreMin(new BigDecimal(curList.stream().mapToDouble(Double::doubleValue).min().getAsDouble()).setScale(2, BigDecimal.ROUND_HALF_UP));
+        }
+
         result.setStartTime(startTime);
         result.setEndTime(endTime);
         result.setCategories(categories);

--
Gitblit v1.9.3