|
@@ -31,7 +31,6 @@ 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;
|
|
@@ -1381,9 +1380,11 @@ public class DataDashboardService {
|
|
|
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));
|
|
|
+ List<PublishContent> hisPublishList = new ArrayList<>();
|
|
|
+ for (List<String> partitions : Lists.partition(new ArrayList<>(titleList), 100)) {
|
|
|
+ hisPublishList.addAll(aigcBaseMapper.getHisPublishByTitles(partitions));
|
|
|
+ }
|
|
|
+ Map<String, List<PublishContent>> hisPublishMap = hisPublishList.stream().collect(Collectors.groupingBy(PublishContent::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()
|
|
@@ -1435,9 +1436,9 @@ 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);
|
|
|
+ List<PublishContent> hisPublish = hisPublishMap.get(article.getTitle());
|
|
|
+ long hisMinDate = hisPublish.stream().mapToLong(PublishContent::getPublishTimestamp).min().orElse(0);
|
|
|
+ int explorationInterval = (int) ((article.getUpdateTime() - (hisMinDate / 1000)) / 86400);
|
|
|
item.setFirstExplorationIntervalAvg(explorationInterval);
|
|
|
result.add(item);
|
|
|
}
|