| | |
| | | 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) { |
| | |
| | | "</script>") |
| | | void delByGbStreams(List<GbStream> gbStreams); |
| | | |
| | | |
| | | |
| | | @Delete("<script> "+ |
| | | "DELETE FROM platform_gb_stream where " + |
| | | "<foreach collection='gbStreams' item='item' separator='or'>" + |
| | | "(app=#{item.app} and stream=#{item.stream}) and platformId=#{platformId}" + |
| | | "</foreach>" + |
| | | "</script>") |
| | | void delByAppAndStreamsByPlatformId(List<GbStream> gbStreams, String platformId); |
| | | } |
| | |
| | | if (res.data.code === 0) { |
| | | this.platformName = res.data.data.name; |
| | | this.defaultCatalogId = res.data.data.catalogId; |
| | | this.defaultCatalogIdSign = res.data.data.catalogId; |
| | | this.chooseId = res.data.data.catalogId; |
| | | resolve([ |
| | | { |
| | | name: "未分配", |
| | | id: null, |
| | | type: -1 |
| | | },{ |
| | | { |
| | | name: this.platformName, |
| | | id: this.platformId, |
| | | type: 0 |