|
|
@@ -651,11 +651,18 @@ public class ArticlePromotionService {
|
|
|
|
|
|
@XxlJob("topContentReSendJob")
|
|
|
public ReturnT<String> topContentReSend(String param) {
|
|
|
- String dateStr = DateUtils.getBeforeDaysDateStr("yyyyMMdd", 60);
|
|
|
+ String dateStr = DateUtils.getBeforeDaysDateStr("yyyyMMdd", 20);
|
|
|
if (StringUtils.hasText(param)) {
|
|
|
dateStr = param;
|
|
|
}
|
|
|
- List<DatastatSortStrategy> topList = longArticleBaseMapper.getTopContent(dateStr);
|
|
|
+ // 获取TOP内容最近发布表现
|
|
|
+ String lastPublishDateStr = DateUtils.getBeforeDaysDateStr("yyyyMMdd", 100);
|
|
|
+ List<PublishedTopContentDTO> lastTopContent = longArticleBaseMapper.getPublishedTopContent(lastPublishDateStr);
|
|
|
+ Map<String, PublishedTopContentDTO> lastTopContentMap = lastTopContent.stream().collect(Collectors.toMap(
|
|
|
+ PublishedTopContentDTO::getTitle, Function.identity()));
|
|
|
+ // 获取晋级内容
|
|
|
+ List<DatastatSortStrategy> topList = longArticleBaseMapper.getTopContent(dateStr, lastPublishDateStr);
|
|
|
+ topList.removeIf(top -> lastTopContentMap.containsKey(top.getTitle()));
|
|
|
List<String> ghIds = topList.stream().map(DatastatSortStrategy::getGhId).distinct().collect(Collectors.toList());
|
|
|
List<PublishAccount> publishAccountList = publishAccountRepository.getAllByGhIdIn(ghIds);
|
|
|
Map<String, String> publishContentMap = publishAccountList.stream().collect(Collectors.toMap(
|
|
|
@@ -679,11 +686,6 @@ public class ArticlePromotionService {
|
|
|
log.error("topContentReSendJob detail is null");
|
|
|
return ReturnT.FAIL;
|
|
|
}
|
|
|
- // 获取TOP内容最近发布表现
|
|
|
- String lastPublishDateStr = DateUtils.getBeforeDaysDateStr("yyyyMMdd", 100);
|
|
|
- List<PublishedTopContentDTO> lastTopContent = longArticleBaseMapper.getPublishedTopContent(lastPublishDateStr);
|
|
|
- Map<String, PublishedTopContentDTO> lastTopContentMap = lastTopContent.stream().collect(Collectors.toMap(
|
|
|
- PublishedTopContentDTO::getTitle, Function.identity()));
|
|
|
for (PublishContentDTO item : publishContentList) {
|
|
|
if (TitleSimilarCheckUtil.isDuplicateContent(item.getTitle(), existsTitles, TitleSimilarCheckUtil.ARTICLE_PROMOTION_THRESHOLD)) {
|
|
|
continue;
|