From 66ab09396cecb4caf3f1b6803fb97792132fffc6 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期二, 04 四月 2023 09:18:33 +0800
Subject: [PATCH] Merge branch 'wvp-28181-2.0' into main-dev

---
 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 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 1288974..a5e27c3 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
@@ -152,26 +152,30 @@
 
 			MobilePosition mobilePosition = new MobilePosition();
 			mobilePosition.setCreateTime(DateUtil.getNow());
+
 			Element deviceIdElement = rootElement.element("DeviceID");
 			String channelId = deviceIdElement.getTextTrim().toString();
 			Device device = redisCatchStorage.getDevice(deviceId);
 
 			if (device == null) {
-				// 鏍规嵁閫氶亾id鏌ヨ璁惧Id
-				List<Device> deviceList = deviceChannelService.getDeviceByChannelId(channelId);
-				if (deviceList.size() > 0) {
-					device = deviceList.get(0);
-				}else {
-					logger.warn("[mobilePosition绉诲姩浣嶇疆Notify] 鏈壘鍒伴�氶亾{}鎵�灞炵殑璁惧", channelId);
-					return;
+				device = redisCatchStorage.getDevice(channelId);
+				if (device == null) {
+					// 鏍规嵁閫氶亾id鏌ヨ璁惧Id
+					List<Device> deviceList = deviceChannelService.getDeviceByChannelId(channelId);
+					if (deviceList.size() > 0) {
+						device = deviceList.get(0);
+					}
 				}
 			}
-			if (device != null) {
-				if (!ObjectUtils.isEmpty(device.getName())) {
-					mobilePosition.setDeviceName(device.getName());
-				}
+			if (device == null) {
+				logger.warn("[mobilePosition绉诲姩浣嶇疆Notify] 鏈壘鍒伴�氶亾{}鎵�灞炵殑璁惧", channelId);
+				return;
 			}
-			mobilePosition.setDeviceId(XmlUtil.getText(rootElement, "DeviceID"));
+			if (!ObjectUtils.isEmpty(device.getName())) {
+				mobilePosition.setDeviceName(device.getName());
+			}
+
+			mobilePosition.setDeviceId(device.getDeviceId());
 			mobilePosition.setChannelId(channelId);
 			String time = XmlUtil.getText(rootElement, "Time");
 			mobilePosition.setTime(time);

--
Gitblit v1.8.0