From 59e3a280d6a2215f767d81e08d2f9e33a7b8e3dc Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期一, 17 一月 2022 17:42:09 +0800 Subject: [PATCH] 去除目录通知多余的信息 --- src/main/java/com/genersoft/iot/vmp/gb28181/event/online/OnlineEventListener.java | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 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 a62c76d..5f0d14d 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 @@ -3,6 +3,10 @@ import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.conf.UserSetup; 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.service.IDeviceService; import com.genersoft.iot.vmp.storager.dao.dto.User; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -15,6 +19,7 @@ import com.genersoft.iot.vmp.utils.redis.RedisUtil; import java.text.SimpleDateFormat; +import java.util.List; /** * @description: 鍦ㄧ嚎浜嬩欢鐩戝惉鍣紝鐩戝惉鍒扮绾垮悗锛屼慨鏀硅澶囩鍦ㄧ嚎鐘舵�併�� 璁惧鍦ㄧ嚎鏈変袱涓潵婧愶細 @@ -39,6 +44,9 @@ @Autowired private UserSetup userSetup; + + @Autowired + private EventPublisher eventPublisher; private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -76,6 +84,11 @@ } device.setOnline(1); + Device deviceInstore = storager.queryVideoDevice(device.getDeviceId()); + if (deviceInstore != null && deviceInstore.getOnline() == 0) { + List<DeviceChannel> deviceChannelList = storager.queryOnlineChannelsByDeviceId(device.getDeviceId()); + eventPublisher.catalogEventPublish(null, deviceChannelList, CatalogEvent.ON); + } // 澶勭悊涓婄嚎鐩戝惉 storager.updateDevice(device); -- Gitblit v1.8.0