|
@@ -150,7 +150,7 @@ public class DataDashboardService {
|
|
|
log.info("newSortStrategyData accountAvgInfoList finish");
|
|
|
List<String> ghIds = accountAvgInfoList.stream().map(AccountAvgInfo::getGhId).distinct().collect(Collectors.toList());
|
|
|
|
|
|
- List<Article> articleList = articleRepository.getByGhIdInAndUpdateTimeBetweenAndTypeEquals(ghIds,
|
|
|
+ List<Article> articleList = articleRepository.getByGhIdInAndPublishTimestampBetweenAndTypeEquals(ghIds,
|
|
|
beginTimestamp, endTimestamp, ArticleTypeEnum.QUNFA.getVal());
|
|
|
Map<String, Map<String, Map<Integer, Article>>> articleMap = articleList.stream().collect(Collectors.groupingBy(Article::getGhId,
|
|
|
Collectors.groupingBy(Article::getAppMsgId, Collectors.toMap(Article::getItemIndex, o -> o))));
|
|
@@ -307,10 +307,10 @@ public class DataDashboardService {
|
|
|
Article firstArticle = articleMap.get(article.getGhId()).get(article.getAppMsgId()).get(1);
|
|
|
Map<String, String> dateStrategy = sortStrategyMap.get(article.getGhId());
|
|
|
AccountAvgInfo avgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
|
|
|
- article.getUpdateTime(), article.getItemIndex());
|
|
|
+ article.getPublishTimestamp(), article.getItemIndex());
|
|
|
AccountAvgInfo firstAvgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
|
|
|
- article.getUpdateTime(), 1);
|
|
|
- String date = DateUtils.timestampToYMDStr(article.getUpdateTime(), "yyyyMMdd");
|
|
|
+ article.getPublishTimestamp(), 1);
|
|
|
+ String date = DateUtils.timestampToYMDStr(article.getPublishTimestamp(), "yyyyMMdd");
|
|
|
setObjBaseInfo(article, obj, date);
|
|
|
if (Objects.nonNull(firstArticle)) {
|
|
|
obj.setFirstViewCount(firstArticle.getShowViewCount());
|
|
@@ -438,9 +438,9 @@ public class DataDashboardService {
|
|
|
Map<String, Map<String, Map<String, AccountAvgInfo>>> accountAvgInfoIndexMap,
|
|
|
Map<String, List<ArticleDetailInfo>> hisArticleDetailInfoMap) {
|
|
|
List<Article> hisArticles = hisArticleMap.getOrDefault(article.getTitle(), new ArrayList<>());
|
|
|
- hisArticles = hisArticles.stream().filter(o -> o.getUpdateTime() < (article.getUpdateTime() - 3600 * 8)
|
|
|
+ hisArticles = hisArticles.stream().filter(o -> o.getPublishTimestamp() < (article.getPublishTimestamp() - 3600 * 8)
|
|
|
&& (1 == o.getItemIndex() || 2 == o.getItemIndex())
|
|
|
- && !ScoreStrategy.hisContentLateFilter(o.getUpdateTime())).collect(Collectors.toList());
|
|
|
+ && !ScoreStrategy.hisContentLateFilter(o.getPublishTimestamp())).collect(Collectors.toList());
|
|
|
Integer readCount = 0;
|
|
|
Double readAvgCount = 0.0;
|
|
|
int firstCount = 0;
|
|
@@ -448,7 +448,7 @@ public class DataDashboardService {
|
|
|
for (Article hisArticle : hisArticles) {
|
|
|
readCount += hisArticle.getShowViewCount();
|
|
|
AccountAvgInfo accountAvgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, hisArticle.getGhId(),
|
|
|
- hisArticle.getUpdateTime(), hisArticle.getItemIndex());
|
|
|
+ hisArticle.getPublishTimestamp(), hisArticle.getItemIndex());
|
|
|
if (Objects.nonNull(accountAvgInfo)) {
|
|
|
readAvgCount += accountAvgInfo.getReadAvg();
|
|
|
}
|
|
@@ -486,13 +486,13 @@ public class DataDashboardService {
|
|
|
obj.setPosition(article.getItemIndex());
|
|
|
obj.setViewCount(article.getShowViewCount());
|
|
|
obj.setDateStr(date);
|
|
|
- obj.setPublishTime(DateUtils.timestampToYMDStr(article.getUpdateTime(), "HH:mm:ss"));
|
|
|
+ obj.setPublishTime(DateUtils.timestampToYMDStr(article.getPublishTimestamp(), "HH:mm:ss"));
|
|
|
obj.setWxSn(article.getWxSn());
|
|
|
}
|
|
|
|
|
|
private void setObjArticleDetailInfo(Article article, NewSortStrategyExport obj, List<ArticleDetailInfo> articleDetailInfos) {
|
|
|
if (CollectionUtils.isNotEmpty(articleDetailInfos)) {
|
|
|
- Date publishDate = DateUtils.getStartDateOfDay(article.getUpdateTime());
|
|
|
+ Date publishDate = DateUtils.getStartDateOfDay(article.getPublishTimestamp());
|
|
|
articleDetailInfos = articleDetailInfos.stream().filter(o -> !o.getRecallDt().before(publishDate))
|
|
|
.collect(Collectors.toList());
|
|
|
Date minDate = articleDetailInfos.stream().map(ArticleDetailInfo::getRecallDt).min(Date::compareTo).orElse(new Date());
|
|
@@ -835,9 +835,9 @@ public class DataDashboardService {
|
|
|
.collect(Collectors.groupingBy(AccountAvgInfo::getGhId, Collectors.groupingBy(AccountAvgInfo::getUpdateTime,
|
|
|
Collectors.toMap(AccountAvgInfo::getPosition, o -> o))));
|
|
|
List<String> ghIds = accountAvgInfoList.stream().map(AccountAvgInfo::getGhId).distinct().collect(Collectors.toList());
|
|
|
- List<Article> articleList = articleRepository.getByGhIdInAndUpdateTimeLessThanAndTypeEquals(ghIds, dateEnd, ArticleTypeEnum.QUNFA.getVal());
|
|
|
+ List<Article> articleList = articleRepository.getByGhIdInAndPublishTimestampLessThanAndTypeEquals(ghIds, dateEnd, ArticleTypeEnum.QUNFA.getVal());
|
|
|
Map<String, Article> articleMap = articleList.stream().collect(Collectors.toMap(Article::getWxSn, o -> o));
|
|
|
- List<Article> todayPublish = articleList.stream().filter(o -> o.getUpdateTime() > dateStart).collect(Collectors.toList());
|
|
|
+ List<Article> todayPublish = articleList.stream().filter(o -> o.getPublishTimestamp() > dateStart).collect(Collectors.toList());
|
|
|
if (CollectionUtils.isEmpty(todayPublish)) {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
@@ -859,7 +859,7 @@ public class DataDashboardService {
|
|
|
List<NewSortStrategyExport> newSortStrategyExportList = getNewSortStrategyExportList(todayPublish,
|
|
|
articleDetailInfoMap, accountAvgInfoIndexMap);
|
|
|
|
|
|
- List<Article> futurePublishList = articleRepository.getByUpdateTimeGreaterThanAndTypeEquals(dateEnd, ArticleTypeEnum.QUNFA.getVal());
|
|
|
+ List<Article> futurePublishList = articleRepository.getByPublishTimestampGreaterThanAndTypeEquals(dateEnd, ArticleTypeEnum.QUNFA.getVal());
|
|
|
Map<String, List<Article>> futurePublishMap = futurePublishList.stream().collect(Collectors.groupingBy(Article::getTitle));
|
|
|
|
|
|
Map<String, List<String>> titleTypeMap = new HashMap<>();
|
|
@@ -875,7 +875,7 @@ public class DataDashboardService {
|
|
|
}
|
|
|
IntermediateIndicatorsExport item = resultMap.get(type);
|
|
|
List<Article> list = hisPublishMap.get(data.getTitle());
|
|
|
- list = list.stream().filter(publish -> publish.getUpdateTime() < (article.getUpdateTime() - 3600 * 8))
|
|
|
+ list = list.stream().filter(publish -> publish.getPublishTimestamp() < (article.getPublishTimestamp() - 3600 * 8))
|
|
|
.collect(Collectors.toList());
|
|
|
Integer poolLevel = getArticlePoolLevel(data.getGhId(), list, small);
|
|
|
// L1层仅统计历史发布在3-8位置文章
|
|
@@ -887,7 +887,7 @@ public class DataDashboardService {
|
|
|
List<String> poolTitles = titlePoolMap.computeIfAbsent(poolLevel, k -> new ArrayList<>());
|
|
|
|
|
|
AccountAvgInfo accountAvgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
|
|
|
- article.getUpdateTime(), article.getItemIndex());
|
|
|
+ article.getPublishTimestamp(), article.getItemIndex());
|
|
|
// // L4层仅统计 稳定-大和稳定
|
|
|
// if ("L4".equals(item.getType()) && (Objects.isNull(accountAvgInfo)
|
|
|
// || !StringUtils.hasText(accountAvgInfo.getAccountStatus())
|
|
@@ -1065,8 +1065,8 @@ public class DataDashboardService {
|
|
|
List<ArticleDetailInfo> articleDetailInfos = articleDetailInfoMap.get(article.getWxSn());
|
|
|
setObjArticleDetailInfo(article, obj, articleDetailInfos);
|
|
|
AccountAvgInfo avgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
|
|
|
- article.getUpdateTime(), article.getItemIndex());
|
|
|
- String date = DateUtils.timestampToYMDStr(article.getUpdateTime(), "yyyyMMdd");
|
|
|
+ article.getPublishTimestamp(), article.getItemIndex());
|
|
|
+ String date = DateUtils.timestampToYMDStr(article.getPublishTimestamp(), "yyyyMMdd");
|
|
|
setObjBaseInfo(article, obj, date);
|
|
|
setObjAvgInfo(article, obj, avgInfo);
|
|
|
result.add(obj);
|
|
@@ -1085,13 +1085,13 @@ public class DataDashboardService {
|
|
|
Integer poolLevel,
|
|
|
List<String> small,
|
|
|
Map<String, List<Article>> hisPublishMap) {
|
|
|
- Long hisMinDate = hisPublish.stream().mapToLong(Article::getUpdateTime).min().orElse(0);
|
|
|
+ Long hisMinDate = hisPublish.stream().mapToLong(Article::getPublishTimestamp).min().orElse(0);
|
|
|
int scorePublishTime = scoreHisPublishTimeMap.computeIfAbsent(type, k -> 0);
|
|
|
Set<String> wxsnHisDistinctSet = wxsnHisDistinctSetMap.computeIfAbsent(type, k -> new HashSet<>());
|
|
|
for (Article publish : hisPublish) {
|
|
|
if (poolLevel == 1) {
|
|
|
List<Article> list = hisPublishMap.get(publish.getTitle());
|
|
|
- list = list.stream().filter(o -> o.getUpdateTime() < (publish.getUpdateTime() - 3600 * 8))
|
|
|
+ list = list.stream().filter(o -> o.getPublishTimestamp() < (publish.getPublishTimestamp() - 3600 * 8))
|
|
|
.collect(Collectors.toList());
|
|
|
Integer hisPublishPoolLevel = getArticlePoolLevel(publish.getGhId(), list, small);
|
|
|
if (hisPublishPoolLevel > poolLevel) {
|
|
@@ -1099,7 +1099,7 @@ public class DataDashboardService {
|
|
|
}
|
|
|
}
|
|
|
AccountAvgInfo avgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, publish.getGhId(),
|
|
|
- publish.getUpdateTime(), publish.getItemIndex());
|
|
|
+ publish.getPublishTimestamp(), publish.getItemIndex());
|
|
|
if (wxsnHisDistinctSet.contains(publish.getWxSn())) {
|
|
|
continue;
|
|
|
}
|
|
@@ -1151,7 +1151,7 @@ public class DataDashboardService {
|
|
|
item.setAverageFirstLayerFissionToViewBaseRatio(averageFirstLayerFissionToViewBaseRatio);
|
|
|
Map<String, Map<Integer, PublishSortLog>> dateSortMap = publishSortLogMap.get(publish.getGhId());
|
|
|
if (Objects.nonNull(dateSortMap)) {
|
|
|
- String publishDateStr = DateUtils.timestampToYMDStr(publish.getUpdateTime(), "yyyyMMdd");
|
|
|
+ String publishDateStr = DateUtils.timestampToYMDStr(publish.getPublishTimestamp(), "yyyyMMdd");
|
|
|
Map<Integer, PublishSortLog> indexMap = dateSortMap.get(publishDateStr);
|
|
|
if (Objects.nonNull(indexMap)) {
|
|
|
PublishSortLog log = indexMap.get(publish.getItemIndex());
|
|
@@ -1169,7 +1169,7 @@ public class DataDashboardService {
|
|
|
}
|
|
|
}
|
|
|
double firstExplorationIntervalAvg = Double.isNaN(item.getFirstExplorationIntervalAvg()) ? 0.0 : item.getFirstExplorationIntervalAvg();
|
|
|
- double explorationInterval = (publish.getUpdateTime() - hisMinDate) / 86400.0;
|
|
|
+ double explorationInterval = (publish.getPublishTimestamp() - hisMinDate) / 86400.0;
|
|
|
firstExplorationIntervalAvg = (firstExplorationIntervalAvg * (item.getTotalArticleReleaseCountNonInfinite() - 1)
|
|
|
+ explorationInterval) / item.getTotalArticleReleaseCountNonInfinite();
|
|
|
item.setFirstExplorationIntervalAvg(firstExplorationIntervalAvg);
|
|
@@ -1386,10 +1386,10 @@ public class DataDashboardService {
|
|
|
sortLogList.sort(Comparator.comparing(PublishSortLog::getGhId).thenComparing(PublishSortLog::getDateStr));
|
|
|
List<String> ghIds = sortLogList.stream().map(PublishSortLog::getGhId).distinct().collect(Collectors.toList());
|
|
|
long minTimestamp = DateUtils.dateStrToTimestamp(dateStrList.get(0), "yyyyMMdd");
|
|
|
- List<Article> articleList = articleRepository.getByGhIdInAndUpdateTimeGreaterThanAndTypeEquals(ghIds, minTimestamp, ArticleTypeEnum.QUNFA.getVal());
|
|
|
+ List<Article> articleList = articleRepository.getByGhIdInAndPublishTimestampGreaterThanAndTypeEquals(ghIds, minTimestamp, ArticleTypeEnum.QUNFA.getVal());
|
|
|
articleList = articleList.stream().filter(o -> o.getItemIndex() == 1 || o.getItemIndex() == 2).collect(Collectors.toList());
|
|
|
Map<String, Map<String, Map<Integer, Article>>> articleMap = articleList.stream().collect(
|
|
|
- Collectors.groupingBy(Article::getGhId, Collectors.groupingBy(o -> DateUtils.timestampToYMDStr(o.getUpdateTime(), "yyyyMMdd"),
|
|
|
+ Collectors.groupingBy(Article::getGhId, Collectors.groupingBy(o -> DateUtils.timestampToYMDStr(o.getPublishTimestamp(), "yyyyMMdd"),
|
|
|
Collectors.toMap(Article::getItemIndex, o -> o,
|
|
|
(existing, replacement) -> replacement))));
|
|
|
List<String> titleList = articleList.stream().map(Article::getTitle).distinct().collect(Collectors.toList());
|
|
@@ -1449,7 +1449,7 @@ public class DataDashboardService {
|
|
|
if (Objects.nonNull(map)) {
|
|
|
List<String> avgMapDateList = new ArrayList<>(map.keySet());
|
|
|
String publishDate = DateUtils.findNearestDate(avgMapDateList,
|
|
|
- DateUtils.timestampToYMDStr(article.getUpdateTime(), "yyyy-MM-dd"), "yyyy-MM-dd");
|
|
|
+ DateUtils.timestampToYMDStr(article.getPublishTimestamp(), "yyyy-MM-dd"), "yyyy-MM-dd");
|
|
|
Map<String, AccountAvgInfo> avgIndexMap = map.get(publishDate);
|
|
|
if (Objects.nonNull(avgIndexMap)) {
|
|
|
AccountAvgInfo accountAvgInfo = avgIndexMap.get(String.valueOf(publishSortLog.getIndex()));
|
|
@@ -1463,7 +1463,7 @@ public class DataDashboardService {
|
|
|
if (CollectionUtils.isNotEmpty(hisPublish)) {
|
|
|
long hisMinDate = hisPublish.stream().filter(o -> Objects.nonNull(o.getPublishTimestamp()))
|
|
|
.mapToLong(PublishContent::getPublishTimestamp).min().orElse(0);
|
|
|
- int explorationInterval = (int) ((article.getUpdateTime() - (hisMinDate / 1000)) / 86400);
|
|
|
+ int explorationInterval = (int) ((article.getPublishTimestamp() - (hisMinDate / 1000)) / 86400);
|
|
|
item.setFirstExplorationIntervalAvg(explorationInterval);
|
|
|
}
|
|
|
result.add(item);
|