|
@@ -7,7 +7,14 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.AccountBusinessTypeEnum;
|
|
|
+import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
|
|
|
+import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.aigc.*;
|
|
|
+import com.tzld.longarticle.recommend.server.model.entity.crawler.AccountAvgInfo;
|
|
|
+import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
|
|
|
+import com.tzld.longarticle.recommend.server.model.entity.crawler.ArticleDetailInfo;
|
|
|
+import com.tzld.longarticle.recommend.server.model.entity.crawler.PublishSortLog;
|
|
|
+import com.tzld.longarticle.recommend.server.model.entity.longArticle.DatastatSortStrategy;
|
|
|
import com.tzld.longarticle.recommend.server.model.param.MiniprogramTaskParam;
|
|
|
import com.tzld.longarticle.recommend.server.model.param.PublishContentParam;
|
|
|
import com.tzld.longarticle.recommend.server.model.vo.IntermediateIndicatorsExport;
|
|
@@ -18,13 +25,6 @@ import com.tzld.longarticle.recommend.server.repository.crawler.AccountAvgInfoRe
|
|
|
import com.tzld.longarticle.recommend.server.repository.crawler.ArticleDetailInfoRepository;
|
|
|
import com.tzld.longarticle.recommend.server.repository.crawler.ArticleRepository;
|
|
|
import com.tzld.longarticle.recommend.server.repository.crawler.PublishSortLogRepository;
|
|
|
-import com.tzld.longarticle.recommend.server.model.entity.crawler.AccountAvgInfo;
|
|
|
-import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
|
|
|
-import com.tzld.longarticle.recommend.server.model.entity.crawler.ArticleDetailInfo;
|
|
|
-import com.tzld.longarticle.recommend.server.model.entity.crawler.PublishSortLog;
|
|
|
-import com.tzld.longarticle.recommend.server.model.entity.longArticle.DatastatSortStrategy;
|
|
|
-import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
|
|
|
-import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
|
|
|
import com.tzld.longarticle.recommend.server.util.DateUtils;
|
|
|
import com.tzld.longarticle.recommend.server.util.MapBuilder;
|
|
|
import com.tzld.longarticle.recommend.server.util.feishu.FeiShu;
|
|
@@ -174,9 +174,11 @@ public class DataDashboardService {
|
|
|
for (List<PublishContentParam> partitions : Lists.partition(publishContentParamList, 1000)) {
|
|
|
publishContents.addAll(aigcBaseMapper.getPublishContentByTitle(partitions));
|
|
|
}
|
|
|
- Map<String, Map<String, PublishContent>> publishContentMap = publishContents.stream().collect(
|
|
|
+ Map<String, Map<String, Map<Long, PublishContent>>> publishContentMap = publishContents.stream()
|
|
|
+ .sorted(Comparator.comparingLong(PublishContent::getPublishTimestamp)).collect(
|
|
|
Collectors.groupingBy(PublishContent::getPublishAccountId,
|
|
|
- Collectors.toMap(PublishContent::getTitle, o -> o, (existing, replacement) -> existing)));
|
|
|
+ Collectors.groupingBy(PublishContent::getTitle,
|
|
|
+ Collectors.toMap(PublishContent::getPublishTimestamp, o -> o, (existing, replacement) -> replacement))));
|
|
|
// 获取发布内容排版
|
|
|
List<String> publishContentIds = publishContents.stream().map(PublishContent::getId).collect(Collectors.toList());
|
|
|
List<PublishContentLayout> publishContentLayoutList = new ArrayList<>();
|
|
@@ -365,11 +367,27 @@ public class DataDashboardService {
|
|
|
result.add(obj);
|
|
|
// aigc 数据
|
|
|
PublishAccount publishAccount = publishAccountMap.get(article.getGhId());
|
|
|
- Map<String, PublishContent> titleContentMap = publishContentMap.get(publishAccount.getId());
|
|
|
+ Map<String, Map<Long, PublishContent>> titleContentMap = publishContentMap.get(publishAccount.getId());
|
|
|
if (Objects.isNull(titleContentMap)) {
|
|
|
continue;
|
|
|
}
|
|
|
- PublishContent publishContent = titleContentMap.get(article.getTitle());
|
|
|
+ Map<Long, PublishContent> publishTimeContentMap = titleContentMap.get(article.getTitle());
|
|
|
+ if (Objects.isNull(publishTimeContentMap) || publishTimeContentMap.isEmpty()) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ PublishContent publishContent = null;
|
|
|
+ for (Map.Entry<Long, PublishContent> entry : publishTimeContentMap.entrySet()) {
|
|
|
+ String publishTime = DateUtils.timestampToYMDStr(entry.getKey() / 1000, "yyyyMMdd");
|
|
|
+ if (publishTime.equals(date)) {
|
|
|
+ if (Objects.nonNull(publishContent)) {
|
|
|
+ if (publishContent.getPublishTimestamp() < entry.getValue().getPublishTimestamp()) {
|
|
|
+ publishContent = entry.getValue();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ publishContent = entry.getValue();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (Objects.isNull(publishContent)) {
|
|
|
continue;
|
|
|
}
|