From 22fd9e6f8c1d9873269430a2bf6e1104aa5bf694 Mon Sep 17 00:00:00 2001 From: chenjialing <595168663@qq.com> Date: Wed, 2 Mar 2022 09:18:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=A1=E6=81=AF=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5=E8=BF=87=E7=A8=8B=E4=B8=AD=EF=BC=8CAlarmType=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E5=A4=B1=E8=B4=A5=E7=9A=84=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/message/notify/cmd/AlarmNotifyMessageHandler.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 a46b0034..8f412f7d 100644 --- 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 @@ -22,7 +22,7 @@ import org.springframework.util.StringUtils; import javax.sip.RequestEvent; -import static com.genersoft.iot.vmp.gb28181.utils.XmlUtil.getText; +import static com.genersoft.iot.vmp.gb28181.utils.XmlUtil.*; @Component public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler { @@ -105,6 +105,11 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme storager.insertMobilePosition(mobilePosition); } } + if (!StringUtils.isEmpty(deviceAlarm.getDeviceId())) { + if (deviceAlarm.getAlarmMethod().equals("5")) { + deviceAlarm.setAlarmType(getText(rootElement.element("Info"), "AlarmType")); + } + } logger.debug("存储报警信息、报警分类"); // 存储报警信息、报警分类 deviceAlarmService.add(deviceAlarm);