From 36409eb34c8b246a311739c60266bcb5c7ac9f74 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 21 Oct 2024 09:27:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=BB=98=E8=AE=A4=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E8=AE=BE=E5=A4=87=E6=9C=AA=E8=AE=BE=E7=BD=AE=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E7=AD=96=E7=95=A5=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/gb28181/dao/DeviceMapper.java | 2 ++ .../vmp/gb28181/service/impl/DeviceServiceImpl.java | 10 ++++------ .../event/request/impl/RegisterRequestProcessor.java | 1 + 数据库/2.7.3/初始化-mysql-2.7.3.sql | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceMapper.java b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceMapper.java index cca4d84f..340a50e1 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/dao/DeviceMapper.java @@ -59,6 +59,7 @@ public interface DeviceMapper { "firmware, " + "transport," + "stream_mode," + + "media_server_id," + "ip," + "sdp_ip," + "local_ip," + @@ -88,6 +89,7 @@ public interface DeviceMapper { "#{firmware}," + "#{transport}," + "#{streamMode}," + + "#{mediaServerId}," + "#{ip}," + "#{sdpIp}," + "#{localIp}," + diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/DeviceServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/DeviceServiceImpl.java index cbef7b5f..742bf1e4 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/DeviceServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/DeviceServiceImpl.java @@ -168,15 +168,13 @@ public class DeviceServiceImpl implements IDeviceService { } }else { - if (deviceChannelMapper.queryChannelsByDeviceDbId(device.getId()).isEmpty()) { - log.info("[设备上线]: {},通道数为0,查询通道信息", device.getDeviceId()); - sync(device); - } - deviceMapper.update(device); redisCatchStorage.updateDevice(device); } - + if (deviceChannelMapper.queryChannelsByDeviceDbId(device.getId()).isEmpty()) { + log.info("[设备上线]: {},通道数为0,查询通道信息", device.getDeviceId()); + sync(device); + } } // 刷新过期任务 diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java index 23a6e42a..7c920544 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java @@ -172,6 +172,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen device.setStreamMode("UDP"); device.setCharset("GB2312"); device.setGeoCoordSys("WGS84"); + device.setMediaServerId("auto"); device.setDeviceId(deviceId); device.setOnLine(false); }else { diff --git a/数据库/2.7.3/初始化-mysql-2.7.3.sql b/数据库/2.7.3/初始化-mysql-2.7.3.sql index 34c76422..49fd0f4a 100644 --- a/数据库/2.7.3/初始化-mysql-2.7.3.sql +++ b/数据库/2.7.3/初始化-mysql-2.7.3.sql @@ -25,7 +25,7 @@ create table wvp_device charset character varying(50), ssrc_check bool default false, geo_coord_sys character varying(50), - media_server_id character varying(50), + media_server_id character varying(50) default 'auto', custom_name character varying(255), sdp_ip character varying(50), local_ip character varying(50),