[集群] 修复同步通道时的通道上下线消息发送
parent
3bae4ce63e
commit
01f491c026
|
@ -244,5 +244,15 @@ public class DeviceChannel extends CommonGBChannel {
|
||||||
return deviceChannel;
|
return deviceChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CommonGBChannel buildCommonGBChannelForStatus() {
|
||||||
|
CommonGBChannel commonGBChannel = new CommonGBChannel();
|
||||||
|
commonGBChannel.setGbId(id);
|
||||||
|
commonGBChannel.setGbDeviceId(deviceId);
|
||||||
|
commonGBChannel.setGbName(name);
|
||||||
|
commonGBChannel.setDataType(ChannelDataType.GB28181.value);
|
||||||
|
commonGBChannel.setDataDeviceId(getDataDeviceId());
|
||||||
|
return commonGBChannel;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,10 @@ public interface PlatformChannelMapper {
|
||||||
"where dc.channel_type = 0 and dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}")
|
"where dc.channel_type = 0 and dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}")
|
||||||
List<Device> queryDeviceInfoByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
|
List<Device> queryDeviceInfoByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
|
||||||
|
|
||||||
@Select("SELECT pgc.* from wvp_platform_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_type = 0 and dc.device_id=#{channelId}")
|
@Select(" SELECT wp.* from wvp_platform_channel pgc " +
|
||||||
|
" left join wvp_device_channel dc on dc.id = pgc.device_channel_id " +
|
||||||
|
" left join wvp_platform wp on wp.id = pgc.platform_id" +
|
||||||
|
" WHERE dc.channel_type = 0 and dc.device_id=#{channelId}")
|
||||||
List<Platform> queryParentPlatformByChannelId(@Param("channelId") String channelId);
|
List<Platform> queryParentPlatformByChannelId(@Param("channelId") String channelId);
|
||||||
|
|
||||||
@Select("<script>" +
|
@Select("<script>" +
|
||||||
|
|
|
@ -534,7 +534,7 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
||||||
List<Platform> platformList = platformChannelMapper.queryParentPlatformByChannelId(deviceChannel.getDeviceId());
|
List<Platform> platformList = platformChannelMapper.queryParentPlatformByChannelId(deviceChannel.getDeviceId());
|
||||||
if (!CollectionUtils.isEmpty(platformList)){
|
if (!CollectionUtils.isEmpty(platformList)){
|
||||||
platformList.forEach(platform->{
|
platformList.forEach(platform->{
|
||||||
eventPublisher.catalogEventPublish(platform, deviceChannel, deviceChannel.getStatus().equals("ON")? CatalogEvent.ON:CatalogEvent.OFF);
|
eventPublisher.catalogEventPublish(platform, deviceChannel.buildCommonGBChannelForStatus(), deviceChannel.getStatus().equals("ON")? CatalogEvent.ON:CatalogEvent.OFF);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue