From d338b50afd6504a9676f0a26b3ecbcc844483e7c Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期四, 21 十一月 2024 08:57:08 +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