| | |
| | | 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; |
| | |
| | | private EventPublisher eventPublisher; |
| | | |
| | | @Override |
| | | public PageInfo<GbStream> getAll(Integer page, Integer count) { |
| | | public PageInfo<GbStream> getAll(Integer page, Integer count, String platFormId) { |
| | | PageHelper.startPage(page, count); |
| | | List<GbStream> all = gbStreamMapper.selectAll(); |
| | | List<GbStream> all = gbStreamMapper.selectAll(platFormId); |
| | | return new PageInfo<>(all); |
| | | } |
| | | |
| | |
| | | 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); |
| | |
| | | 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) { |