TRX vor 1 Jahr
Ursprung
Commit
c2da5c0342

+ 2 - 2
OneCardIotClient/src/main/java/com/zhongshu/iot/client/model/mqtt/DeviceInfoUpdateRemark.java

@@ -1,6 +1,6 @@
 package com.zhongshu.iot.client.model.mqtt;
 
-import com.zhongshu.iot.client.type.DataState;
+import com.github.microservice.models.type.DeviceState;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -24,7 +24,7 @@ public class DeviceInfoUpdateRemark {
     private Boolean isReportLogs = Boolean.TRUE;
 
     @Schema(description = "数据状态")
-    private DataState state;
+    private DeviceState state;
 
     @Schema(description = "所属项目code")
     private String projectCode;

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

@@ -2,9 +2,9 @@ package com.zhongshu.iot.server.core.domain.iot.mqtt;
 
 import cn.hutool.json.JSONObject;
 import com.github.microservice.models.type.DeviceSpecType;
+import com.github.microservice.models.type.DeviceState;
 import com.github.microservice.models.type.DeviceType;
 import com.github.microservice.models.type.OnLineState;
-import com.zhongshu.iot.client.type.DataState;
 import com.zhongshu.iot.server.core.domain.base.SuperEntity;
 import com.zhongshu.iot.server.core.domain.iot.IotTemplate;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -45,7 +45,7 @@ public class DeviceInfo extends SuperEntity {
     private OnLineState onLineState;
 
     @Schema(description = "数据状态")
-    private DataState state = DataState.Enable;
+    private DeviceState state = DeviceState.Enable;
 
     @Schema(description = "ip地址")
     private String ip;

+ 2 - 5
OneCardIotServer/src/main/java/com/zhongshu/iot/server/core/service/sync/DeviceSyncFullCardService.java

@@ -220,11 +220,8 @@ public class DeviceSyncFullCardService extends SuperService {
             param.setLastOnlineTime(deviceInfo.getLastOnlineTime());
             param.setOnLineState(deviceInfo.getOnLineState().name());
             param.setProjectInfoCode(deviceInfo.getProjectInfoCode());
-            String state = null;
-            if (deviceInfo.getState() != null) {
-                state = deviceInfo.getState().name();
-            }
-            param.setState(state);
+
+            param.setState(deviceInfo.getState());
             APIResponseModel api = apiRequestService.sendFullCardAPI(FullCardAPIConfig.syncDeviceOnLineState, param);
             log.info("同步设备在线情况:{} {}", api.isSuccess(), api.getMsg());
         }