From 40fb794798897da0873db4bb03fe04200d874003 Mon Sep 17 00:00:00 2001
From: 648540858 <456panlinlin>
Date: 星期一, 11 四月 2022 15:30:49 +0800
Subject: [PATCH] 使用临时方案解决更新通道调用百度API问题
---
src/main/java/com/genersoft/iot/vmp/gb28181/event/online/OnlineEventListener.java | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/event/online/OnlineEventListener.java b/src/main/java/com/genersoft/iot/vmp/gb28181/event/online/OnlineEventListener.java
index 27bc4bc..755967b 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/event/online/OnlineEventListener.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/event/online/OnlineEventListener.java
@@ -1,14 +1,13 @@
package com.genersoft.iot.vmp.gb28181.event.online;
import com.genersoft.iot.vmp.conf.SipConfig;
-import com.genersoft.iot.vmp.conf.UserSetup;
+import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.service.IDeviceService;
-import com.genersoft.iot.vmp.storager.dao.dto.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -16,7 +15,7 @@
import org.springframework.stereotype.Component;
import com.genersoft.iot.vmp.common.VideoManagerConstants;
-import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
+import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import com.genersoft.iot.vmp.utils.redis.RedisUtil;
import java.text.SimpleDateFormat;
@@ -35,7 +34,7 @@
private final static Logger logger = LoggerFactory.getLogger(OnlineEventListener.class);
@Autowired
- private IVideoManagerStorager storager;
+ private IVideoManagerStorage storager;
@Autowired
private IDeviceService deviceService;
@@ -47,7 +46,7 @@
private SipConfig sipConfig;
@Autowired
- private UserSetup userSetup;
+ private UserSetting userSetting;
@Autowired
private EventPublisher eventPublisher;
@@ -65,11 +64,9 @@
}
Device device = event.getDevice();
if (device == null) return;
- String key = VideoManagerConstants.KEEPLIVEKEY_PREFIX + userSetup.getServerId() + "_" + event.getDevice().getDeviceId();
+ String key = VideoManagerConstants.KEEPLIVEKEY_PREFIX + userSetting.getServerId() + "_" + event.getDevice().getDeviceId();
Device deviceInStore = storager.queryVideoDevice(device.getDeviceId());
device.setOnline(1);
- // 澶勭悊涓婄嚎鐩戝惉
- storager.updateDevice(device);
switch (event.getFrom()) {
// 娉ㄥ唽鏃惰Е鍙戠殑鍦ㄧ嚎浜嬩欢锛屽厛鍦╮edis涓鍔犺秴鏃惰秴鏃剁洃鍚�
case VideoManagerConstants.EVENT_ONLINE_REGISTER:
@@ -98,12 +95,14 @@
break;
}
-
+ // 澶勭悊涓婄嚎鐩戝惉
+ storager.updateDevice(device);
List<DeviceChannel> deviceChannelList = storager.queryOnlineChannelsByDeviceId(device.getDeviceId());
eventPublisher.catalogEventPublish(null, deviceChannelList, CatalogEvent.ON);
// 涓婄嚎娣诲姞璁㈤槄
if (device.getSubscribeCycleForCatalog() > 0) {
deviceService.addCatalogSubscribe(device);
+ deviceService.addMobilePositionSubscribe(device);
}
}
}
--
Gitblit v1.8.0