优化国标级联目录订阅通知以及目录查询回复

This commit is contained in:
648540858
2022-07-17 23:17:36 +08:00
parent be5dbc9a21
commit 4451994959
50 changed files with 1159 additions and 819 deletions

View File

@@ -11,13 +11,40 @@ public class CatalogEvent extends ApplicationEvent {
super(source);
}
public static final String ON = "ON"; // 上线
public static final String OFF = "OFF"; // 离线
public static final String VLOST = "VLOST"; // 视频丢失
public static final String DEFECT = "DEFECT"; // 故障
public static final String ADD = "ADD"; // 增加
public static final String DEL = "DEL"; // 删除
public static final String UPDATE = "UPDATE"; // 更新
/**
* 上线
*/
public static final String ON = "ON";
/**
* 离线
*/
public static final String OFF = "OFF";
/**
* 视频丢失
*/
public static final String VLOST = "VLOST";
/**
* 故障
*/
public static final String DEFECT = "DEFECT";
/**
* 增加
*/
public static final String ADD = "ADD";
/**
* 删除
*/
public static final String DEL = "DEL";
/**
* 更新
*/
public static final String UPDATE = "UPDATE";
private List<DeviceChannel> deviceChannels;
private List<GbStream> gbStreams;

View File

@@ -59,16 +59,15 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
Map<String, List<ParentPlatform>> parentPlatformMap = new HashMap<>();
if (!StringUtils.isEmpty(event.getPlatformId())) {
subscribe = subscribeHolder.getCatalogSubscribe(event.getPlatformId());
if (subscribe == null) {
return;
}
parentPlatform = storager.queryParentPlatByServerGBId(event.getPlatformId());
if (parentPlatform != null && !parentPlatform.isStatus()) {
return;
}
subscribe = subscribeHolder.getCatalogSubscribe(event.getPlatformId());
if (subscribe == null) {
logger.info("发送订阅消息时发现订阅信息已经不存在: {}", event.getPlatformId());
return;
}
}else {
// 获取所用订阅
List<String> platforms = subscribeHolder.getAllCatalogSubscribePlatform();
@@ -144,11 +143,8 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
}
if (event.getGbStreams() != null && event.getGbStreams().size() > 0){
for (GbStream gbStream : event.getGbStreams()) {
DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), parentPlatform);
if (deviceChannelByStream.getParentId().length() <= 10) { // 父节点是行政区划,则设置CivilCode使用此行政区划
deviceChannelByStream.setCivilCode(deviceChannelByStream.getParentId());
}
deviceChannelList.add(deviceChannelByStream);
deviceChannelList.add(
gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), parentPlatform));
}
}
if (deviceChannelList.size() > 0) {