From 849c3bfad21a3821f303413f82cda2d8d4d27733 Mon Sep 17 00:00:00 2001
From: dongyukun <1208714201@qq.com>
Date: 星期二, 05 十一月 2024 18:41:31 +0800
Subject: [PATCH] tag查当前值

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 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 455b836..41299ec 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
@@ -1,5 +1,6 @@
 package com.iailab.module.data.point.collection.handler;
 
+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;
 import com.iailab.module.data.common.enums.DataSourceType;
@@ -50,6 +51,9 @@
     @Autowired
     private OpcDACollector opcDACollector;
 
+    @Autowired
+    private HttpCollectorForIhd httpCollectorForIhd;
+
     @Resource
     private DaPointService daPointService;
 
@@ -64,7 +68,7 @@
         List<String[]> opcDaTagIds = new ArrayList<>();
         List<String[]> modbusTagIds = new ArrayList<>();
         List<String[]> kioTagIds = new ArrayList<>();
-        List<String[]> httpTagZxzk = new ArrayList<>();
+        List<Object[]> httpTagIhd = new ArrayList<>();
 
 
         dtos.stream().forEach(item -> {
@@ -76,6 +80,10 @@
                 modbusTagIds.add(new String[]{item.getSourceId(), item.getTagNo()});
             } else if (DataSourceType.KIO.getCode().equals(item.getSourceType())) {
                 kioTagIds.add(new String[]{item.getSourceId(), item.getTagNo()});
+            } else if (DataSourceType.HTTP.getCode().equals(item.getSourceType())) {
+                if (CommonConstant.iHyperDB.equals(item.getSourceName())) {
+                    httpTagIhd.add(new Object[]{item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType()});
+                }
             }
         });
 
@@ -91,6 +99,9 @@
         }
         if (!CollectionUtils.isEmpty(kioTagIds)) {
             tagValues.putAll(kingIOCollector.getTagValues(kioTagIds));
+        }
+        if (!CollectionUtils.isEmpty(httpTagIhd)) {
+            tagValues.putAll(httpCollectorForIhd.getTagValues(httpTagIhd));
         }
         this.toCommonResult(collectTime, dtos, tagValues, dataMap, result);
         log.info("测量点处理结束");
@@ -167,7 +178,7 @@
                         } 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());
                         } else {
                             log.info("没有匹配的TagNo=" + item.getTagNo());
                         }

--
Gitblit v1.9.3