From c17a0d27b6a2e9e0ebda4ee584b6b2fdf4e323ca Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期三, 05 十一月 2025 12:46:14 +0800
Subject: [PATCH] 数采调整
---
cnas-device/src/main/java/com/ruoyi/device/utils/DataAcquisition.java | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/cnas-device/src/main/java/com/ruoyi/device/utils/DataAcquisition.java b/cnas-device/src/main/java/com/ruoyi/device/utils/DataAcquisition.java
index 751b778..ebe5dd4 100644
--- a/cnas-device/src/main/java/com/ruoyi/device/utils/DataAcquisition.java
+++ b/cnas-device/src/main/java/com/ruoyi/device/utils/DataAcquisition.java
@@ -277,7 +277,7 @@
// 浠� JSON 鏁版嵁涓彁鍙� data 鏁扮粍
JSONArray dataList = JSONArray.parseArray(jsonObject.get("data").toString());
dataConfig.forEach((k, v) -> {
- AtomicInteger numberOfDataEntries = new AtomicInteger();
+ AtomicInteger numberOfDataEntries = new AtomicInteger(0);
List<Object> list = new ArrayList<>();
for (int config = 0; config < v.size(); config++) {
// String refery = v.get(config).getRefery();
@@ -295,15 +295,15 @@
List<Object> result = new ArrayList<>();
for (int i = 0; i < numberOfDataEntries.get(); i++) {
String aggregate = "";
- for (int j = 0; j < v.size(); j++) {
- int index;
- if (j == 0) {
- index = i;
- } else {
- index = numberOfDataEntries.get() + i;
- }
- aggregate += list.get(index).toString() + ",";
- }
+// for (int j = 0; j < v.size(); j++) {
+// int index;
+// if (j == 0) {
+// index = i;
+// } else {
+// index = numberOfDataEntries.get() + i;
+// }
+// }
+ aggregate += list.get(i).toString() + ",";
int lastIndex = aggregate.lastIndexOf(",");
String substring = aggregate.substring(0, lastIndex);
result.add(substring);
--
Gitblit v1.9.3