Преглед изворни кода

调整国标级联时设备信息的获取

648540858 пре 1 година
родитељ
комит
8ef8773db6

+ 3 - 2
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());

+ 1 - 1
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());

+ 8 - 8
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());

+ 0 - 3
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 {

+ 2 - 2
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 ");

+ 1 - 1
src/main/resources/application.yml

@@ -2,4 +2,4 @@ spring:
   application:
     name: wvp
   profiles:
-    active: 272重构-postgre
+    active: 272重构