临时提交

This commit is contained in:
lin 2025-10-17 15:26:32 +08:00
parent 87afbe3f89
commit c10c982954
3 changed files with 26 additions and 75 deletions

View File

@ -11,7 +11,6 @@ import com.genersoft.iot.vmp.gb28181.dao.DeviceChannelMapper;
import com.genersoft.iot.vmp.gb28181.dao.DeviceMapper; import com.genersoft.iot.vmp.gb28181.dao.DeviceMapper;
import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper; import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.event.channel.ChannelEvent;
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
import com.genersoft.iot.vmp.gb28181.service.IDeviceService; import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService; import com.genersoft.iot.vmp.gb28181.service.IInviteStreamService;
@ -44,7 +43,6 @@ import jakarta.validation.constraints.NotNull;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -122,9 +120,6 @@ public class DeviceServiceImpl implements IDeviceService, CommandLineRunner {
@Autowired @Autowired
private DeviceStatusTaskRunner deviceStatusTaskRunner; private DeviceStatusTaskRunner deviceStatusTaskRunner;
@Autowired
private ApplicationEventPublisher applicationEventPublisher;
private Device getDeviceByDeviceIdFromDb(String deviceId) { private Device getDeviceByDeviceIdFromDb(String deviceId) {
return deviceMapper.getDeviceByDeviceId(deviceId); return deviceMapper.getDeviceByDeviceId(deviceId);
} }
@ -428,8 +423,6 @@ public class DeviceServiceImpl implements IDeviceService, CommandLineRunner {
deviceChannelMapper.offlineByDeviceId(device.getId()); deviceChannelMapper.offlineByDeviceId(device.getId());
// 发送通道离线通知 // 发送通道离线通知
eventPublisher.catalogEventPublish(null, channelList, CatalogEvent.OFF); eventPublisher.catalogEventPublish(null, channelList, CatalogEvent.OFF);
// 发送离线通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForOfflineList(this, channelList));
} }
private boolean isDevice(String deviceId) { private boolean isDevice(String deviceId) {
@ -831,8 +824,13 @@ public class DeviceServiceImpl implements IDeviceService, CommandLineRunner {
deviceStatusTaskRunner.removeTask(deviceId); deviceStatusTaskRunner.removeTask(deviceId);
} }
List<CommonGBChannel> commonGBChannels = commonGBChannelMapper.queryByGbDeviceIds(1, List.of(device.getId())); List<CommonGBChannel> commonGBChannels = commonGBChannelMapper.queryByGbDeviceIds(1, List.of(device.getId()));
// 发送删除通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForDeleteList(this, commonGBChannels)); try {
// 发送catalog
eventPublisher.catalogEventPublish(null, commonGBChannels, CatalogEvent.DEL);
} catch (Exception e) {
log.warn("[多个通道删除] 发送失败,数量:{}", commonGBChannels.size(), e);
}
platformChannelMapper.delChannelForDeviceId(deviceId); platformChannelMapper.delChannelForDeviceId(deviceId);
deviceChannelMapper.cleanChannelsByDeviceId(device.getId()); deviceChannelMapper.cleanChannelsByDeviceId(device.getId());

View File

@ -9,7 +9,6 @@ import com.genersoft.iot.vmp.gb28181.dao.GroupMapper;
import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper; import com.genersoft.iot.vmp.gb28181.dao.PlatformChannelMapper;
import com.genersoft.iot.vmp.gb28181.dao.RegionMapper; import com.genersoft.iot.vmp.gb28181.dao.RegionMapper;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.event.channel.ChannelEvent;
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
import com.genersoft.iot.vmp.gb28181.service.IGbChannelService; import com.genersoft.iot.vmp.gb28181.service.IGbChannelService;
import com.genersoft.iot.vmp.gb28181.service.IPlatformChannelService; import com.genersoft.iot.vmp.gb28181.service.IPlatformChannelService;
@ -21,7 +20,6 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
@ -53,9 +51,6 @@ public class GbChannelServiceImpl implements IGbChannelService {
@Autowired @Autowired
private GroupMapper groupMapper; private GroupMapper groupMapper;
@Autowired
private ApplicationEventPublisher applicationEventPublisher;
@Override @Override
public CommonGBChannel queryByDeviceId(String gbDeviceId) { public CommonGBChannel queryByDeviceId(String gbDeviceId) {
return commonGBChannelMapper.queryByDeviceId(gbDeviceId); return commonGBChannelMapper.queryByDeviceId(gbDeviceId);
@ -73,9 +68,12 @@ public class GbChannelServiceImpl implements IGbChannelService {
commonGBChannel.setCreateTime(DateUtil.getNow()); commonGBChannel.setCreateTime(DateUtil.getNow());
commonGBChannel.setUpdateTime(DateUtil.getNow()); commonGBChannel.setUpdateTime(DateUtil.getNow());
int result = commonGBChannelMapper.insert(commonGBChannel); int result = commonGBChannelMapper.insert(commonGBChannel);
// 发送通道新增通知 try {
// 发送通知 // 发送通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForAdd(this, commonGBChannel)); eventPublisher.catalogEventPublish(null, commonGBChannel, CatalogEvent.ADD);
} catch (Exception e) {
log.warn("[通道移除通知] 发送失败,{}", commonGBChannel.getGbDeviceId(), e);
}
return result; return result;
} }
@ -98,8 +96,6 @@ public class GbChannelServiceImpl implements IGbChannelService {
} catch (Exception e) { } catch (Exception e) {
log.warn("[通道移除通知] 发送失败,{}", channel.getGbDeviceId(), e); log.warn("[通道移除通知] 发送失败,{}", channel.getGbDeviceId(), e);
} }
// 发送通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForDelete(this, channel));
} }
return 1; return 1;
} }
@ -117,9 +113,13 @@ public class GbChannelServiceImpl implements IGbChannelService {
if (channelListInDb.isEmpty()) { if (channelListInDb.isEmpty()) {
return; return;
} }
// 发送通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForDeleteList(this, channelListInDb));
commonGBChannelMapper.batchDelete(channelListInDb); commonGBChannelMapper.batchDelete(channelListInDb);
try {
// 发送通知
eventPublisher.catalogEventPublish(null, channelListInDb, CatalogEvent.DEL);
} catch (Exception e) {
log.warn("[通道移除通知] 发送失败", e);
}
} }
@Override @Override
@ -133,9 +133,6 @@ public class GbChannelServiceImpl implements IGbChannelService {
int result = commonGBChannelMapper.update(commonGBChannel); int result = commonGBChannelMapper.update(commonGBChannel);
if (result > 0) { if (result > 0) {
try { try {
// 发送通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForUpdate(this, commonGBChannel));
// 发送通知 // 发送通知
eventPublisher.catalogEventPublish(null, commonGBChannel, CatalogEvent.UPDATE); eventPublisher.catalogEventPublish(null, commonGBChannel, CatalogEvent.UPDATE);
} catch (Exception e) { } catch (Exception e) {
@ -154,8 +151,6 @@ public class GbChannelServiceImpl implements IGbChannelService {
int result = commonGBChannelMapper.updateStatusById(commonGBChannel.getGbId(), "OFF"); int result = commonGBChannelMapper.updateStatusById(commonGBChannel.getGbId(), "OFF");
if (result > 0) { if (result > 0) {
try { try {
// 发送通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForOffline(this, commonGBChannel));
// 发送通知 // 发送通知
eventPublisher.catalogEventPublish(null, commonGBChannel, CatalogEvent.OFF); eventPublisher.catalogEventPublish(null, commonGBChannel, CatalogEvent.OFF);
} catch (Exception e) { } catch (Exception e) {
@ -173,8 +168,6 @@ public class GbChannelServiceImpl implements IGbChannelService {
return 0; return 0;
} }
log.info("[通道离线] 共 {} 个", commonGBChannelList.size()); log.info("[通道离线] 共 {} 个", commonGBChannelList.size());
// 发送通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForOfflineList(this, commonGBChannelList));
int limitCount = 1000; int limitCount = 1000;
int result = 0; int result = 0;
if (commonGBChannelList.size() > limitCount) { if (commonGBChannelList.size() > limitCount) {
@ -208,8 +201,6 @@ public class GbChannelServiceImpl implements IGbChannelService {
int result = commonGBChannelMapper.updateStatusById(commonGBChannel.getGbId(), "ON"); int result = commonGBChannelMapper.updateStatusById(commonGBChannel.getGbId(), "ON");
if (result > 0) { if (result > 0) {
try { try {
// 发送通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForOnline(this, commonGBChannel));
// 发送通知 // 发送通知
eventPublisher.catalogEventPublish(null, commonGBChannel, CatalogEvent.ON); eventPublisher.catalogEventPublish(null, commonGBChannel, CatalogEvent.ON);
} catch (Exception e) { } catch (Exception e) {
@ -241,8 +232,6 @@ public class GbChannelServiceImpl implements IGbChannelService {
result += commonGBChannelMapper.updateStatusForListById(commonGBChannelList, "ON"); result += commonGBChannelMapper.updateStatusForListById(commonGBChannelList, "ON");
} }
try { try {
// 发送通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForOnlineList(this, commonGBChannelList));
// 发送catalog // 发送catalog
eventPublisher.catalogEventPublish(null, commonGBChannelList, CatalogEvent.ON); eventPublisher.catalogEventPublish(null, commonGBChannelList, CatalogEvent.ON);
} catch (Exception e) { } catch (Exception e) {
@ -273,8 +262,12 @@ public class GbChannelServiceImpl implements IGbChannelService {
} else { } else {
result += commonGBChannelMapper.batchAdd(commonGBChannels); result += commonGBChannelMapper.batchAdd(commonGBChannels);
} }
// 发送通知 try {
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForAddList(this, commonGBChannels)); // 发送catalog
eventPublisher.catalogEventPublish(null, commonGBChannels, CatalogEvent.ADD);
} catch (Exception e) {
log.warn("[多个通道新增] 发送失败,数量:{}", commonGBChannels.size(), e);
}
log.warn("[新增多个通道] 通道数量为{},成功保存:{}", commonGBChannels.size(), result); log.warn("[新增多个通道] 通道数量为{},成功保存:{}", commonGBChannels.size(), result);
} }
@ -301,8 +294,6 @@ public class GbChannelServiceImpl implements IGbChannelService {
log.info("[更新多个通道] 通道数量为{},成功保存:{}", commonGBChannels.size(), result); log.info("[更新多个通道] 通道数量为{},成功保存:{}", commonGBChannels.size(), result);
// 发送通过更新通知 // 发送通过更新通知
try { try {
// 发送通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForUpdateList(this, commonGBChannels));
// 发送通知 // 发送通知
eventPublisher.catalogEventPublish(null, commonGBChannels, CatalogEvent.UPDATE); eventPublisher.catalogEventPublish(null, commonGBChannels, CatalogEvent.UPDATE);
} catch (Exception e) { } catch (Exception e) {
@ -333,8 +324,6 @@ public class GbChannelServiceImpl implements IGbChannelService {
log.warn("[更新多个通道状态] 通道数量为{},成功保存:{}", commonGBChannels.size(), result); log.warn("[更新多个通道状态] 通道数量为{},成功保存:{}", commonGBChannels.size(), result);
// 发送通过更新通知 // 发送通过更新通知
try { try {
// 发送通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForUpdateList(this, commonGBChannels));
// 发送通知 // 发送通知
eventPublisher.catalogEventPublish(null, commonGBChannels, CatalogEvent.UPDATE); eventPublisher.catalogEventPublish(null, commonGBChannels, CatalogEvent.UPDATE);
} catch (Exception e) { } catch (Exception e) {
@ -399,10 +388,6 @@ public class GbChannelServiceImpl implements IGbChannelService {
CommonGBChannel channelNew = getOne(id); CommonGBChannel channelNew = getOne(id);
// 发送通过更新通知 // 发送通过更新通知
try { try {
// 发送通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForUpdate(this, channelNew));
// 发送通知 // 发送通知
eventPublisher.catalogEventPublish(null, channelNew, CatalogEvent.UPDATE); eventPublisher.catalogEventPublish(null, channelNew, CatalogEvent.UPDATE);
} catch (Exception e) { } catch (Exception e) {
@ -589,8 +574,6 @@ public class GbChannelServiceImpl implements IGbChannelService {
} }
// 发送catalog // 发送catalog
try { try {
// 发送通知
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForUpdateList(this, channelList));
eventPublisher.catalogEventPublish(null, channelList, CatalogEvent.UPDATE); eventPublisher.catalogEventPublish(null, channelList, CatalogEvent.UPDATE);
} catch (Exception e) { } catch (Exception e) {
log.warn("[多个通道业务分组] 发送失败,数量:{}", channelList.size(), e); log.warn("[多个通道业务分组] 发送失败,数量:{}", channelList.size(), e);

View File

@ -3,7 +3,6 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl;
import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.event.channel.ChannelEvent;
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService; import com.genersoft.iot.vmp.gb28181.service.IDeviceChannelService;
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
@ -15,7 +14,6 @@ import lombok.extern.slf4j.Slf4j;
import org.dom4j.DocumentException; import org.dom4j.DocumentException;
import org.dom4j.Element; import org.dom4j.Element;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -51,10 +49,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
@Autowired @Autowired
private IDeviceChannelService deviceChannelService; private IDeviceChannelService deviceChannelService;
@Autowired
private ApplicationEventPublisher applicationEventPublisher;
// @Scheduled(fixedRate = 2000) //每400毫秒执行一次 // @Scheduled(fixedRate = 2000) //每400毫秒执行一次
// public void showSize(){ // public void showSize(){
// log.warn("[notify-目录订阅] 待处理消息数量: {}", taskQueue.size() ); // log.warn("[notify-目录订阅] 待处理消息数量: {}", taskQueue.size() );
@ -151,9 +146,6 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
channel.setStatus("ON"); channel.setStatus("ON");
channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.STATUS_CHANGED, channel)); channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.STATUS_CHANGED, channel));
// 发送通道修改消息
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForOnline(this, channel));
if (userSetting.getDeviceStatusNotify()) { if (userSetting.getDeviceStatusNotify()) {
// 发送redis消息 // 发送redis消息
redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), true); redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), true);
@ -167,9 +159,6 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
} else { } else {
channel.setStatus("OFF"); channel.setStatus("OFF");
channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.STATUS_CHANGED, channel)); channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.STATUS_CHANGED, channel));
// 发送通道修改消息
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForOffline(this, channel));
if (userSetting.getDeviceStatusNotify()) { if (userSetting.getDeviceStatusNotify()) {
// 发送redis消息 // 发送redis消息
redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), false); redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), false);
@ -185,9 +174,6 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
channel.setStatus("OFF"); channel.setStatus("OFF");
channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.STATUS_CHANGED, channel)); channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.STATUS_CHANGED, channel));
// 发送通道修改消息
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForOffline(this, channel));
if (userSetting.getDeviceStatusNotify()) { if (userSetting.getDeviceStatusNotify()) {
// 发送redis消息 // 发送redis消息
redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), false); redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), false);
@ -203,9 +189,6 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
channel.setStatus("OFF"); channel.setStatus("OFF");
channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.STATUS_CHANGED, channel)); channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.STATUS_CHANGED, channel));
// 发送通道修改消息
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForOffline(this, channel));
if (userSetting.getDeviceStatusNotify()) { if (userSetting.getDeviceStatusNotify()) {
// 发送redis消息 // 发送redis消息
redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), false); redisCatchStorage.sendDeviceOrChannelStatus(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), false);
@ -224,16 +207,11 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
channel.setUpdateTime(DateUtil.getNow()); channel.setUpdateTime(DateUtil.getNow());
channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.UPDATE, channel)); channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.UPDATE, channel));
// 发送通道修改消息
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForUpdate(this, channel));
} else { } else {
catalogChannelEvent.getChannel().setUpdateTime(DateUtil.getNow()); catalogChannelEvent.getChannel().setUpdateTime(DateUtil.getNow());
catalogChannelEvent.getChannel().setCreateTime(DateUtil.getNow()); catalogChannelEvent.getChannel().setCreateTime(DateUtil.getNow());
channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.ADD, channel)); channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.ADD, channel));
// 发送通道修改消息
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForAdd(this, channel));
if (userSetting.getDeviceStatusNotify()) { if (userSetting.getDeviceStatusNotify()) {
// 发送redis消息 // 发送redis消息
redisCatchStorage.sendChannelAddOrDelete(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), true); redisCatchStorage.sendChannelAddOrDelete(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), true);
@ -246,9 +224,6 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
log.info("[收到删除通道通知] 来自设备: {}, 通道 {}", device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId()); log.info("[收到删除通道通知] 来自设备: {}, 通道 {}", device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId());
channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.DELETE, channel)); channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.DELETE, channel));
// 发送通道修改消息
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForDelete(this, channel));
if (userSetting.getDeviceStatusNotify()) { if (userSetting.getDeviceStatusNotify()) {
// 发送redis消息 // 发送redis消息
redisCatchStorage.sendChannelAddOrDelete(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), false); redisCatchStorage.sendChannelAddOrDelete(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), false);
@ -265,17 +240,12 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
channel.setUpdateTime(DateUtil.getNow()); channel.setUpdateTime(DateUtil.getNow());
channel.setUpdateTime(DateUtil.getNow()); channel.setUpdateTime(DateUtil.getNow());
channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.UPDATE, channel)); channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.UPDATE, channel));
// 发送通道修改消息
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForUpdate(this, channel));
} else { } else {
catalogChannelEvent.getChannel().setCreateTime(DateUtil.getNow()); catalogChannelEvent.getChannel().setCreateTime(DateUtil.getNow());
catalogChannelEvent.getChannel().setUpdateTime(DateUtil.getNow()); catalogChannelEvent.getChannel().setUpdateTime(DateUtil.getNow());
channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.ADD, channel)); channelList.add(NotifyCatalogChannel.getInstance(NotifyCatalogChannel.Type.ADD, channel));
// 发送通道修改消息
applicationEventPublisher.publishEvent(ChannelEvent.getInstanceForAdd(this, channel));
if (userSetting.getDeviceStatusNotify()) { if (userSetting.getDeviceStatusNotify()) {
// 发送redis消息 // 发送redis消息
redisCatchStorage.sendChannelAddOrDelete(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), true); redisCatchStorage.sendChannelAddOrDelete(device.getDeviceId(), catalogChannelEvent.getChannel().getDeviceId(), true);