From 8ef8773db64ee5a1d766fab38182cc2a235dcd50 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Sat, 28 Sep 2024 14:04:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=BD=E6=A0=87=E7=BA=A7?= =?UTF-8?q?=E8=81=94=E6=97=B6=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E7=9A=84?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/request/impl/ByeRequestProcessor.java | 5 +++-- .../request/impl/info/InfoRequestProcessor.java | 2 +- .../cmd/DeviceControlQueryMessageHandler.java | 16 ++++++++-------- .../notify/cmd/AlarmNotifyMessageHandler.java | 3 --- .../query/cmd/DeviceInfoQueryMessageHandler.java | 4 ++-- src/main/resources/application.yml | 2 +- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java index 813c6255..6d905f18 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java @@ -185,8 +185,9 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In } log.info("[收到bye] 来自:{}, 通道: {}, 类型: {}", ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getType()); - Platform platform = platformService.queryPlatformByServerGBId(ssrcTransaction.getDeviceId()); - if (platform != null ) { + + if (ssrcTransaction.getPlatformId() != null ) { + Platform platform = platformService.queryPlatformByServerGBId(ssrcTransaction.getDeviceId()); if (ssrcTransaction.getType().equals(InviteSessionType.BROADCAST)) { log.info("[收到bye] 上级停止语音对讲,来自:{}, 通道已停止推流: {}", ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId()); CommonGBChannel channel = channelService.getOne(ssrcTransaction.getChannelId()); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/info/InfoRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/info/InfoRequestProcessor.java index 2ed5fe10..238cda23 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/info/InfoRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/info/InfoRequestProcessor.java @@ -109,7 +109,7 @@ public class InfoRequestProcessor extends SIPRequestProcessorParent implements I } // 根据通道ID,获取所属设备 - Device device = deviceService.getDeviceByChannelId(sendRtpInfo.getChannelId()); + Device device = deviceService.getDevice(channel.getGbDeviceDbId()); if (device == null) { // 不存在则回复404 log.warn("[INFO 消息] 通道所属设备不存在, 通道ID: {}", sendRtpInfo.getChannelId()); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/control/cmd/DeviceControlQueryMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/control/cmd/DeviceControlQueryMessageHandler.java index 3d857a29..cb1cced6 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/control/cmd/DeviceControlQueryMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/control/cmd/DeviceControlQueryMessageHandler.java @@ -145,7 +145,7 @@ public class DeviceControlQueryMessageHandler extends SIPRequestProcessorParent return; } // 根据通道ID,获取所属设备 - Device device = deviceService.getDeviceByChannelId(channel.getGbId()); + Device device = deviceService.getDevice(channel.getGbDeviceDbId()); if (device == null) { // 不存在则回复404 log.warn("[INFO 消息] 通道所属设备不存在, 通道ID: {}", channel.getGbId()); @@ -195,7 +195,7 @@ public class DeviceControlQueryMessageHandler extends SIPRequestProcessorParent return; } // 根据通道ID,获取所属设备 - Device device = deviceService.getDeviceByChannelId(channel.getGbId()); + Device device = deviceService.getDevice(channel.getGbDeviceDbId()); if (device == null) { // 不存在则回复404 log.warn("[INFO 消息] 通道所属设备不存在, 通道ID: {}", channel.getGbId()); @@ -243,7 +243,7 @@ public class DeviceControlQueryMessageHandler extends SIPRequestProcessorParent return; } // 根据通道ID,获取所属设备 - Device device = deviceService.getDeviceByChannelId(channel.getGbId()); + Device device = deviceService.getDevice(channel.getGbDeviceDbId()); if (device == null) { // 不存在则回复404 log.warn("[INFO 消息] 通道所属设备不存在, 通道ID: {}", channel.getGbId()); @@ -278,7 +278,7 @@ public class DeviceControlQueryMessageHandler extends SIPRequestProcessorParent return; } // 根据通道ID,获取所属设备 - Device device = deviceService.getDeviceByChannelId(channel.getGbId()); + Device device = deviceService.getDevice(channel.getGbDeviceDbId()); if (device == null) { // 不存在则回复404 log.warn("[INFO 消息] 通道所属设备不存在, 通道ID: {}", channel.getGbId()); @@ -341,7 +341,7 @@ public class DeviceControlQueryMessageHandler extends SIPRequestProcessorParent return; } // 根据通道ID,获取所属设备 - Device device = deviceService.getDeviceByChannelId(channel.getGbId()); + Device device = deviceService.getDevice(channel.getGbDeviceDbId()); if (device == null) { // 不存在则回复404 log.warn("[INFO 消息] 通道所属设备不存在, 通道ID: {}", channel.getGbId()); @@ -393,7 +393,7 @@ public class DeviceControlQueryMessageHandler extends SIPRequestProcessorParent return; } // 根据通道ID,获取所属设备 - Device device = deviceService.getDeviceByChannelId(channel.getGbId()); + Device device = deviceService.getDevice(channel.getGbDeviceDbId()); if (device == null) { // 不存在则回复404 log.warn("[INFO 消息] 通道所属设备不存在, 通道ID: {}", channel.getGbId()); @@ -439,7 +439,7 @@ public class DeviceControlQueryMessageHandler extends SIPRequestProcessorParent return; } // 根据通道ID,获取所属设备 - Device device = deviceService.getDeviceByChannelId(channel.getGbId()); + Device device = deviceService.getDevice(channel.getGbDeviceDbId()); if (device == null) { // 不存在则回复404 log.warn("[INFO 消息] 通道所属设备不存在, 通道ID: {}", channel.getGbId()); @@ -491,7 +491,7 @@ public class DeviceControlQueryMessageHandler extends SIPRequestProcessorParent return; } // 根据通道ID,获取所属设备 - Device device = deviceService.getDeviceByChannelId(channel.getGbId()); + Device device = deviceService.getDevice(channel.getGbDeviceDbId()); if (device == null) { // 不存在则回复404 log.warn("[INFO 消息] 通道所属设备不存在, 通道ID: {}", channel.getGbId()); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java index ec0c3936..293f3e37 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java @@ -70,9 +70,6 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme @Autowired private ThreadPoolTaskExecutor taskExecutor; - @Autowired - private EventPublisher eventPublisher; - @Override public void afterPropertiesSet() throws Exception { diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java index 937c61e1..ca577440 100755 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java @@ -106,10 +106,10 @@ public class DeviceInfoQueryMessageHandler extends SIPRequestProcessorParent imp } // 根据通道ID,获取所属设备 - Device device = deviceService.getDeviceByChannelId(channel.getGbId()); + Device device = deviceService.getDevice(channel.getGbDeviceDbId()); if (device == null) { // 不存在则回复404 - log.warn("[DeviceInfo] 通道所属设备不存在, 通道ID: {}", channel.getGbId()); + log.warn("[DeviceInfo] 通道所属设备不存在, 通道ID: {}", channel.getGbDeviceDbId()); try { responseAck(request, Response.NOT_FOUND, "device not found "); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e7c85a82..b91ff2aa 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -2,4 +2,4 @@ spring: application: name: wvp profiles: - active: 272重构-postgre \ No newline at end of file + active: 272重构 \ No newline at end of file