Browse Source

告警信息上报过程中,AlarmType存储失败的解决

pull/360/head
chenjialing 3 years ago
parent
commit
fe0b5c33f9
  1. 7
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java

7
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 javax.sip.RequestEvent;
import static com.genersoft.iot.vmp.gb28181.utils.XmlUtil.getText; import static com.genersoft.iot.vmp.gb28181.utils.XmlUtil.*;
@Component @Component
public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler { public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler {
@ -105,6 +105,11 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
storager.insertMobilePosition(mobilePosition); storager.insertMobilePosition(mobilePosition);
} }
} }
if (!StringUtils.isEmpty(deviceAlarm.getDeviceId())) {
if (deviceAlarm.getAlarmMethod().equals("5")) {
deviceAlarm.setAlarmType(getText(rootElement.element("Info"), "AlarmType"));
}
}
logger.debug("存储报警信息、报警分类"); logger.debug("存储报警信息、报警分类");
// 存储报警信息、报警分类 // 存储报警信息、报警分类
deviceAlarmService.add(deviceAlarm); deviceAlarmService.add(deviceAlarm);

Loading…
Cancel
Save