|
@@ -389,18 +389,22 @@ public class RecallService implements ApplicationContextAware {
|
|
|
|
|
|
// 获取品类
|
|
|
List<String> channelContentIds = paramList.stream().map(TitleHisCacheParam::getCrawlerChannelContentId)
|
|
|
- .collect(Collectors.toList());
|
|
|
+ .filter(StringUtils::hasText).collect(Collectors.toList());
|
|
|
// 查询晋升rootProduceContentId
|
|
|
- List<ArticlePoolPromotionSource> sourceList = articlePoolPromotionSourceRepository
|
|
|
- .getByChannelContentIdInAndStatusAndDeleted(channelContentIds,
|
|
|
- ArticlePoolPromotionSourceStatusEnum.FINISH.getCode(), 0);
|
|
|
- Map<String, ArticlePoolPromotionSource> sourceMap = sourceList.stream()
|
|
|
- .collect(Collectors.toMap(ArticlePoolPromotionSource::getChannelContentId, Function.identity()));
|
|
|
- List<String> publishContentIds = sourceList.stream().
|
|
|
- map(ArticlePoolPromotionSource::getRootPublishContentId).collect(Collectors.toList());
|
|
|
- List<PublishContent> publishContentList = publishContentRepository.getByIdIn(publishContentIds);
|
|
|
- Map<String, PublishContent> publishContentMap = publishContentList.stream()
|
|
|
- .collect(Collectors.toMap(PublishContent::getId, Function.identity()));
|
|
|
+ Map<String, ArticlePoolPromotionSource> sourceMap = new HashMap<>();
|
|
|
+ Map<String, PublishContent> publishContentMap = new HashMap<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(channelContentIds)) {
|
|
|
+ List<ArticlePoolPromotionSource> sourceList = articlePoolPromotionSourceRepository
|
|
|
+ .getByChannelContentIdInAndStatusAndDeleted(channelContentIds,
|
|
|
+ ArticlePoolPromotionSourceStatusEnum.FINISH.getCode(), 0);
|
|
|
+ sourceMap = sourceList.stream()
|
|
|
+ .collect(Collectors.toMap(ArticlePoolPromotionSource::getChannelContentId, Function.identity()));
|
|
|
+ List<String> publishContentIds = sourceList.stream().
|
|
|
+ map(ArticlePoolPromotionSource::getRootPublishContentId).collect(Collectors.toList());
|
|
|
+ List<PublishContent> publishContentList = publishContentRepository.getByIdIn(publishContentIds);
|
|
|
+ publishContentMap = publishContentList.stream()
|
|
|
+ .collect(Collectors.toMap(PublishContent::getId, Function.identity()));
|
|
|
+ }
|
|
|
// 根据produceContentId查询category
|
|
|
List<ArticleCategory> articleCategoryList = articleCategoryRepository.getByStatus(ArticleCategoryStatusEnum.SUCCESS.getCode());
|
|
|
Map<String, ArticleCategory> categoryMap = articleCategoryList.stream()
|