From ed2680bf032f76fde675897f7468f64e8b8d5a5e Mon Sep 17 00:00:00 2001
From: chenjialing <595168663@qq.com>
Date: 星期三, 01 六月 2022 14:11:06 +0800
Subject: [PATCH] 修复--重设通道多个设备注册下发生的sql错误修复
---
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
index e923a54..40b9a9a 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
@@ -18,6 +18,7 @@
import com.genersoft.iot.vmp.gb28181.utils.XmlUtil;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
+import com.genersoft.iot.vmp.utils.DateUtil;
import com.genersoft.iot.vmp.utils.redis.RedisUtil;
import org.dom4j.DocumentException;
import org.dom4j.Element;
@@ -188,6 +189,7 @@
Device device = redisCatchStorage.getDevice(deviceId);
if (device == null) {
+ responseAck(evt, Response.NOT_FOUND, "device is not found");
return;
}
rootElement = getRootElement(evt, device.getCharset());
@@ -195,7 +197,12 @@
deviceAlarm.setDeviceId(deviceId);
deviceAlarm.setAlarmPriority(XmlUtil.getText(rootElement, "AlarmPriority"));
deviceAlarm.setAlarmMethod(XmlUtil.getText(rootElement, "AlarmMethod"));
- deviceAlarm.setAlarmTime(XmlUtil.getText(rootElement, "AlarmTime"));
+ String alarmTime = XmlUtil.getText(rootElement, "AlarmTime");
+ if (alarmTime == null) {
+ responseAck(evt, Response.BAD_REQUEST, "AlarmTime cannot be null");
+ return;
+ }
+ deviceAlarm.setAlarmTime(DateUtil.ISO8601Toyyyy_MM_dd_HH_mm_ss(alarmTime));
if (XmlUtil.getText(rootElement, "AlarmDescription") == null) {
deviceAlarm.setAlarmDescription("");
} else {
--
Gitblit v1.8.0