TRX 1 anno fa
parent
commit
78a190f1e4

+ 3 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/domain/devices/DeviceInfo.java

@@ -72,6 +72,9 @@ public class DeviceInfo extends SuperMain {
     @Schema(description = "最上线时间")
     private Long lastOnlineTime;
 
+    @Schema(description = "最后下线时间")
+    private Long lastOfflineTime;
+
     @Schema(description = "设备IP地址")
     private String ip;
 

+ 4 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/devices/DeviceSyncFromIotService.java

@@ -17,6 +17,7 @@ import com.zhongshu.card.server.core.domain.devices.permiss.DevicePermiss;
 import com.zhongshu.card.server.core.service.base.CommonService;
 import com.zhongshu.card.server.core.service.user.OperationLogsService;
 import com.zhongshu.card.server.core.util.CommonUtil;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -88,9 +89,11 @@ public class DeviceSyncFromIotService {
 
         HashMap<String, Object> map = new HashMap<>();
         map.put("lastOnlineTime", param.getLastOnlineTime());
+        map.put("lastOfflineTime", param.getLastOfflineTime());
         map.put("onLineState", CommonUtil.getEnumByName(OnLineState.class, param.getOnLineState()));
         map.put("state", param.getState());
         map.put("lastOnlineTimeStr", DateUtils.paresTime(param.getLastOnlineTime(), DateUtils.FORMAT_LONG));
+
         commonService.updateData(where, map, DeviceInfo.class.getSimpleName());
         commonService.updateData(where, map, DeviceBind.class.getSimpleName());
 
@@ -109,6 +112,7 @@ public class DeviceSyncFromIotService {
         HashMap<String, Object> map = new HashMap<>();
         map.put("lastOnlineTime", param.getLastOnlineTime());
         map.put("lastOnlineTimeStr", DateUtils.paresTime(param.getLastOnlineTime(), DateUtils.FORMAT_LONG));
+        map.put("lastOfflineTime", param.getLastOfflineTime());
         commonService.updateData(where, map, DeviceInfo.class.getSimpleName());
         return ResultContent.buildSuccess();
     }