TRX 1 年之前
父節點
當前提交
96b8d8b3c0

+ 2 - 0
src/main/java/com/zswl/dataservice/service/mqtt/DevicePingInfoService.java

@@ -58,6 +58,7 @@ public class DevicePingInfoService extends SuperService {
             Map<String, Object> standardData = new HashMap<String, Object>();
             standardData.put("id", deviceInfo.getId());
             standardData.put("lastOnlineTime", time);
+            standardData.put("onLineState", OnLineState.OnLine);
             commonService.updateData(standardData, DeviceInfo.class.getSimpleName());
 
             // ping记录
@@ -97,6 +98,7 @@ public class DevicePingInfoService extends SuperService {
                 }
 
                 if (onLineState != deviceInfo.getOnLineState()) {
+                    log.info("设备在线状态改变:{} {}", deviceInfo.getDeviceName(), onLineState);
                     Map<String, Object> standardData = new HashMap<String, Object>();
                     standardData.put("id", deviceInfo.getId());
                     standardData.put("onLineState", onLineState);

+ 1 - 2
src/main/java/com/zswl/dataservice/service/sync/DeviceSyncFullCardService.java

@@ -237,8 +237,7 @@ public class DeviceSyncFullCardService extends SuperService {
             param.setLastOnlineTime(deviceInfo.getLastOnlineTime());
             param.setOnLineState(deviceInfo.getOnLineState().name());
             param.setProjectInfoCode(deviceInfo.getProjectInfoCode());
-
-            APIResponseModel api = apiRequestService.sendFullCardAPI(FullCardAPIConfig.lastDeviceOnLineTime, param);
+            APIResponseModel api = apiRequestService.sendFullCardAPI(FullCardAPIConfig.syncDeviceOnLineState, param);
             log.info("同步设备在线时间:{} {}", api.isSuccess(), api.getMsg());
 
         }