Merge branch 'wvp-28181-2.0' into main-dev
commit
11c7deb876
|
@ -163,7 +163,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||||
// 查询平台下是否有该通道
|
// 查询平台下是否有该通道
|
||||||
DeviceChannel channel = storager.queryChannelInParentPlatform(requesterId, channelId);
|
DeviceChannel channel = storager.queryChannelInParentPlatform(requesterId, channelId);
|
||||||
GbStream gbStream = storager.queryStreamInParentPlatform(requesterId, channelId);
|
GbStream gbStream = storager.queryStreamInParentPlatform(requesterId, channelId);
|
||||||
PlatformCatalog catalog = storager.getCatalog(channelId);
|
PlatformCatalog catalog = storager.getCatalog(requesterId, channelId);
|
||||||
|
|
||||||
MediaServerItem mediaServerItem = null;
|
MediaServerItem mediaServerItem = null;
|
||||||
StreamPushItem streamPushItem = null;
|
StreamPushItem streamPushItem = null;
|
||||||
|
|
|
@ -262,6 +262,7 @@ public class NotifyRequestForCatalogProcessor extends SIPRequestProcessorParent
|
||||||
}
|
}
|
||||||
|
|
||||||
private void executeSave(){
|
private void executeSave(){
|
||||||
|
executeSaveForAdd();
|
||||||
executeSaveForUpdate();
|
executeSaveForUpdate();
|
||||||
executeSaveForDelete();
|
executeSaveForDelete();
|
||||||
executeSaveForOnline();
|
executeSaveForOnline();
|
||||||
|
|
|
@ -114,7 +114,7 @@ public class GbStreamServiceImpl implements IGbStreamService {
|
||||||
|
|
||||||
deviceChannel.setRegisterWay(1);
|
deviceChannel.setRegisterWay(1);
|
||||||
|
|
||||||
PlatformCatalog catalog = catalogMapper.select(catalogId);
|
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platform.getServerGBId(), catalogId);
|
||||||
if (catalog != null) {
|
if (catalog != null) {
|
||||||
deviceChannel.setCivilCode(catalog.getCivilCode());
|
deviceChannel.setCivilCode(catalog.getCivilCode());
|
||||||
deviceChannel.setParentId(catalog.getParentId());
|
deviceChannel.setParentId(catalog.getParentId());
|
||||||
|
@ -216,7 +216,7 @@ public class GbStreamServiceImpl implements IGbStreamService {
|
||||||
deviceChannel.setStatus(status != null && status);
|
deviceChannel.setStatus(status != null && status);
|
||||||
|
|
||||||
deviceChannel.setRegisterWay(1);
|
deviceChannel.setRegisterWay(1);
|
||||||
PlatformCatalog catalog = catalogMapper.select(catalogId);
|
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platform.getServerGBId(), catalogId);
|
||||||
if (catalog != null) {
|
if (catalog != null) {
|
||||||
deviceChannel.setCivilCode(catalog.getCivilCode());
|
deviceChannel.setCivilCode(catalog.getCivilCode());
|
||||||
deviceChannel.setParentId(catalog.getParentId());
|
deviceChannel.setParentId(catalog.getParentId());
|
||||||
|
|
|
@ -125,7 +125,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService {
|
||||||
private List<DeviceChannel> getDeviceChannelListByChannelReduceList(List<ChannelReduce> channelReduces, String catalogId, ParentPlatform platform) {
|
private List<DeviceChannel> getDeviceChannelListByChannelReduceList(List<ChannelReduce> channelReduces, String catalogId, ParentPlatform platform) {
|
||||||
List<DeviceChannel> deviceChannelList = new ArrayList<>();
|
List<DeviceChannel> deviceChannelList = new ArrayList<>();
|
||||||
if (channelReduces.size() > 0){
|
if (channelReduces.size() > 0){
|
||||||
PlatformCatalog catalog = catalogManager.select(catalogId);
|
PlatformCatalog catalog = catalogManager.selectByPlatFormAndCatalogId(platform.getServerGBId(),catalogId);
|
||||||
if (catalog == null || !catalogId.equals(platform.getDeviceGBId())) {
|
if (catalog == null || !catalogId.equals(platform.getDeviceGBId())) {
|
||||||
logger.warn("未查询到目录{}的信息", catalogId);
|
logger.warn("未查询到目录{}的信息", catalogId);
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -342,9 +342,9 @@ public interface IVideoManagerStorage {
|
||||||
|
|
||||||
int addCatalog(PlatformCatalog platformCatalog);
|
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);
|
int updateCatalog(PlatformCatalog platformCatalog);
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@ public interface PlatformCatalogMapper {
|
||||||
"(#{id}, #{name}, #{platformId}, #{parentId}, #{civilCode}, #{businessGroupId})")
|
"(#{id}, #{name}, #{platformId}, #{parentId}, #{civilCode}, #{businessGroupId})")
|
||||||
int add(PlatformCatalog platformCatalog);
|
int add(PlatformCatalog platformCatalog);
|
||||||
|
|
||||||
@Delete("DELETE from wvp_platform_catalog WHERE id=#{id}")
|
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId} and id=#{id}")
|
||||||
int del(String id);
|
int del(String platformId, String id);
|
||||||
|
|
||||||
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}")
|
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}")
|
||||||
int delByPlatformId(String 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")
|
"group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id")
|
||||||
List<PlatformCatalog> selectByParentId(String platformId, String parentId);
|
List<PlatformCatalog> 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 = {" <script>" +
|
@Update(value = {" <script>" +
|
||||||
"UPDATE wvp_platform_catalog " +
|
"UPDATE wvp_platform_catalog " +
|
||||||
"SET name=#{name}" +
|
"SET name=#{name}" +
|
||||||
"WHERE id=#{id}"+
|
"WHERE id=#{id} and platform_id=#{platformId}"+
|
||||||
"</script>"})
|
"</script>"})
|
||||||
int update(PlatformCatalog platformCatalog);
|
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})")
|
@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);
|
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 " +
|
@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}")
|
" from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}")
|
||||||
List<DeviceChannel> queryCatalogInPlatform(String platformId);
|
List<DeviceChannel> 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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,9 +73,9 @@ public interface PlatformChannelMapper {
|
||||||
List<Device> queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId);
|
List<Device> queryVideoDeviceByPlatformIdAndChannelId(String platformId, String channelId);
|
||||||
|
|
||||||
@Delete("<script> "+
|
@Delete("<script> "+
|
||||||
"DELETE from wvp_platform_gb_channel WHERE catalog_id=#{id}" +
|
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} and catalog_id=#{id}" +
|
||||||
"</script>")
|
"</script>")
|
||||||
int delByCatalogId(String id);
|
int delByCatalogId(String platformId, String id);
|
||||||
|
|
||||||
@Delete("<script> "+
|
@Delete("<script> "+
|
||||||
"DELETE from wvp_platform_gb_channel WHERE catalog_id=#{parentId} AND platform_id=#{platformId} AND channel_id=#{id}" +
|
"DELETE from wvp_platform_gb_channel WHERE catalog_id=#{parentId} AND platform_id=#{platformId} AND channel_id=#{id}" +
|
||||||
|
|
|
@ -50,8 +50,8 @@ public interface PlatformGbStreamMapper {
|
||||||
|
|
||||||
@Select("SELECT pgs.*, gs.gb_id from wvp_platform_gb_stream pgs " +
|
@Select("SELECT pgs.*, gs.gb_id from wvp_platform_gb_stream pgs " +
|
||||||
"LEFT join wvp_gb_stream gs ON pgs.gb_stream_id = gs.gb_stream_id " +
|
"LEFT join wvp_gb_stream gs ON pgs.gb_stream_id = gs.gb_stream_id " +
|
||||||
"WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{serverGBId}")
|
"WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{platformId}")
|
||||||
StreamProxyItem selectOne(String app, String stream, String serverGBId);
|
StreamProxyItem selectOne(String app, String stream, String platformId);
|
||||||
|
|
||||||
@Select("select gs.* \n" +
|
@Select("select gs.* \n" +
|
||||||
"from wvp_gb_stream gs\n" +
|
"from wvp_gb_stream gs\n" +
|
||||||
|
@ -67,9 +67,6 @@ public interface PlatformGbStreamMapper {
|
||||||
"where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}")
|
"where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}")
|
||||||
List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId);
|
List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(String platformId, String catalogId);
|
||||||
|
|
||||||
@Delete("DELETE from wvp_platform_gb_stream WHERE catalog_id=#{id}")
|
|
||||||
int delByCatalogId(String id);
|
|
||||||
|
|
||||||
@Select("<script> " +
|
@Select("<script> " +
|
||||||
"SELECT " +
|
"SELECT " +
|
||||||
"pp.* " +
|
"pp.* " +
|
||||||
|
|
|
@ -806,7 +806,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
if (platformCatalog.getParentId().length() <= 8) {
|
if (platformCatalog.getParentId().length() <= 8) {
|
||||||
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
||||||
}else {
|
}else {
|
||||||
PlatformCatalog catalog = catalogMapper.select(platformCatalog.getParentId());
|
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platformCatalog.getPlatformId(), platformCatalog.getParentId());
|
||||||
if (catalog != null) {
|
if (catalog != null) {
|
||||||
platformCatalog.setCivilCode(catalog.getCivilCode());
|
platformCatalog.setCivilCode(catalog.getCivilCode());
|
||||||
}
|
}
|
||||||
|
@ -816,7 +816,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
if (platformCatalog.getParentId().length() <= 8) {
|
if (platformCatalog.getParentId().length() <= 8) {
|
||||||
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
platformCatalog.setCivilCode(platformCatalog.getParentId());
|
||||||
}else {
|
}else {
|
||||||
PlatformCatalog catalog = catalogMapper.select(platformCatalog.getParentId());
|
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platformCatalog.getPlatformId(),platformCatalog.getParentId());
|
||||||
if (catalog == null) {
|
if (catalog == null) {
|
||||||
logger.warn("[添加目录] 无法获取目录{}的CivilCode和BusinessGroupId", platformCatalog.getPlatformId());
|
logger.warn("[添加目录] 无法获取目录{}的CivilCode和BusinessGroupId", platformCatalog.getPlatformId());
|
||||||
break;
|
break;
|
||||||
|
@ -845,7 +845,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
}
|
}
|
||||||
|
|
||||||
private PlatformCatalog getTopCatalog(String id, String platformId) {
|
private PlatformCatalog getTopCatalog(String id, String platformId) {
|
||||||
PlatformCatalog catalog = catalogMapper.selectParentCatalog(id);
|
PlatformCatalog catalog = catalogMapper.selectByPlatFormAndCatalogId(platformId, id);
|
||||||
if (catalog.getParentId().equals(platformId)) {
|
if (catalog.getParentId().equals(platformId)) {
|
||||||
return catalog;
|
return catalog;
|
||||||
}else {
|
}else {
|
||||||
|
@ -854,27 +854,16 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PlatformCatalog getCatalog(String id) {
|
public PlatformCatalog getCatalog(String platformId, String id) {
|
||||||
return catalogMapper.select(id);
|
return catalogMapper.selectByPlatFormAndCatalogId(platformId, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int delCatalog(String id) {
|
public int delCatalog(String platformId, String id) {
|
||||||
PlatformCatalog platformCatalog = catalogMapper.select(id);
|
return delCatalogExecute(id, platformId);
|
||||||
if (platformCatalog.getChildrenCount() > 0) {
|
|
||||||
List<PlatformCatalog> platformCatalogList = catalogMapper.selectByParentId(platformCatalog.getPlatformId(), platformCatalog.getId());
|
|
||||||
for (PlatformCatalog catalog : platformCatalogList) {
|
|
||||||
if (catalog.getChildrenCount() == 0) {
|
|
||||||
delCatalogExecute(catalog.getId(), catalog.getPlatformId());
|
|
||||||
}else {
|
|
||||||
delCatalog(catalog.getId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return delCatalogExecute(id, platformCatalog.getPlatformId());
|
|
||||||
}
|
}
|
||||||
private int delCatalogExecute(String id, String platformId) {
|
private int delCatalogExecute(String id, String platformId) {
|
||||||
int delresult = catalogMapper.del(id);
|
int delresult = catalogMapper.del(platformId, id);
|
||||||
DeviceChannel deviceChannelForCatalog = new DeviceChannel();
|
DeviceChannel deviceChannelForCatalog = new DeviceChannel();
|
||||||
if (delresult > 0){
|
if (delresult > 0){
|
||||||
deviceChannelForCatalog.setChannelId(id);
|
deviceChannelForCatalog.setChannelId(id);
|
||||||
|
@ -891,7 +880,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
}
|
}
|
||||||
eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL);
|
eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL);
|
||||||
}
|
}
|
||||||
int delStreamresult = platformGbStreamMapper.delByCatalogId(id);
|
int delStreamresult = platformGbStreamMapper.delByPlatformAndCatalogId(platformId,id);
|
||||||
List<PlatformCatalog> platformCatalogs = platformChannelMapper.queryChannelInParentPlatformAndCatalog(platformId, id);
|
List<PlatformCatalog> platformCatalogs = platformChannelMapper.queryChannelInParentPlatformAndCatalog(platformId, id);
|
||||||
if (platformCatalogs.size() > 0){
|
if (platformCatalogs.size() > 0){
|
||||||
List<DeviceChannel> deviceChannelList = new ArrayList<>();
|
List<DeviceChannel> deviceChannelList = new ArrayList<>();
|
||||||
|
@ -902,7 +891,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||||
}
|
}
|
||||||
eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL);
|
eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL);
|
||||||
}
|
}
|
||||||
int delChannelresult = platformChannelMapper.delByCatalogId(id);
|
int delChannelresult = platformChannelMapper.delByCatalogId(platformId, id);
|
||||||
return delresult + delChannelresult + delStreamresult;
|
return delresult + delChannelresult + delStreamresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -428,7 +428,7 @@ public class PlatformController {
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("添加目录,{}", JSON.toJSONString(platformCatalog));
|
logger.debug("添加目录,{}", JSON.toJSONString(platformCatalog));
|
||||||
}
|
}
|
||||||
PlatformCatalog platformCatalogInStore = storager.getCatalog(platformCatalog.getId());
|
PlatformCatalog platformCatalogInStore = storager.getCatalog(platformCatalog.getPlatformId(), platformCatalog.getId());
|
||||||
|
|
||||||
if (platformCatalogInStore != null) {
|
if (platformCatalogInStore != null) {
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), platformCatalog.getId() + " already exists");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), platformCatalog.getId() + " already exists");
|
||||||
|
@ -453,7 +453,7 @@ public class PlatformController {
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("编辑目录,{}", JSON.toJSONString(platformCatalog));
|
logger.debug("编辑目录,{}", JSON.toJSONString(platformCatalog));
|
||||||
}
|
}
|
||||||
PlatformCatalog platformCatalogInStore = storager.getCatalog(platformCatalog.getId());
|
PlatformCatalog platformCatalogInStore = storager.getCatalog(platformCatalog.getPlatformId(), platformCatalog.getId());
|
||||||
|
|
||||||
if (platformCatalogInStore == null) {
|
if (platformCatalogInStore == null) {
|
||||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), platformCatalog.getId() + " not exists");
|
throw new ControllerException(ErrorCode.ERROR100.getCode(), platformCatalog.getId() + " not exists");
|
||||||
|
@ -486,7 +486,7 @@ public class PlatformController {
|
||||||
throw new ControllerException(ErrorCode.ERROR400);
|
throw new ControllerException(ErrorCode.ERROR400);
|
||||||
}
|
}
|
||||||
|
|
||||||
int delResult = storager.delCatalog(id);
|
int delResult = storager.delCatalog(platformId, id);
|
||||||
// 如果删除的是默认目录则根目录设置为默认目录
|
// 如果删除的是默认目录则根目录设置为默认目录
|
||||||
PlatformCatalog parentPlatform = storager.queryDefaultCatalogInPlatform(platformId);
|
PlatformCatalog parentPlatform = storager.queryDefaultCatalogInPlatform(platformId);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue