From cd069965f32189683598ac1096dab66c992c517b Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 14 三月 2025 16:36:10 +0800
Subject: [PATCH] BAD点值修复

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java
index 14395b3..6002f45 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java
@@ -2,6 +2,7 @@
 
 import com.iailab.framework.common.util.string.StrUtils;
 import com.iailab.module.data.channel.http.collector.SourceApiEnum;
+import com.iailab.module.data.channel.http.collector.asdb.HttpCollectorForAsdb;
 import com.iailab.module.data.channel.http.collector.ihdb.HttpCollectorForIhd;
 import com.iailab.module.data.channel.opcda.collector.OpcDACollector;
 import com.iailab.module.data.common.enums.CommonConstant;
@@ -40,10 +41,6 @@
 @Component
 public class MeasureHandle {
 
-    private BigDecimal maxValue = new BigDecimal("1000000000");
-
-    private BigDecimal minValue = new BigDecimal("0");
-
     @Resource
     private ModBusCollector modBusCollector;
 
@@ -58,6 +55,9 @@
 
     @Autowired
     private HttpCollectorForIhd httpCollectorForIhd;
+
+    @Autowired
+    private HttpCollectorForAsdb httpCollectorForAsdb;
 
     @Resource
     private DaPointService daPointService;
@@ -77,7 +77,7 @@
         List<String[]> modbusTagIds = new ArrayList<>();
         List<String[]> kioTagIds = new ArrayList<>();
         List<Object[]> httpTagIhd = new ArrayList<>();
-
+        List<Object[]> httpTagAsdb = new ArrayList<>();
 
         dtos.stream().forEach(item -> {
             if (DataSourceType.OPCUA.getCode().equals(item.getSourceType())) {
@@ -92,6 +92,10 @@
                 if (SourceApiEnum.iHyperDB.getCode().equals(item.getSourceName())) {
                     if (item.getTagNo() != null && item.getDimension() != null && item.getValueType() != null) {
                         httpTagIhd.add(new Object[]{item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType()});
+                    }
+                } else if (SourceApiEnum.ASDB.getCode().equals(item.getSourceName())) {
+                    if (item.getTagNo() != null && item.getDimension() != null && item.getValueType() != null) {
+                        httpTagAsdb.add(new Object[]{item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType()});
                     }
                 }
             }
@@ -112,6 +116,9 @@
         }
         if (!CollectionUtils.isEmpty(httpTagIhd)) {
             tagValues.putAll(httpCollectorForIhd.getTagValues(httpTagIhd, collectTime));
+        }
+        if (!CollectionUtils.isEmpty(httpTagAsdb)) {
+            tagValues.putAll(httpCollectorForAsdb.getTagValues(httpTagAsdb, collectTime));
         }
         this.toCommonResult(collectTime, dtos, tagValues, dataMap, result,listGood,listBad);
         log.info("测量点处理结束");
@@ -198,7 +205,11 @@
                         } else if (DataSourceType.KIO.getCode().equals(item.getSourceType())) {
                             value = kingIOCollector.getTagValue(item.getSourceId(), item.getTagNo());
                         } else if (DataSourceType.HTTP.getCode().equals(item.getSourceType())) {
-                            value = httpCollectorForIhd.getTagValue(item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType());
+                            if (SourceApiEnum.iHyperDB.getCode().equals(item.getSourceName())) {
+                                value = httpCollectorForIhd.getTagValue(item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType());
+                            } else if (SourceApiEnum.ASDB.getCode().equals(item.getSourceName())) {
+                                value = httpCollectorForAsdb.getTagValue(item.getSourceId(), item.getTagNo());
+                            }
                         } else {
                             log.info("没有匹配的TagNo=" + item.getTagNo());
                         }

--
Gitblit v1.9.3