国标级联通道共享支持自定义通道编号和名称

This commit is contained in:
648540858
2024-08-29 16:47:46 +08:00
parent e55cd08b08
commit 8dc27d1353
9 changed files with 680 additions and 311 deletions

View File

@@ -34,4 +34,6 @@ public interface IPlatformChannelService {
void addChannelByDevice(Integer platformId, List<Integer> deviceIds);
void removeChannelByDevice(Integer platformId, List<Integer> deviceIds);
void updateCustomChannel(PlatformChannel channel);
}

View File

@@ -56,7 +56,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
@Override
public PageInfo<PlatformChannel> queryChannelList(int page, int count, String query, Boolean online, Integer platformId, Boolean hasShare) {
PageHelper.startPage(page, count);
List<PlatformChannel> all = platformChannelMapper.queryForPlatformSearch(platformId, query, online, hasShare);
List<PlatformChannel> all = platformChannelMapper.queryForPlatformForWebList(platformId, query, online, hasShare);
return new PageInfo<>(all);
}
@@ -413,4 +413,18 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
log.error("[命令发送失败] 国标级联 Catalog通知: {}", e.getMessage());
}
}
@Override
public void updateCustomChannel(PlatformChannel channel) {
platformChannelMapper.updateCustomChannel(channel);
CommonGBChannel commonGBChannel = platformChannelMapper.queryShareChannel(channel.getPlatformId(), channel.getGbId());
// 发送消息
try {
// 发送catalog
eventPublisher.catalogEventPublish(channel.getPlatformId(), commonGBChannel, CatalogEvent.UPDATE);
} catch (Exception e) {
log.warn("[自定义通道信息] 发送失败, 平台ID {} 通道: {}{}", channel.getPlatformId(),
channel.getGbName(), channel.getGbDeviceDbId(), e);
}
}
}