From c4dc2a5bf8e5a1f95e517c7104eca0df4399e3d9 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期日, 15 十二月 2024 11:14:31 +0800
Subject: [PATCH] 测点采集

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java          |    9 +++++++--
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/collector/ihdb/HttpCollectorForIhd.java |    5 -----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/collector/ihdb/HttpCollectorForIhd.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/collector/ihdb/HttpCollectorForIhd.java
index a37fe83..df09772 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/collector/ihdb/HttpCollectorForIhd.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/collector/ihdb/HttpCollectorForIhd.java
@@ -266,11 +266,6 @@
             StringBuilder tagSb = new StringBuilder();
             tagSb.append("[");
             for (int i = 0; i < params.size(); i++) {
-                if (StringUtils.isBlank(params.get(i)[1].toString()) ||
-                        StringUtils.isBlank(params.get(i)[2].toString()) ||
-                        StringUtils.isBlank(params.get(i)[3].toString())) {
-                    continue;
-                }
                 Map<String, Object> queryParams = new HashMap<>(3);
                 queryParams.put(N, params.get(i)[1]);
                 queryParams.put(D, params.get(i)[2]);
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 e736795..c97aa8b 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
@@ -83,7 +83,9 @@
                 kioTagIds.add(new String[]{item.getSourceId(), item.getTagNo()});
             } else if (DataSourceType.HTTP.getCode().equals(item.getSourceType())) {
                 if (SourceApiEnum.iHyperDB.getCode().equals(item.getSourceName())) {
-                    httpTagIhd.add(new Object[]{item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType()});
+                    if (item.getTagNo() != null && item.getDimension() != null && item.getValueType() != null) {
+                        httpTagIhd.add(new Object[]{item.getSourceId(), item.getTagNo(), item.getDimension(), item.getValueType()});
+                    }
                 }
             }
         });
@@ -138,9 +140,12 @@
             }
             if (DataTypeEnum.FLOAT.getCode().equals(dto.getDataType()) || DataTypeEnum.INT.getCode().equals(dto.getDataType())) {
                 BigDecimal rawValue = new BigDecimal(value.toString());
+                if(CommonConstant.BAD_VALUE.compareTo(rawValue) == 0) {
+                    return CommonConstant.BAD_VALUE;
+                }
                 // 异常值处理
                 if (rawValue.compareTo(maxValue) > 0 || rawValue.compareTo(minValue) < 0) {
-                    rawValue = CommonConstant.BAD_VALUE;
+                    return CommonConstant.BAD_VALUE;
                 }
                 BigDecimal coefficient = dto.getUnittransfactor() == null ? BigDecimal.ONE : dto.getUnittransfactor();
                 BigDecimal calValue = rawValue.multiply(coefficient);

--
Gitblit v1.9.3