diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java index be6a3c3d..1710a9cc 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java @@ -163,7 +163,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements // 查询平台下是否有该通道 DeviceChannel channel = storager.queryChannelInParentPlatform(requesterId, channelId); GbStream gbStream = storager.queryStreamInParentPlatform(requesterId, channelId); - PlatformCatalog catalog = storager.getCatalog(channelId); + PlatformCatalog catalog = storager.getCatalog(requesterId, channelId); MediaServerItem mediaServerItem = null; StreamPushItem streamPushItem = null; diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java index 281d780e..a78404e2 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestForCatalogProcessor.java @@ -262,6 +262,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent } private void executeSave(){ + executeSaveForAdd(); executeSaveForUpdate(); executeSaveForDelete(); executeSaveForOnline(); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java index 3fb2f93c..b3f4d7db 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java @@ -114,7 +114,7 @@ public class GbStreamServiceImpl implements IGbStreamService { deviceChannel.setRegisterWay(1); - PlatformCatalog catalog = catalogMapper.select(catalogId); + PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platform.getServerGBId(), catalogId); if (catalog != null) { deviceChannel.setCivilCode(catalog.getCivilCode()); deviceChannel.setParentId(catalog.getParentId()); @@ -216,7 +216,7 @@ public class GbStreamServiceImpl implements IGbStreamService { deviceChannel.setStatus(status != null && status); deviceChannel.setRegisterWay(1); - PlatformCatalog catalog = catalogMapper.select(catalogId); + PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platform.getServerGBId(), catalogId); if (catalog != null) { deviceChannel.setCivilCode(catalog.getCivilCode()); deviceChannel.setParentId(catalog.getParentId()); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java index eeea29a7..fa164289 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java @@ -125,7 +125,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { private List getDeviceChannelListByChannelReduceList(List channelReduces, String catalogId, ParentPlatform platform) { List deviceChannelList = new ArrayList<>(); if (channelReduces.size() > 0){ - PlatformCatalog catalog = catalogManager.select(catalogId); + PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId); if (catalog == null || !catalogId.equals(platform.getDeviceGBId())) { logger.warn("未查询到目录{}的信息", catalogId); return null; diff --git a/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java b/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java index b53c2d31..b0ff0113 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/IVideoManagerStorage.java @@ -342,9 +342,9 @@ public interface IVideoManagerStorage { int addCatalog(PlatformCatalog platformCatalog); - PlatformCatalog getCatalog(String id); + PlatformCatalog getCatalog(String platformId, String id); - int delCatalog(String id); + int delCatalog(String platformId, String id); int updateCatalog(PlatformCatalog platformCatalog); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java index 15fed7b0..3cb4776b 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java @@ -16,8 +16,8 @@ public interface PlatformCatalogMapper { "(#{id}, #{name}, #{platformId}, #{parentId}, #{civilCode}, #{businessGroupId})") int add(PlatformCatalog platformCatalog); - @Delete("DELETE from wvp_platform_catalog WHERE id=#{id}") - int del(String id); + @Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId} and id=#{id}") + int del(String platformId, String id); @Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}") int delByPlatformId(String platformId); @@ -28,13 +28,10 @@ public interface PlatformCatalogMapper { "group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id") List selectByParentId(String platformId, String parentId); - @Select("SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc WHERE pc.id=#{id}") - PlatformCatalog select(String id); - @Update(value = {" "}) int update(PlatformCatalog platformCatalog); @@ -44,11 +41,13 @@ public interface PlatformCatalogMapper { @Select("SELECT pc.* FROM wvp_platform_catalog pc WHERE pc.id = (SELECT pp.catalog_id from wvp_platform pp WHERE pp.server_gb_id=#{platformId})") PlatformCatalog selectDefaultByPlatFormId(String platformId); - - @Select("SELECT pc.* FROM wvp_platform_catalog pc WHERE pc.id = #{id}") - PlatformCatalog selectParentCatalog(String id); - @Select("SELECT pc.id as channel_id, pc.name, pc.civil_code, pc.business_group_id,'1' as parental, pc.parent_id " + " from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}") List queryCatalogInPlatform(String platformId); + + @Select("SELECT *, " + + "(SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count " + + " from wvp_platform_catalog pc " + + " WHERE pc.id=#{id} and pc.platform_id=#{platformId}") + PlatformCatalog selectByPlatFormAndCatalogId(String platformId, String id); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java index 3aeb0e0c..7a749cbd 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java @@ -73,9 +73,9 @@ public interface PlatformChannelMapper { List queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId); @Delete("") - int delByCatalogId(String id); + int delByCatalogId(String platformId, String id); @Delete("