|
@@ -31,6 +31,7 @@ import com.tzld.longarticle.recommend.server.repository.crawler.PublishSortLogRe
|
|
|
import com.tzld.longarticle.recommend.server.service.recommend.score.ScoreStrategy;
|
|
|
import com.tzld.longarticle.recommend.server.util.DateUtils;
|
|
|
import com.tzld.longarticle.recommend.server.util.MapBuilder;
|
|
|
+import com.tzld.longarticle.recommend.server.util.Md5Util;
|
|
|
import com.tzld.longarticle.recommend.server.util.feishu.FeiShu;
|
|
|
import com.xxl.job.core.biz.model.ReturnT;
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
@@ -1379,6 +1380,10 @@ public class DataDashboardService {
|
|
|
Collectors.groupingBy(Article::getGhId, Collectors.toMap(
|
|
|
o -> DateUtils.timestampToYMDStr(o.getUpdateTime(), "yyyyMMdd"), o -> o,
|
|
|
(existing, replacement) -> replacement)));
|
|
|
+ List<String> titleList = articleList.stream().map(Article::getTitle).distinct().collect(Collectors.toList());
|
|
|
+ List<String> titleMd5s = titleList.stream().map(Md5Util::encoderByMd5).collect(Collectors.toList());
|
|
|
+ List<Article> hisPublishList = articleRepository.getByTitleMd5InAndTypeEqualsAndStatusEquals(titleMd5s, ArticleTypeEnum.QUNFA.getVal(), 1);
|
|
|
+ Map<String, List<Article>> hisPublishMap = hisPublishList.stream().collect(Collectors.groupingBy(Article::getTitle));
|
|
|
String ymd = DateUtils.timestampToYMDStr(minTimestamp - 86400 * 7, "yyyy-MM-dd");
|
|
|
List<AccountAvgInfo> accountAvgInfoList = accountAvgInfoRepository.getAllByUpdateTimeGreaterThanEqual(ymd);
|
|
|
Map<String, Map<String, AccountAvgInfo>> accountAvgInfoMap = accountAvgInfoList.stream()
|
|
@@ -1430,6 +1435,10 @@ public class DataDashboardService {
|
|
|
item.setReadAvgRate(article.getShowViewCount() / (double) accountAvgInfo.getReadAvg());
|
|
|
}
|
|
|
}
|
|
|
+ List<Article> hisPublish = hisPublishMap.get(article.getTitle());
|
|
|
+ Long hisMinDate = hisPublish.stream().mapToLong(Article::getUpdateTime).min().orElse(0);
|
|
|
+ int explorationInterval = (int) ((article.getUpdateTime() - hisMinDate) / 86400);
|
|
|
+ item.setFirstExplorationIntervalAvg(explorationInterval);
|
|
|
result.add(item);
|
|
|
}
|
|
|
result.sort(Comparator.comparing(FirstContentScoreExport::getDateStr).reversed()
|