| | |
| | | private EventPublisher eventPublisher; |
| | | |
| | | @Override |
| | | public PageInfo<GbStream> getAll(Integer page, Integer count, String platFormId) { |
| | | public PageInfo<GbStream> getAll(Integer page, Integer count, String platFormId, String catalogId, String query, Boolean pushing, String mediaServerId) { |
| | | PageHelper.startPage(page, count); |
| | | List<GbStream> all = gbStreamMapper.selectAll(platFormId); |
| | | List<GbStream> all = gbStreamMapper.selectAll(platFormId, catalogId, query, pushing, mediaServerId); |
| | | return new PageInfo<>(all); |
| | | } |
| | | |
| | |
| | | boolean result = false; |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | | ParentPlatform parentPlatform = platformMapper.getParentPlatByServerGBId(platformId); |
| | | if (catalogId == null) catalogId = parentPlatform.getCatalogId(); |
| | | try { |
| | | List<DeviceChannel> deviceChannelList = new ArrayList<>(); |
| | | for (GbStream gbStream : gbStreams) { |
| | |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | | try { |
| | | List<DeviceChannel> deviceChannelList = new ArrayList<>(); |
| | | platformGbStreamMapper.delByAppAndStreamsByPlatformId(gbStreams, platformId); |
| | | for (GbStream gbStream : gbStreams) { |
| | | platformGbStreamMapper.delByAppAndStreamAndPlatform(gbStream.getApp(), gbStream.getStream(), platformId); |
| | | DeviceChannel deviceChannel = new DeviceChannel(); |
| | | deviceChannel.setChannelId(gbStream.getGbId()); |
| | | deviceChannelList.add(deviceChannel); |
| | | eventPublisher.catalogEventPublish(platformId, deviceChannel, CatalogEvent.DEL); |
| | | } |
| | | |
| | | eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL); |
| | | dataSourceTransactionManager.commit(transactionStatus); //手动提交 |
| | | result = true; |
| | | }catch (Exception e) { |
| | |
| | | List<ParentPlatform> parentPlatforms = platformGbStreamMapper.selectByAppAndStream(gs.getApp(), gs.getStream()); |
| | | if (parentPlatforms.size() > 0) { |
| | | for (ParentPlatform parentPlatform : parentPlatforms) { |
| | | eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), gs, type); |
| | | if (parentPlatform != null) { |
| | | eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), gs, type); |
| | | } |
| | | } |
| | | } |
| | | } |