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 58279850..b1158bc9 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 @@ -118,14 +118,14 @@ public class GbStreamServiceImpl implements IGbStreamService { TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); try { List 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) { diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java index 1e153608..85310ed9 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformGbStreamMapper.java @@ -95,6 +95,11 @@ public interface PlatformGbStreamMapper { "") void delByGbStreams(List gbStreams); - - + @Delete("") + void delByAppAndStreamsByPlatformId(List gbStreams, String platformId); } diff --git a/web_src/src/components/dialog/getCatalog.vue b/web_src/src/components/dialog/getCatalog.vue index a146889a..62bacdb8 100644 --- a/web_src/src/components/dialog/getCatalog.vue +++ b/web_src/src/components/dialog/getCatalog.vue @@ -119,12 +119,10 @@ export default { 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