From aa0382e44311f9f7e62a688c8fcaa9c69a512e0f Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期二, 24 十二月 2024 15:15:10 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/CalculateHandle.java |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/CalculateHandle.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/CalculateHandle.java
index 699ea60..f140509 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/CalculateHandle.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/collection/handler/CalculateHandle.java
@@ -1,5 +1,6 @@
 package com.iailab.module.data.point.collection.handler;
 
+import com.iailab.framework.common.util.string.StrUtils;
 import com.iailab.module.data.common.enums.CommonConstant;
 import com.iailab.module.data.common.enums.DataTypeEnum;
 import com.iailab.module.data.common.enums.JsErrorCode;
@@ -143,7 +144,14 @@
             pointNos.add(s);
             dataMap.putAll(measureHandle.getCurrent(pointNos));
             dataMap.putAll(constantHandle.getCurrent(pointNos));
-            expression = expression.replace(s, dataMap.get(s).toString());
+            String valueStr =  dataMap.get(s).toString();
+            if (StrUtils.isNumeric(valueStr) && new BigDecimal(valueStr).compareTo(CommonConstant.BAD_VALUE) == 0) {
+                log.info("BAD_VALUE:" + s);
+            }
+            if (StrUtils.isNumeric(valueStr) && new BigDecimal(valueStr).compareTo(BigDecimal.ZERO) < 0) {
+                valueStr = "(" + valueStr + ")";
+            }
+            expression = expression.replace(s, valueStr);
         }
         expression = expression.replace("&", "&&");
         expression = expression.replace("|", "||");

--
Gitblit v1.9.3