|
@@ -197,10 +197,10 @@ public class DataDashboardService {
|
|
|
.collect(Collectors.groupingBy(ArticleDetailInfo::getWxSn));
|
|
|
List<PublishSortLog> sortLogList = publishSortLogRepository.findByGhIdInAndDateStrBetween(ghIds, beginDate, endDate);
|
|
|
log.info("newSortStrategyData sortLogList finish");
|
|
|
- Map<String, Map<String, Map<String, String>>> sortStrategyMap = sortLogList.stream()
|
|
|
+ Map<String, Map<String, Map<String, PublishSortLog>>> sortStrategyMap = sortLogList.stream()
|
|
|
.collect(Collectors.groupingBy(PublishSortLog::getGhId,
|
|
|
Collectors.groupingBy(PublishSortLog::getDateStr, Collectors.toMap(PublishSortLog::getTitle,
|
|
|
- PublishSortLog::getStrategy, (existing, replacement) -> existing))));
|
|
|
+ Function.identity(), (existing, replacement) -> existing))));
|
|
|
Map<String, Map<String, Map<String, AccountAvgInfo>>> accountAvgInfoIndexMap = accountAvgInfoList.stream()
|
|
|
.filter(o -> Objects.nonNull(o.getReadAvg()) && o.getReadAvg() > 0 && o.getFans() > 1000)
|
|
|
.collect(Collectors.groupingBy(AccountAvgInfo::getGhId, Collectors.groupingBy(AccountAvgInfo::getUpdateTime,
|
|
@@ -338,7 +338,7 @@ public class DataDashboardService {
|
|
|
List<ArticleDetailInfo> articleDetailInfos = articleDetailInfoMap.get(article.getWxSn());
|
|
|
setObjArticleDetailInfo(article, obj, articleDetailInfos);
|
|
|
Article firstArticle = articleMap.get(article.getGhId()).get(article.getAppMsgId()).get(1);
|
|
|
- Map<String, Map<String, String>> dateStrategy = sortStrategyMap.get(article.getGhId());
|
|
|
+ Map<String, Map<String, PublishSortLog>> dateStrategy = sortStrategyMap.get(article.getGhId());
|
|
|
AccountAvgInfo avgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
|
|
|
article.getPublishTimestamp(), article.getItemIndex());
|
|
|
AccountAvgInfo firstAvgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
|
|
@@ -352,20 +352,23 @@ public class DataDashboardService {
|
|
|
obj.setFirstAvgViewCount(firstAvgInfo.getReadAvg());
|
|
|
}
|
|
|
if (Objects.nonNull(dateStrategy)) {
|
|
|
- Map<String, String> titleStrategyMap = dateStrategy.get(date);
|
|
|
+ Map<String, PublishSortLog> titleStrategyMap = dateStrategy.get(date);
|
|
|
if (Objects.nonNull(titleStrategyMap)) {
|
|
|
- String strategy = titleStrategyMap.get(article.getTitle());
|
|
|
- if (!StringUtils.hasText(strategy)) {
|
|
|
- if (Objects.equals(articleType, ArticleTypeEnum.WUXIANLIU.getVal())) {
|
|
|
- strategy = RankStrategyEnum.INFINITE_STRATEGY.getStrategy();
|
|
|
- } else {
|
|
|
- for (Map.Entry<String, String> entry : titleStrategyMap.entrySet()) {
|
|
|
- strategy = entry.getValue();
|
|
|
- break;
|
|
|
+ PublishSortLog sortLog = titleStrategyMap.get(article.getTitle());
|
|
|
+ if (Objects.nonNull(sortLog)) {
|
|
|
+ String strategy = sortLog.getStrategy();
|
|
|
+ if (!StringUtils.hasText(sortLog.getStrategy())) {
|
|
|
+ if (Objects.equals(articleType, ArticleTypeEnum.WUXIANLIU.getVal())) {
|
|
|
+ strategy = RankStrategyEnum.INFINITE_STRATEGY.getStrategy();
|
|
|
+ } else {
|
|
|
+ for (Map.Entry<String, PublishSortLog> entry : titleStrategyMap.entrySet()) {
|
|
|
+ strategy = entry.getValue().getStrategy();
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ obj.setStrategy(strategy);
|
|
|
}
|
|
|
- obj.setStrategy(strategy);
|
|
|
}
|
|
|
}
|
|
|
if (!StringUtils.hasText(obj.getStrategy()) &&
|
|
@@ -399,6 +402,17 @@ public class DataDashboardService {
|
|
|
item.setAccountCreateTimestamp(publishAccount.getCreateTimestamp() / 1000);
|
|
|
Article article = wxSnMap.get(item.getWxSn());
|
|
|
item.setPublishTimestamp(article.getPublishTimestamp());
|
|
|
+ Map<String, Map<String, PublishSortLog>> dateStrategy = sortStrategyMap.get(article.getGhId());
|
|
|
+ if (Objects.nonNull(dateStrategy)) {
|
|
|
+ Map<String, PublishSortLog> titleStrategyMap = dateStrategy.get(newSortStrategyExport.getDateStr());
|
|
|
+ if (Objects.nonNull(titleStrategyMap)) {
|
|
|
+ PublishSortLog sortLog = titleStrategyMap.get(article.getTitle());
|
|
|
+ if (Objects.nonNull(sortLog)) {
|
|
|
+ item.setSourceType(sortLog.getSourceType());
|
|
|
+ item.setSourceId(sortLog.getSourceId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
saveList.add(item);
|
|
|
}
|
|
|
for (List<DatastatSortStrategy> saveListPartition : Lists.partition(saveList, 1000)) {
|