Переглянути джерело

数据质量专项IOT数据优化

zhangqiankun 3 роки тому
батько
коміт
b36701dcc9

+ 2 - 2
src/main/java/com/persagy/netty/collect/ReturnDifferentAlarm.java

@@ -139,12 +139,12 @@ public class ReturnDifferentAlarm {
 			if (StrUtil.isBlank(data)) {
 				return;
 			}
-			String[] split = data.split(";");
+			String[] split = data.split(";", -1);
 			String dataTime = split[0];
 			String meter = split[1];
 			String funcid = split[2];
 			String valueStr = split[3];
-			if (StrUtil.isBlank(valueStr)) {
+			if (StrUtil.isBlank(valueStr) || "null".equalsIgnoreCase(valueStr)) {
 				return;
 			}
 			BigDecimal dataValue = new BigDecimal(split[3]);

+ 2 - 2
src/main/java/com/persagy/service/impl/AlarmHandleServiceImpl.java

@@ -82,7 +82,7 @@ public class AlarmHandleServiceImpl implements AlarmHandleService {
 		if (StrUtil.isBlank(msg)) {
 			return;
 		}
-        String[] split = msg.split(";");
+        String[] split = msg.split(";", -1);
         if (split.length % 4 != 0) {
             return;
         }
@@ -93,7 +93,7 @@ public class AlarmHandleServiceImpl implements AlarmHandleService {
             String meterId = split[i * 4 + 1];
             String funcId = split[i * 4 + 2];
             String valueStr = split[i * 4 + 3];
-            if (StrUtil.isNotBlank(valueStr)) {
+            if (StrUtil.isNotBlank(valueStr) || "null".equalsIgnoreCase(valueStr)) {
             	double value = Double.parseDouble(valueStr);
                 if (AlarmInfoCache.hasKey(meterId, funcId)) {
                     validIotData(dateTime, meterId, funcId, value);

+ 1 - 1
src/main/resources/application-XGPj5001120003.yml

@@ -29,7 +29,7 @@ remote:
     # iot-project服务
     project:
       # 需要更改,修改其中的项目ID和ip、port,其中port为websocket的端口,切记不是服务端口
-      websocket: ws://192.168.100.102:30055/websocket?projectId=5001120003&type=pointset,iot
+      websocket: ws://192.168.100.102:30055/websocket?projectId=5001120003&type=pointset,iot&getFullData=true
   # 管理范围服务地址
   persagy:
     zkt:

+ 1 - 1
src/main/resources/application-ZSPj4403050019.yml

@@ -29,7 +29,7 @@ remote:
     # iot-project服务
     project:
       # 需要更改,修改其中的项目ID和ip、port,其中port为websocket的端口,切记不是服务端口
-      websocket: ws://39.96.55.242:9980/websocket?projectId=4403050019&type=pointset,iot
+      websocket: ws://39.96.55.242:9980/websocket?projectId=4403050019&type=pointset,iot&getFullData=true
   # 管理范围服务地址
   persagy:
     zkt: