|
@@ -146,7 +146,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))));
|
|
@@ -302,10 +302,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());
|
|
@@ -433,9 +433,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;
|
|
@@ -443,7 +443,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();
|
|
|
}
|
|
@@ -481,13 +481,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());
|
|
@@ -830,9 +830,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<>();
|
|
|
}
|
|
@@ -854,7 +854,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<>();
|
|
@@ -870,7 +870,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);
|
|
|
List<String> titles = titleTypeMap.computeIfAbsent(type, k -> new ArrayList<>());
|
|
@@ -1048,8 +1048,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);
|
|
@@ -1068,13 +1068,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) {
|
|
@@ -1082,7 +1082,7 @@ public class DataDashboardService {
|
|
|
}
|
|
|
}
|
|
|
AccountAvgInfo avgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, publish.getGhId(),
|
|
|
- publish.getUpdateTime(), publish.getItemIndex());
|
|
|
+ publish.getPublishTimestamp(), publish.getItemIndex());
|
|
|
if (wxsnHisDistinctSet.contains(publish.getWxSn())) {
|
|
|
continue;
|
|
|
}
|
|
@@ -1134,7 +1134,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());
|
|
@@ -1152,7 +1152,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);
|
|
@@ -1226,7 +1226,7 @@ public class DataDashboardService {
|
|
|
if (!ghIds.contains(article.getGhId())) {
|
|
|
ghIds.add(article.getGhId());
|
|
|
AccountAvgInfo accountAvgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
|
|
|
- article.getUpdateTime(), article.getItemIndex());
|
|
|
+ article.getPublishTimestamp(), article.getItemIndex());
|
|
|
if (Objects.nonNull(accountAvgInfo)) {
|
|
|
item.setFansCount(item.getFansCount() + accountAvgInfo.getFans());
|
|
|
}
|
|
@@ -1371,11 +1371,11 @@ 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).collect(Collectors.toList());
|
|
|
Map<String, Map<String, Article>> articleMap = articleList.stream().collect(
|
|
|
Collectors.groupingBy(Article::getGhId, Collectors.toMap(
|
|
|
- o -> DateUtils.timestampToYMDStr(o.getUpdateTime(), "yyyyMMdd"), o -> o,
|
|
|
+ o -> DateUtils.timestampToYMDStr(o.getPublishTimestamp(), "yyyyMMdd"), o -> o,
|
|
|
(existing, replacement) -> replacement)));
|
|
|
List<String> titleList = articleList.stream().map(Article::getTitle).distinct().collect(Collectors.toList());
|
|
|
List<PublishContent> hisPublishList = new ArrayList<>();
|
|
@@ -1427,7 +1427,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");
|
|
|
AccountAvgInfo accountAvgInfo = map.get(publishDate);
|
|
|
if (Objects.nonNull(accountAvgInfo)) {
|
|
|
item.setReadAvg(accountAvgInfo.getReadAvg());
|
|
@@ -1436,7 +1436,7 @@ public class DataDashboardService {
|
|
|
}
|
|
|
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);
|
|
|
+ int explorationInterval = (int) ((article.getPublishTimestamp() - (hisMinDate / 1000)) / 86400);
|
|
|
item.setFirstExplorationIntervalAvg(explorationInterval);
|
|
|
result.add(item);
|
|
|
}
|