完成向上级联->点播--增加了sdp解析

修复修改平台主键带来的bug
This commit is contained in:
panlinlin
2021-01-15 17:21:02 +08:00
parent cf8a22f50b
commit 503f891c9e
21 changed files with 976 additions and 81 deletions

View File

@@ -73,4 +73,9 @@ public interface IRedisCatchStorage {
void delPlatformRegister(String platformGbId);
void updatePlatformRegisterInfo(String callId, String platformGbId);
String queryPlatformRegisterInfo(String callId);
void delPlatformRegisterInfo(String callId);
}

View File

@@ -233,4 +233,5 @@ public interface IVideoManagerStorager {
int delChannelForGB(String platformId, List<ChannelReduce> channelReduces);
DeviceChannel queryChannelInParentPlatform(String platformId, String channelId);
}

View File

@@ -24,7 +24,7 @@ public interface ParentPlatformMapper {
@Update("UPDATE parent_platform " +
"SET enable=#{enable}, " +
"name=#{name}," +
"serverGBId=#{serverGBId}," +
"deviceGBId=#{deviceGBId}," +
"serverGBDomain=#{serverGBDomain}, " +
"serverIP=#{serverIP}," +
"serverPort=#{serverPort}, " +
@@ -39,13 +39,13 @@ public interface ParentPlatformMapper {
"PTZEnable=#{PTZEnable}, " +
"rtcp=#{rtcp}, " +
"status=#{status} " +
"WHERE deviceGBId=#{deviceGBId}")
"WHERE serverGBId=#{serverGBId}")
int updateParentPlatform(ParentPlatform parentPlatform);
@Delete("DELETE FROM parent_platform WHERE deviceGBId=#{deviceGBId}")
@Delete("DELETE FROM parent_platform WHERE serverGBId=#{serverGBId}")
int delParentPlatform(ParentPlatform parentPlatform);
@Select("SELECT *,( SELECT count(0) FROM platform_gb_channel pc WHERE pc.platformId = pp.deviceGBId) as channelCount FROM parent_platform pp ")
@Select("SELECT *,( SELECT count(0) FROM platform_gb_channel pc WHERE pc.platformId = pp.serverGBId) as channelCount FROM parent_platform pp ")
List<ParentPlatform> getParentPlatformList();
@Select("SELECT * FROM parent_platform WHERE enable=#{enable}")

View File

@@ -1,5 +1,6 @@
package com.genersoft.iot.vmp.storager.dao;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
@@ -39,4 +40,9 @@ public interface PatformChannelMapper {
"DELETE FROM platform_gb_channel WHERE platformId='${platformId}'" +
"</script>")
int cleanChannelForGB(String platformId);
@Select("SELECT * FROM device_channel WHERE deviceId = (SELECT deviceId FROM platform_gb_channel WHERE " +
"platformId='${platformId}' AND channelId='${channelId}' ) AND channelId='${channelId}'")
DeviceChannel queryChannelInParentPlatform(String platformId, String channelId);
}

View File

@@ -169,13 +169,13 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
@Override
public void updatePlatformKeepalive(ParentPlatform parentPlatform) {
String key = VideoManagerConstants.PLATFORM_KEEPLIVEKEY_PREFIX + parentPlatform.getDeviceGBId();
String key = VideoManagerConstants.PLATFORM_KEEPLIVEKEY_PREFIX + parentPlatform.getServerGBId();
redis.set(key, "", Integer.parseInt(parentPlatform.getKeepTimeout()));
}
@Override
public void updatePlatformRegister(ParentPlatform parentPlatform) {
String key = VideoManagerConstants.PLATFORM_REGISTER_PREFIX + parentPlatform.getDeviceGBId();
String key = VideoManagerConstants.PLATFORM_REGISTER_PREFIX + parentPlatform.getServerGBId();
redis.set(key, "", Integer.parseInt(parentPlatform.getExpires()));
}
@@ -198,4 +198,22 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
public void delPlatformRegister(String platformGbId) {
redis.del(VideoManagerConstants.PLATFORM_REGISTER_PREFIX + platformGbId);
}
@Override
public void updatePlatformRegisterInfo(String callId, String platformGbId) {
String key = VideoManagerConstants.PLATFORM_REGISTER_INFO_PREFIX + callId;
redis.set(key, platformGbId);
}
@Override
public String queryPlatformRegisterInfo(String callId) {
return (String)redis.get(VideoManagerConstants.PLATFORM_REGISTER_INFO_PREFIX + callId);
}
@Override
public void delPlatformRegisterInfo(String callId) {
redis.del(VideoManagerConstants.PLATFORM_REGISTER_INFO_PREFIX + callId);
}
}

View File

@@ -254,7 +254,7 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
public boolean deleteParentPlatform(ParentPlatform parentPlatform) {
int result = platformMapper.delParentPlatform(parentPlatform);
// 删除关联的通道
patformChannelMapper.cleanChannelForGB(parentPlatform.getDeviceGBId());
patformChannelMapper.cleanChannelForGB(parentPlatform.getServerGBId());
return result > 0;
}
@@ -329,4 +329,10 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
return result;
}
@Override
public DeviceChannel queryChannelInParentPlatform(String platformId, String channelId) {
DeviceChannel channel = patformChannelMapper.queryChannelInParentPlatform(platformId, channelId);
return channel;
}
}