| | |
| | | import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.sun.org.apache.xml.internal.resolver.Catalog; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private PlatformGbStreamMapper platformGbStreamMapper; |
| | | |
| | | @Autowired |
| | | private IGbStreamService gbStreamService; |
| | | |
| | | @Autowired |
| | | private ParentPlatformMapper parentPlatformMapper; |
| | | |
| | | /** |
| | | * 根据设备ID判断设备是否存在 |
| | | * |
| | |
| | | } |
| | | } |
| | | } |
| | | if (channels.size() > 0) { |
| | | if (!channels.isEmpty()) { |
| | | for (DeviceChannel channel : channels) { |
| | | if (subContMap.get(channel.getChannelId()) != null){ |
| | | Integer count = subContMap.get(channel.getChannelId()); |
| | |
| | | } |
| | | try { |
| | | int limitCount = 50; |
| | | int cleanChannelsResult = 0; |
| | | if (channels.size() > limitCount) { |
| | | for (int i = 0; i < channels.size(); i += limitCount) { |
| | | int toIndex = i + limitCount; |
| | | if (i + limitCount > channels.size()) { |
| | | toIndex = channels.size(); |
| | | } |
| | | cleanChannelsResult += this.deviceChannelMapper.cleanChannelsNotInList(deviceId, channels.subList(i, toIndex)); |
| | | } |
| | | } else { |
| | | cleanChannelsResult = this.deviceChannelMapper.cleanChannelsNotInList(deviceId, channels); |
| | | } |
| | | boolean result = cleanChannelsResult < 0; |
| | | boolean result = false; |
| | | if (!result && addChannels.size() > 0) { |
| | | if (addChannels.size() > limitCount) { |
| | | for (int i = 0; i < addChannels.size(); i += limitCount) { |