|
|
@@ -67,9 +67,14 @@ public class ContentPlatformVideoJob {
|
|
|
Long now = System.currentTimeMillis();
|
|
|
if (CollectionUtils.isNotEmpty(dataList)) {
|
|
|
List<ContentPlatformVideo> saveList = new ArrayList<>();
|
|
|
+ List<Long> existVideoIds = new ArrayList<>();
|
|
|
for (Record record : dataList) {
|
|
|
ContentPlatformVideo item = new ContentPlatformVideo();
|
|
|
Long videoId = Long.parseLong((String) record.get(0));
|
|
|
+ if (existVideoIds.contains(videoId)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ existVideoIds.add(videoId);
|
|
|
String category = (String) record.get(1);
|
|
|
String title = (String) record.get(2);
|
|
|
String videoUrl = (String) record.get(3);
|
|
|
@@ -107,10 +112,10 @@ public class ContentPlatformVideoJob {
|
|
|
saveList = saveList.stream().filter(item -> !illegalVideoIds.contains(item.getVideoId())).collect(Collectors.toList());
|
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(videoList)) {
|
|
|
- List<Long> existVideoIds = videoList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
|
|
|
+ List<Long> tempExistVideoIds = videoList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
|
|
|
List<Long> videoIdList = saveList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
|
|
|
planMapperExt.updateOtherVideoStatus(dt, videoIdList, now);
|
|
|
- saveList = saveList.stream().filter(item -> !existVideoIds.contains(item.getVideoId())).collect(Collectors.toList());
|
|
|
+ saveList = saveList.stream().filter(item -> !tempExistVideoIds.contains(item.getVideoId())).collect(Collectors.toList());
|
|
|
if (CollectionUtils.isNotEmpty(saveList)) {
|
|
|
planMapperExt.batchInsertContentPlatformVideo(saveList);
|
|
|
}
|