Commit 78f628dd6fca9be675376a20a753b6f4556e9844
1 parent
7d6aaf3b
修复同步目录时批量提交的错误
Showing
1 changed file
with
2 additions
and
14 deletions
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
| @@ -169,7 +169,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { | @@ -169,7 +169,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { | ||
| 169 | } | 169 | } |
| 170 | } | 170 | } |
| 171 | } | 171 | } |
| 172 | - if (channels.size() > 0) { | 172 | + if (!channels.isEmpty()) { |
| 173 | for (DeviceChannel channel : channels) { | 173 | for (DeviceChannel channel : channels) { |
| 174 | if (subContMap.get(channel.getChannelId()) != null){ | 174 | if (subContMap.get(channel.getChannelId()) != null){ |
| 175 | Integer count = subContMap.get(channel.getChannelId()); | 175 | Integer count = subContMap.get(channel.getChannelId()); |
| @@ -190,19 +190,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { | @@ -190,19 +190,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { | ||
| 190 | } | 190 | } |
| 191 | try { | 191 | try { |
| 192 | int limitCount = 50; | 192 | int limitCount = 50; |
| 193 | - int cleanChannelsResult = 0; | ||
| 194 | - if (channels.size() > limitCount) { | ||
| 195 | - for (int i = 0; i < channels.size(); i += limitCount) { | ||
| 196 | - int toIndex = i + limitCount; | ||
| 197 | - if (i + limitCount > channels.size()) { | ||
| 198 | - toIndex = channels.size(); | ||
| 199 | - } | ||
| 200 | - cleanChannelsResult += this.deviceChannelMapper.cleanChannelsNotInList(deviceId, channels.subList(i, toIndex)); | ||
| 201 | - } | ||
| 202 | - } else { | ||
| 203 | - cleanChannelsResult = this.deviceChannelMapper.cleanChannelsNotInList(deviceId, channels); | ||
| 204 | - } | ||
| 205 | - boolean result = cleanChannelsResult < 0; | 193 | + boolean result = false; |
| 206 | if (!result && addChannels.size() > 0) { | 194 | if (!result && addChannels.size() > 0) { |
| 207 | if (addChannels.size() > limitCount) { | 195 | if (addChannels.size() > limitCount) { |
| 208 | for (int i = 0; i < addChannels.size(); i += limitCount) { | 196 | for (int i = 0; i < addChannels.size(); i += limitCount) { |