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),