From a82b831b8b2b96dfa5791808f1207500e16697cf Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期三, 04 一月 2023 10:39:40 +0800 Subject: [PATCH] 优化设备状态保持,自动记录心跳间隔,三次心跳失败则设备离线,不在使用设备有效期字段作为唯一判断标准,提高容错能力和稳定性。 --- src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java index a8e0b4e..a5458b0 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.web.gb28181; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel; import com.genersoft.iot.vmp.service.IDeviceService; @@ -94,6 +94,7 @@ @RequestMapping(value = "/channellist") public JSONObject channellist( String serial, + @RequestParam(required = false)String code, @RequestParam(required = false)String channel_type, @RequestParam(required = false)String dir_serial , @RequestParam(required = false)Integer start, @@ -148,9 +149,9 @@ // 1-IETF RFC3261, // 2-鍩轰簬鍙d护鐨勫弻鍚戣璇�, // 3-鍩轰簬鏁板瓧璇佷功鐨勫弻鍚戣璇� - deviceJOSNChannel.put("Status", deviceChannel.getStatus()); - deviceJOSNChannel.put("Longitude", deviceChannel.getLongitudeWgs84()); - deviceJOSNChannel.put("Latitude", deviceChannel.getLatitudeWgs84()); + deviceJOSNChannel.put("Status", deviceChannel.getStatus() == 1 ? "ON":"OFF"); + deviceJOSNChannel.put("Longitude", deviceChannel.getLongitude()); + deviceJOSNChannel.put("Latitude", deviceChannel.getLatitude()); deviceJOSNChannel.put("PTZType ", deviceChannel.getPTZType()); // 浜戝彴绫诲瀷, 0 - 鏈煡, 1 - 鐞冩満, 2 - 鍗婄悆, // 3 - 鍥哄畾鏋満, 4 - 閬ユ帶鏋満 deviceJOSNChannel.put("CustomPTZType", ""); -- Gitblit v1.8.0