朱俊杰
2022-02-10 37a84e66917d6e22e03e31b0a115e2c16d23ed21
src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java
@@ -20,6 +20,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
@@ -117,7 +118,7 @@
        try {
            List<DeviceChannel> deviceChannelList = new ArrayList<>();
            for (GbStream gbStream : gbStreams) {
                platformGbStreamMapper.delByAppAndStream(gbStream.getApp(), gbStream.getStream());
                platformGbStreamMapper.delByAppAndStreamAndPlatform(gbStream.getApp(), gbStream.getStream(), platformId);
                DeviceChannel deviceChannel = new DeviceChannel();
                deviceChannel.setChannelId(gbStream.getGbId());
                deviceChannelList.add(deviceChannel);
@@ -144,8 +145,16 @@
                gbStreams.add(streamProxyItem);
            }
        }
        sendCatalogMsgs(gbStreams, type);
    }
    @Override
    public void sendCatalogMsgs(List<GbStream> gbStreams, String type) {
        if (gbStreams.size() > 0) {
            for (GbStream gs : gbStreams) {
                if (StringUtils.isEmpty(gs.getGbId())){
                    continue;
                }
                List<ParentPlatform> parentPlatforms = platformGbStreamMapper.selectByAppAndStream(gs.getApp(), gs.getStream());
                if (parentPlatforms.size() > 0) {
                    for (ParentPlatform parentPlatform : parentPlatforms) {