From 6b13839488edcd06046e26a41fe897358176689c Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 13 十二月 2024 17:56:41 +0800
Subject: [PATCH] 采集质量

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/MeasureHandle.java |    5 +++--
 1 files changed, 3 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 4d781a1..e736795 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
@@ -133,9 +133,11 @@
     private Object handleData(DaPointDTO dto, Object value) {
         Object result = value;
         try {
+            if (value == null) {
+                return CommonConstant.BAD_VALUE;
+            }
             if (DataTypeEnum.FLOAT.getCode().equals(dto.getDataType()) || DataTypeEnum.INT.getCode().equals(dto.getDataType())) {
                 BigDecimal rawValue = new BigDecimal(value.toString());
-
                 // 异常值处理
                 if (rawValue.compareTo(maxValue) > 0 || rawValue.compareTo(minValue) < 0) {
                     rawValue = CommonConstant.BAD_VALUE;
@@ -157,7 +159,6 @@
             } else if (DataTypeEnum.BOOLEAN.getCode().equals(dto.getDataType())) {
                 result = Boolean.parseBoolean(value.toString());
             }
-
         } catch (Exception ex) {
             log.warn("handleData异常,PointNo=" + dto.getPointNo());
             ex.printStackTrace();

--
Gitblit v1.9.3