소스 검색

add:
阿里云多数据源订阅

18339543638 1 년 전
부모
커밋
d722bc00e9

+ 0 - 9
nb-admin/src/main/resources/application-dev.yml

@@ -141,15 +141,6 @@ iot:
 aliyun:
   accessKey: "LTAI4G7FA9ytMc76oNkJ45YJ"
   accessSecret: "R7hOvMfiHb0PYroDqUDXAYgB9htQss"
-  consumerGroupId: "NZKDBbvhxUqtcF5VqDb2000100"
-  aliyunUid: "1238892013759131"
-  regionId: "cn-shanghai"
-  # iotInstanceId:企业版实例请填写实例ID,公共实例请填空字符串""。
-  iotInstanceId: "iot-060a0bgd"
-  server-subscription:
-    enable: false  # 是否开启阿里云物联网服务端订阅
-  product:
-    productKey: he1fACg7ySx
 
 oss:
   aliyun:

+ 1 - 1
nb-service-api/web-service-api/src/main/java/com/nb/web/api/entity/common/BusDeviceRunningEntity.java

@@ -183,7 +183,7 @@ public class BusDeviceRunningEntity extends CommonDeviceParam<String,String> {
 
         this.setSelfControlLockTime(items.getBigDecimal(PumpParams.lockTime));
 
-        this.setTest(StrUtil.equals("2",items.getString(PumpParams.dataType)));
+        this.setTest(StrUtil.equals("2",items.getStringReturnDefault(PumpParams.dataType,"1")));
 
         this.setContinueDose(items.getBigDecimal(PumpParams.flow));
         this.setType( DeviceTypeUtils.getDeviceType(items.getInteger(PumpParams.pumpType)));

+ 9 - 0
nb-service-api/web-service-api/src/main/java/com/nb/web/api/utils/Items.java

@@ -1,5 +1,6 @@
 package com.nb.web.api.utils;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.alibaba.fastjson.JSONObject;
 import lombok.AllArgsConstructor;
 
@@ -20,6 +21,14 @@ public class Items {
 
     private JSONObject items;
 
+    public String getStringReturnDefault(PumpParams param,String defaultResult){
+        JSONObject result = items.getJSONObject(param.getParam());
+        if(ObjectUtil.isNull(result)){
+            return defaultResult;
+        }
+        return result.getString(VALUE);
+    }
+
     public String getString(PumpParams param){
         return items.getJSONObject(param.getParam()).getString(VALUE);
     }