修复WVP作为下级平台接收DeviceInfo指令固定响应的问题

This commit is contained in:
gaofw189
2023-01-17 17:22:38 +08:00
parent 26cd7dbaf9
commit 141b228267
6 changed files with 53 additions and 11 deletions

View File

@@ -186,7 +186,13 @@ public interface IVideoManagerStorage {
Device queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId);
/**
* 针对deviceinfo指令的查询接口
* @param platformId 平台id
* @param channelId 通道id
* @return 设备信息
*/
Device queryDeviceInfoByPlatformIdAndChannelId(String platformId, String channelId);
/**
* 添加Mobile Position设备移动位置
* @param mobilePosition

View File

@@ -107,4 +107,11 @@ public interface PlatformChannelMapper {
"DELETE FROM platform_gb_channel WHERE platformId=#{platformId} and catalogId=#{catalogId}" +
"</script>")
int delChannelForGBByCatalogId(String platformId, String catalogId);
@Select("select dc.channelId deviceId,dc.name,d.manufacturer,d.model,d.firmware\n" +
"from platform_gb_channel pgc\n" +
" left join device_channel dc on dc.id = pgc.deviceChannelId\n" +
" left join device d on dc.deviceId = d.deviceId\n" +
"where dc.channelId = #{channelId} and pgc.platformId=#{platformId}")
List<Device> queryDeviceInfoByPlatformIdAndChannelId(String platformId, String channelId);
}

View File

@@ -471,6 +471,20 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
}
@Override
public Device queryDeviceInfoByPlatformIdAndChannelId(String platformId, String channelId) {
List<Device> devices = platformChannelMapper.queryDeviceInfoByPlatformIdAndChannelId(platformId, channelId);
if (devices.size() > 1) {
// 出现长度大于0的时候肯定是国标通道的ID重复了
logger.warn("国标ID存在重复{}", channelId);
}
if (devices.size() == 0) {
return null;
}else {
return devices.get(0);
}
}
/**
* 查询最新移动位置
* @param deviceId