|
@@ -216,7 +216,7 @@ public class RecallService implements ApplicationContextAware {
|
|
|
}
|
|
|
long t3 = System.currentTimeMillis();
|
|
|
// 标题历史均值
|
|
|
- setTitleAvgViewCount(content, param.getGhId(), param.getType());
|
|
|
+ setTitleAvgViewCount(content, param.getGhId(), param.getType(), param.getStrategy());
|
|
|
long t4 = System.currentTimeMillis();
|
|
|
CostMonitor.logCost("Recall", "SetAvgViewCount", t4 - t3);
|
|
|
// 视频内容池查询抓取时间
|
|
@@ -230,12 +230,14 @@ public class RecallService implements ApplicationContextAware {
|
|
|
}
|
|
|
// 长文内容池审核过滤
|
|
|
List<String> sourceIds = content.stream()
|
|
|
- .filter(o -> !Objects.equals(o.getSourceType(), PublishPlanInputSourceTypesEnum.longArticleVideoPoolSource.getVal()))
|
|
|
+ .filter(o -> (Objects.equals(o.getSourceType(), PublishPlanInputSourceTypesEnum.producePlan.getVal())
|
|
|
+ || Objects.equals(o.getSourceType(), PublishPlanInputSourceTypesEnum.produceContent.getVal())))
|
|
|
.map(Content::getSourceId).collect(Collectors.toList());
|
|
|
List<LongArticleTitleAudit> titleAuditList = titleAuditRepository.getByContentIdIn(sourceIds);
|
|
|
Map<String, Integer> titleAuditMap = titleAuditList.stream()
|
|
|
.collect(Collectors.toMap(LongArticleTitleAudit::getContentId, LongArticleTitleAudit::getStatus));
|
|
|
- content.removeIf(o -> !Objects.equals(o.getSourceType(), PublishPlanInputSourceTypesEnum.longArticleVideoPoolSource.getVal())
|
|
|
+ content.removeIf(o -> (Objects.equals(o.getSourceType(), PublishPlanInputSourceTypesEnum.producePlan.getVal())
|
|
|
+ || Objects.equals(o.getSourceType(), PublishPlanInputSourceTypesEnum.produceContent.getVal()))
|
|
|
&& (Objects.isNull(titleAuditMap.get(o.getSourceId()))
|
|
|
|| titleAuditMap.get(o.getSourceId()) != ArticleVideoAuditStatusEnum.PASS.getCode()));
|
|
|
if (CollectionUtils.isEmpty(content)) {
|
|
@@ -331,7 +333,7 @@ public class RecallService implements ApplicationContextAware {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void setTitleAvgViewCount(List<Content> contentList, String ghId, String type) {
|
|
|
+ public void setTitleAvgViewCount(List<Content> contentList, String ghId, String type, String strategy) {
|
|
|
long start = System.currentTimeMillis();
|
|
|
contentList.forEach(content -> content.setTitleMd5(Md5Util.encoderByMd5(content.getTitle())));
|
|
|
List<String> sourceIdList = contentList.stream().map(Content::getSourceId).distinct().collect(Collectors.toList());
|
|
@@ -369,11 +371,18 @@ public class RecallService implements ApplicationContextAware {
|
|
|
content.setHisPublishArticleList(hisPublishArticleList);
|
|
|
setT0Data(content, ghId);
|
|
|
} else {
|
|
|
- if (!newCacheSourceIdSet.contains(content.getSourceId())) {
|
|
|
+ if (!newCacheSourceIdSet.contains(content.getSourceId())
|
|
|
+ && Arrays.asList(PublishPlanInputSourceTypesEnum.producePlan.getVal(),
|
|
|
+ PublishPlanInputSourceTypesEnum.produceContent.getVal(),
|
|
|
+ PublishPlanInputSourceTypesEnum.longArticleVideoPoolSource.getVal()
|
|
|
+ ).contains(content.getSourceType())) {
|
|
|
newCacheSaveList.add(content);
|
|
|
newCacheSourceIdSet.add(content.getSourceId());
|
|
|
}
|
|
|
}
|
|
|
+ if (Objects.isNull(content.getContentPoolType()) && RankStrategyEnum.FWH_STRATEGY.getStrategy().equals(strategy)) {
|
|
|
+ content.setContentPoolType(ContentPoolEnum.autoArticlePoolLevel1.getContentPool());
|
|
|
+ }
|
|
|
}
|
|
|
// 写入缓存
|
|
|
saveArticleTitleHisCache(newCacheSaveList, type);
|