解决串流,解决编辑上级平台却新建了的问题
This commit is contained in:
@@ -194,7 +194,7 @@ public interface IVideoManagerStorager {
|
||||
* @param platformGbId
|
||||
* @return
|
||||
*/
|
||||
ParentPlatform queryParentPlatById(String platformGbId);
|
||||
ParentPlatform queryParentPlatByServerGBId(String platformGbId);
|
||||
|
||||
/**
|
||||
* 所有平台离线
|
||||
|
||||
@@ -25,6 +25,7 @@ public interface ParentPlatformMapper {
|
||||
"SET enable=#{enable}, " +
|
||||
"name=#{name}," +
|
||||
"deviceGBId=#{deviceGBId}," +
|
||||
"serverGBId=#{serverGBId}, " +
|
||||
"serverGBDomain=#{serverGBDomain}, " +
|
||||
"serverIP=#{serverIP}," +
|
||||
"serverPort=#{serverPort}, " +
|
||||
@@ -39,7 +40,7 @@ public interface ParentPlatformMapper {
|
||||
"ptz=#{ptz}, " +
|
||||
"rtcp=#{rtcp}, " +
|
||||
"status=#{status} " +
|
||||
"WHERE serverGBId=#{serverGBId}")
|
||||
"WHERE id=#{id}")
|
||||
int updateParentPlatform(ParentPlatform parentPlatform);
|
||||
|
||||
@Delete("DELETE FROM parent_platform WHERE serverGBId=#{serverGBId}")
|
||||
@@ -52,7 +53,10 @@ public interface ParentPlatformMapper {
|
||||
List<ParentPlatform> getEnableParentPlatformList(boolean enable);
|
||||
|
||||
@Select("SELECT * FROM parent_platform WHERE serverGBId=#{platformGbId}")
|
||||
ParentPlatform getParentPlatById(String platformGbId);
|
||||
ParentPlatform getParentPlatByServerGBId(String platformGbId);
|
||||
|
||||
@Select("SELECT * FROM parent_platform WHERE id=#{id}")
|
||||
ParentPlatform getParentPlatById(int id);
|
||||
|
||||
@Update("UPDATE parent_platform SET status=false" )
|
||||
void outlineForAllParentPlatform();
|
||||
|
||||
@@ -271,15 +271,21 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
||||
public boolean updateParentPlatform(ParentPlatform parentPlatform) {
|
||||
int result = 0;
|
||||
ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId());
|
||||
if ( platformMapper.getParentPlatById(parentPlatform.getServerGBId()) == null) {
|
||||
if (parentPlatform.getId() == null ) {
|
||||
result = platformMapper.addParentPlatform(parentPlatform);
|
||||
|
||||
if (parentPlatformCatch == null) {
|
||||
parentPlatformCatch = new ParentPlatformCatch();
|
||||
parentPlatformCatch.setParentPlatform(parentPlatform);
|
||||
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
||||
}
|
||||
}else {
|
||||
if (parentPlatformCatch == null) { // serverGBId 已变化
|
||||
ParentPlatform parentPlatById = platformMapper.getParentPlatById(parentPlatform.getId());
|
||||
// 使用旧的查出缓存ID
|
||||
parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatById.getServerGBId());
|
||||
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
||||
redisCatchStorage.delPlatformCatchInfo(parentPlatById.getServerGBId());
|
||||
}
|
||||
result = platformMapper.updateParentPlatform(parentPlatform);
|
||||
}
|
||||
// 更新缓存
|
||||
@@ -305,8 +311,8 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParentPlatform queryParentPlatById(String platformGbId) {
|
||||
return platformMapper.getParentPlatById(platformGbId);
|
||||
public ParentPlatform queryParentPlatByServerGBId(String platformGbId) {
|
||||
return platformMapper.getParentPlatByServerGBId(platformGbId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user