TRX 1 år sedan
förälder
incheckning
2c01a7bade

+ 1 - 1
OneCardIotClient/src/main/java/com/zhongshu/iot/client/model/iot/IotTemplate2DeviceSearch.java

@@ -31,7 +31,7 @@ public class IotTemplate2DeviceSearch extends SuperSearchParam {
     private DeviceType deviceType;
 
     @Schema(description = "设备型号")
-    private DeviceSpecType deviceModel;
+    private DeviceSpecType specType;
 
     @Schema(description = "所属项目code")
     private String projectInfoCode;

+ 1 - 1
OneCardIotClient/src/main/java/com/zhongshu/iot/client/model/mqtt/DeviceInfoAddParam.java

@@ -31,7 +31,7 @@ public class DeviceInfoAddParam extends SuperParam {
     private DeviceType deviceType;
 
     @Schema(description = "设备型号")
-    private DeviceSpecType deviceModel;
+    private DeviceSpecType specType;
 
     @Schema(description = "ip地址")
     private String ip;

+ 1 - 1
OneCardIotClient/src/main/java/com/zhongshu/iot/client/model/mqtt/DeviceInfoModel.java

@@ -35,7 +35,7 @@ public class DeviceInfoModel extends SuperModel {
     }
 
     @Schema(description = "设备型号")
-    private DeviceSpecType deviceModel;
+    private DeviceSpecType specType;
 
     private String deviceModelStr;
 

+ 1 - 1
OneCardIotClient/src/main/java/com/zhongshu/iot/client/model/mqtt/DeviceInfoRegistParam.java

@@ -30,7 +30,7 @@ public class DeviceInfoRegistParam {
     private DeviceType deviceType;
 
     @Schema(description = "设备型号")
-    private DeviceSpecType deviceModel;
+    private DeviceSpecType specType;
 
     @Schema(description = "ip地址")
     private String ip;

+ 1 - 1
OneCardIotClient/src/main/java/com/zhongshu/iot/client/model/mqtt/DeviceInfoSearchParam.java

@@ -27,7 +27,7 @@ public class DeviceInfoSearchParam extends SuperSearchParam {
     private DeviceType deviceType;
 
     @Schema(description = "设备型号")
-    private DeviceSpecType deviceModel;
+    private DeviceSpecType specType;
 
     @Schema(description = "在线状态")
     private OnLineState onLineState;

+ 0 - 19
OneCardIotClient/src/main/java/com/zhongshu/iot/client/type/DeviceType.java

@@ -1,19 +0,0 @@
-package com.zhongshu.iot.client.type;
-
-import lombok.Getter;
-
-/**
- * 设备类型
- */
-public enum DeviceType {
-    Consumer("消费机"),
-    GateWay("网关"),
-    ;
-
-    @Getter
-    private String remark;
-
-    DeviceType(String remark) {
-        this.remark = remark;
-    }
-}

+ 11 - 0
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/domain/iot/IotTemplate.java

@@ -1,5 +1,7 @@
 package com.zhongshu.iot.server.core.domain.iot;
 
+import com.github.microservice.models.type.DeviceSpecType;
+import com.github.microservice.models.type.DeviceType;
 import com.zhongshu.iot.client.type.DataState;
 import com.zhongshu.iot.client.type.IotDataType;
 import com.zhongshu.iot.server.core.domain.base.SuperEntity;
@@ -30,6 +32,15 @@ public class IotTemplate extends SuperEntity {
     @Schema(description = "所属物模型id")
     private String iotThingId;
 
+    @Schema(description = "关联code,产品code")
+    private String code;
+
+    @Schema(description = "适用设备类型")
+    private DeviceType deviceType;
+
+    @Schema(description = "适用设备型号")
+    private DeviceSpecType specType;
+
     //--------------------------------关联设备时特有的属性 start------------------
     @Schema(description = "区分是模版还是设备关联的物模型")
     private IotDataType iotDataType;

+ 4 - 1
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/domain/iot/mqtt/DeviceInfo.java

@@ -32,6 +32,9 @@ public class DeviceInfo extends SuperEntity {
     @Schema(description = "设备名称")
     private String deviceName;
 
+    @Schema(description = "设备code,产品code")
+    private String code;
+
     @Schema(description = "设备类型:消费机 闸机")
     private DeviceType deviceType;
 
@@ -39,7 +42,7 @@ public class DeviceInfo extends SuperEntity {
     private RegistType registType = RegistType.Gateway;
 
     @Schema(description = "设备型号")
-    private DeviceSpecType deviceModel;
+    private DeviceSpecType specType;
 
     @Schema(description = "在线状态")
     private OnLineState onLineState;

+ 1 - 2
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/service/iotPlatform/impl/OnLineTopic.java

@@ -30,7 +30,7 @@ public class OnLineTopic implements PlatformTopic {
     @ExecuteAnnotationServiceMethod(value = "online", remark = "上线")
     @Override
     public ResultContent<Object> action(String topic, String message) {
-        log.info("online");
+        log.info("platform online");
         DeviceOnLineParam param = null;
         if (StringUtils.isNotEmpty(message)) {
             param = JSONUtil.toBean(message, DeviceOnLineParam.class);
@@ -40,7 +40,6 @@ public class OnLineTopic implements PlatformTopic {
             result.setOperator(param.getOperator());
             result.setSuccess();
             result.setDeviceId(param.getDeviceId());
-            result.setMqttDataId(param.getMqttDataId());
             result.setGateWayId(param.getGateWayId());
             result.setTime(DateUtils.paresTime(System.currentTimeMillis(), DateUtils.FORMAT_LONG));
             result.setInfo(param.getInfo());