|
@@ -204,19 +204,22 @@ public class RecallService implements ApplicationContextAware {
|
|
|
if (CollectionUtils.isEmpty(content)) {
|
|
|
return;
|
|
|
}
|
|
|
+ List<String> sourceIds = content.stream().map(Content::getSourceId).collect(Collectors.toList());
|
|
|
+ Map<String, Integer> textStatusMap = new HashMap<>(textCache.getAllPresent(sourceIds));
|
|
|
List<String> searchIds = content.stream()
|
|
|
- .filter(o ->!Objects.equals(o.getSourceType(), PublishPlanInputSourceTypesEnum.longArticleVideoPoolSource.getVal()))
|
|
|
- .map(Content::getSourceId).filter(o -> Objects.isNull(textCache.getIfPresent(o)))
|
|
|
+ .filter(o -> !Objects.equals(o.getSourceType(), PublishPlanInputSourceTypesEnum.longArticleVideoPoolSource.getVal()))
|
|
|
+ .map(Content::getSourceId).filter(o -> Objects.isNull(textStatusMap.get(o)))
|
|
|
.collect(Collectors.toList());
|
|
|
if (CollectionUtils.isNotEmpty(searchIds)) {
|
|
|
List<LongArticlesText> textList = longArticlesTextRepository.getByContentIdIn(searchIds);
|
|
|
Map<String, Integer> textMap = textList.stream()
|
|
|
.collect(Collectors.toMap(LongArticlesText::getContentId, LongArticlesText::getSimilarityStatus));
|
|
|
+ textStatusMap.putAll(textMap);
|
|
|
textCache.putAll(textMap);
|
|
|
}
|
|
|
content.removeIf(o -> !Objects.equals(o.getSourceType(), PublishPlanInputSourceTypesEnum.longArticleVideoPoolSource.getVal())
|
|
|
- && (Objects.isNull(textCache.getIfPresent(o.getSourceId()))
|
|
|
- || textCache.getIfPresent(o.getSourceId()) == 0));
|
|
|
+ && (Objects.isNull(textStatusMap.get(o.getSourceId()))
|
|
|
+ || textStatusMap.get(o.getSourceId()) == 0));
|
|
|
}
|
|
|
|
|
|
private void setVideoContent(List<Content> contentList) {
|