From fc89b7b517e191fb6c9b66fa86dd05ebab0f54c5 Mon Sep 17 00:00:00 2001 From: jiang <893224616@qq.com> Date: 星期三, 13 七月 2022 11:29:46 +0800 Subject: [PATCH] 测试提交权限 --- src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) 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 b65f826..4a965a0 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 @@ -70,7 +70,9 @@ boolean result = false; TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); ParentPlatform parentPlatform = platformMapper.getParentPlatByServerGBId(platformId); - if (catalogId == null) catalogId = parentPlatform.getCatalogId(); + if (catalogId == null) { + catalogId = parentPlatform.getCatalogId(); + } try { List<DeviceChannel> deviceChannelList = new ArrayList<>(); for (GbStream gbStream : gbStreams) { @@ -104,7 +106,8 @@ deviceChannel.setStatus(1); deviceChannel.setParentId(catalogId ==null?gbStream.getCatalogId():catalogId); deviceChannel.setRegisterWay(1); - if (catalogId.length() <= 10) { // 鐖惰妭鐐规槸琛屾斂鍖哄垝,鍒欒缃瓹ivilCode浣跨敤姝よ鏀垮尯鍒� + if (catalogId.length() > 0 && catalogId.length() <= 10) { + // 鐖惰妭鐐规槸琛屾斂鍖哄垝,鍒欒缃瓹ivilCode浣跨敤姝よ鏀垮尯鍒� deviceChannel.setCivilCode(catalogId); }else { deviceChannel.setCivilCode(platform.getAdministrativeDivision()); @@ -146,9 +149,9 @@ if (gbStream.getGbId() != null) { gbStreams.add(gbStream); }else { - StreamProxyItem streamProxyItem = gbStreamMapper.selectOne(gbStream.getApp(), gbStream.getStream()); - if (streamProxyItem != null && streamProxyItem.getGbId() != null){ - gbStreams.add(streamProxyItem); + GbStream gbStreamIndb = gbStreamMapper.selectOne(gbStream.getApp(), gbStream.getStream()); + if (gbStreamIndb != null && gbStreamIndb.getGbId() != null){ + gbStreams.add(gbStreamIndb); } } sendCatalogMsgs(gbStreams, type); -- Gitblit v1.8.0