Merge branch '2.6.9' into wvp-28181-2.0
 
	
	
	
	
	
	
	
	
	
	
	
	
	
 |  |  | 
 |  |  |             // 添加错误订阅 | 
 |  |  |             if (errorEvent != null) { | 
 |  |  |                 sipSubscribe.addErrorSubscribe(callIdHeader.getCallId(), (eventResult -> { | 
 |  |  |                     errorEvent.response(eventResult); | 
 |  |  |                     sipSubscribe.removeErrorSubscribe(eventResult.callId); | 
 |  |  |                     sipSubscribe.removeOkSubscribe(eventResult.callId); | 
 |  |  |                     errorEvent.response(eventResult); | 
 |  |  |                 })); | 
 |  |  |             } | 
 |  |  |             // 添加订阅 | 
 |  |  |             if (okEvent != null) { | 
 |  |  |                 sipSubscribe.addOkSubscribe(callIdHeader.getCallId(), eventResult -> { | 
 |  |  |                     okEvent.response(eventResult); | 
 |  |  |                     sipSubscribe.removeOkSubscribe(eventResult.callId); | 
 |  |  |                     sipSubscribe.removeErrorSubscribe(eventResult.callId); | 
 |  |  |                     okEvent.response(eventResult); | 
 |  |  |                 }); | 
 |  |  |             } | 
 |  |  |             if ("TCP".equals(transport)) { | 
 
 |  |  | 
 |  |  |         }else { | 
 |  |  |             channels = deviceChannels.subList(index, deviceChannels.size()); | 
 |  |  |         } | 
 |  |  |         logger.info("[发送NOTIFY通知]类型: {},发送数量: {}", type, channels.size()); | 
 |  |  |         Integer finalIndex = index; | 
 |  |  |         String catalogXmlContent = getCatalogXmlContentForCatalogOther(parentPlatform, channels, type); | 
 |  |  |         sendNotify(parentPlatform, catalogXmlContent, subscribeInfo, eventResult -> { | 
 
 |  |  | 
 |  |  |         // 设置最小值为30 | 
 |  |  |         int subscribeCycleForCatalog = Math.max(device.getSubscribeCycleForMobilePosition(),30); | 
 |  |  |         // 刷新订阅 | 
 |  |  |         dynamicTask.startCron(device.getDeviceId() + "mobile_position" , mobilePositionSubscribeTask, (subscribeCycleForCatalog) * 1000); | 
 |  |  |         dynamicTask.startCron(device.getDeviceId() + "mobile_position" , mobilePositionSubscribeTask, subscribeCycleForCatalog * 1000); | 
 |  |  |         return true; | 
 |  |  |     } | 
 |  |  |  | 
 
 |  |  | 
 |  |  |         } | 
 |  |  |         try { | 
 |  |  |             List<DeviceChannel> deviceChannelList = new ArrayList<>(); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |             for (int i = 0; i < gbStreams.size(); i++) { | 
 |  |  |                 GbStream gbStream = gbStreams.get(i); | 
 |  |  |                 gbStream.setCatalogId(catalogId); | 
 |  |  | 
 |  |  |         if (platform == null) { | 
 |  |  |             return ; | 
 |  |  |         } | 
 |  |  |         if (platformGbStreamMapper.delByPlatformAndCatalogId(platformId, catalogId) > 0) { | 
 |  |  |             List<GbStream> gbStreams = platformGbStreamMapper.queryChannelInParentPlatformAndCatalog(platformId, catalogId); | 
 |  |  |             List<DeviceChannel> deviceChannelList = new ArrayList<>(); | 
 |  |  |             for (GbStream gbStream : gbStreams) { | 
 |  |  |                 DeviceChannel deviceChannel = new DeviceChannel(); | 
 |  |  |                 deviceChannel.setChannelId(gbStream.getGbId()); | 
 |  |  |                 deviceChannelList.add(deviceChannel); | 
 |  |  |             } | 
 |  |  |             eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL); | 
 |  |  |         if (ObjectUtils.isEmpty(catalogId)) { | 
 |  |  |             catalogId = null; | 
 |  |  |         } | 
 |  |  |         List<GbStream> gbStreams = platformGbStreamMapper.queryChannelInParentPlatformAndCatalog(platformId, catalogId); | 
 |  |  |         List<DeviceChannel> deviceChannelList = new ArrayList<>(); | 
 |  |  |         for (GbStream gbStream : gbStreams) { | 
 |  |  |             DeviceChannel deviceChannel = new DeviceChannel(); | 
 |  |  |             deviceChannel.setChannelId(gbStream.getGbId()); | 
 |  |  |             deviceChannelList.add(deviceChannel); | 
 |  |  |         } | 
 |  |  |         eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL); | 
 |  |  |         platformGbStreamMapper.delByPlatformAndCatalogId(platformId, catalogId); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @Override | 
 
 |  |  | 
 |  |  |             catalogId = null; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if ((result = platformChannelMapper.delChannelForGBByCatalogId(platformId, catalogId)) > 0) { | 
 |  |  |             List<DeviceChannel> deviceChannels = platformChannelMapper.queryAllChannelInCatalog(platformId, catalogId); | 
 |  |  |             eventPublisher.catalogEventPublish(platformId, deviceChannels, CatalogEvent.DEL); | 
 |  |  |         } | 
 |  |  |         return result; | 
 |  |  |         List<DeviceChannel> deviceChannels = platformChannelMapper.queryAllChannelInCatalog(platformId, catalogId); | 
 |  |  |         eventPublisher.catalogEventPublish(platformId, deviceChannels, CatalogEvent.DEL); | 
 |  |  |  | 
 |  |  |         return platformChannelMapper.delChannelForGBByCatalogId(platformId, catalogId); | 
 |  |  |     } | 
 |  |  | } | 
 
 |  |  | 
 |  |  |     @Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id=#{channelId} and pgc.platform_id=#{platformId}") | 
 |  |  |     List<DeviceChannel> queryChannelInParentPlatform(@Param("platformId") String platformId, @Param("channelId") String channelId); | 
 |  |  |  | 
 |  |  |     @Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}") | 
 |  |  |     @Select("<script> "+ | 
 |  |  |             "SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE pgc.platform_id=#{platformId} " + | 
 |  |  |             " <if test='catalogId != null' > and pgc.catalog_id=#{catalogId}</if>" + | 
 |  |  |             "</script>") | 
 |  |  |     List<DeviceChannel> queryAllChannelInCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId); | 
 |  |  |  | 
 |  |  |     @Select(" select dc.channel_id as id, dc.name as name, pgc.platform_id as platform_id, pgc.catalog_id as parent_id, 0 as children_count, 1 as type " + | 
 
 |  |  | 
 |  |  |             "WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{platformId}") | 
 |  |  |     StreamProxyItem selectOne(@Param("app") String app, @Param("stream") String stream, @Param("platformId") String platformId); | 
 |  |  |  | 
 |  |  |     @Select("select gs.* \n" + | 
 |  |  |             "from wvp_gb_stream gs\n" + | 
 |  |  |     @Select("<script> " + | 
 |  |  |             "select gs.* " + | 
 |  |  |             " from wvp_gb_stream gs\n" + | 
 |  |  |             "    left join wvp_platform_gb_stream pgs\n" + | 
 |  |  |             "        on gs.gb_stream_id = pgs.gb_stream_id\n" + | 
 |  |  |             "where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}") | 
 |  |  |             " where pgs.platform_id=#{platformId} " + | 
 |  |  |             " <if test='catalogId != null' > and pgs.catalog_id=#{catalogId}</if>" + | 
 |  |  |             "</script>") | 
 |  |  |     List<GbStream> queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId); | 
 |  |  |  | 
 |  |  |     @Select("select gs.gb_id as id, gs.name as name, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id , 0 as children_count, 2 as type\n" + | 
 
 |  |  | 
 |  |  |     @ResponseBody | 
 |  |  |     public void del(@RequestBody GbStreamParam gbStreamParam){ | 
 |  |  |  | 
 |  |  |         if (gbStreamParam.getGbStreams() == null || gbStreamParam.getGbStreams().size() == 0) { | 
 |  |  |         if (gbStreamParam.getGbStreams() == null || gbStreamParam.getGbStreams().isEmpty()) { | 
 |  |  |             if (gbStreamParam.isAll()) { | 
 |  |  |                 gbStreamService.delAllPlatformInfo(gbStreamParam.getPlatformId(), gbStreamParam.getCatalogId()); | 
 |  |  |             } | 
 |  |  | 
 |  |  |     @PostMapping(value = "/add") | 
 |  |  |     @ResponseBody | 
 |  |  |     public void add(@RequestBody GbStreamParam gbStreamParam){ | 
 |  |  |         if (gbStreamParam.getGbStreams() == null || gbStreamParam.getGbStreams().size() == 0) { | 
 |  |  |         if (gbStreamParam.getGbStreams() == null || gbStreamParam.getGbStreams().isEmpty()) { | 
 |  |  |             if (gbStreamParam.isAll()) { | 
 |  |  |                 List<GbStream> allGBChannels = gbStreamService.getAllGBChannels(gbStreamParam.getPlatformId()); | 
 |  |  |                 gbStreamService.addPlatformInfo(allGBChannels, gbStreamParam.getPlatformId(), gbStreamParam.getCatalogId()); | 
 
 |  |  | 
 |  |  |             <el-input v-model="form.name" clearable></el-input> | 
 |  |  |           </el-form-item> | 
 |  |  |           <el-form-item label="密码" prop="password"> | 
 |  |  |             <el-input type="password" v-model="form.password" clearable></el-input> | 
 |  |  |             <el-input v-model="form.password" clearable></el-input> | 
 |  |  |           </el-form-item> | 
 |  |  |           <el-form-item label="收流IP" prop="sdpIp"> | 
 |  |  |             <el-input type="sdpIp" v-model="form.sdpIp" clearable></el-input> |