| | |
| | | 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) { |
| | |
| | | deviceChannel.setStatus(1); |
| | | deviceChannel.setParentId(catalogId ==null?gbStream.getCatalogId():catalogId); |
| | | deviceChannel.setRegisterWay(1); |
| | | if (catalogId.length() <= 10) { // 父节点是行政区划,则设置CivilCode使用此行政区划 |
| | | if (catalogId.length() > 0 && catalogId.length() <= 10) { |
| | | // 父节点是行政区划,则设置CivilCode使用此行政区划 |
| | | deviceChannel.setCivilCode(catalogId); |
| | | }else { |
| | | deviceChannel.setCivilCode(platform.getAdministrativeDivision()); |
| | |
| | | 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); |