From bac19f583c60f86fd15a13230ea70bfc3a6645b1 Mon Sep 17 00:00:00 2001 From: chenghong <24211317@qq.com> Date: Mon, 14 Aug 2023 11:44:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=B8=A4=E4=B8=AA=E5=9B=BD?= =?UTF-8?q?=E6=A0=87=E5=B9=B3=E5=8F=B0=E7=9B=B8=E4=BA=92=E7=BA=A7=E8=81=94?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=B8=8A=E7=BA=A7=E4=B8=8D=E8=83=BD=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=9B=AE=E5=BD=95=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/message/MessageHandlerAbstract.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageHandlerAbstract.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageHandlerAbstract.java index afaa7cb3..6dcefa72 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageHandlerAbstract.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/MessageHandlerAbstract.java @@ -3,6 +3,8 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message; import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; +import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.query.cmd.CatalogQueryMessageHandler; +import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import org.dom4j.Element; import org.springframework.beans.factory.annotation.Autowired; @@ -16,6 +18,9 @@ public abstract class MessageHandlerAbstract extends SIPRequestProcessorParent i public Map messageHandlerMap = new ConcurrentHashMap<>(); + @Autowired + private IVideoManagerStorage storage; + public void addHandler(String cmdType, IMessageHandler messageHandler) { messageHandlerMap.put(cmdType, messageHandler); } @@ -24,7 +29,15 @@ public abstract class MessageHandlerAbstract extends SIPRequestProcessorParent i public void handForDevice(RequestEvent evt, Device device, Element element) { String cmd = getText(element, "CmdType"); IMessageHandler messageHandler = messageHandlerMap.get(cmd); + if (messageHandler != null) { + //两个国标平台互相级联时由于上一步判断导致本该在平台处理的消息 放到了设备的处理逻辑 + //所以对目录查询单独做了校验 + if(messageHandler instanceof CatalogQueryMessageHandler){ + ParentPlatform parentPlatform = storage.queryParentPlatByServerGBId(device.getDeviceId()); + messageHandler.handForPlatform(evt, parentPlatform, element); + return; + } messageHandler.handForDevice(evt, device, element); } }