|
@@ -291,7 +291,7 @@ public class DataDashboardService {
|
|
|
.map(PublishContentDTO::getSourceId).distinct().collect(Collectors.toList());
|
|
|
List<ProducePlanExeRecord> planExeRecordList = new ArrayList<>();
|
|
|
for (List<String> partitions : Lists.partition(contentSourceIds, 1000)) {
|
|
|
- planExeRecordList.addAll(producePlanExeRecordRepository.findByPlanExeIdIn(partitions));
|
|
|
+ planExeRecordList.addAll(producePlanExeRecordRepository.getByPlanExeIdIn(partitions));
|
|
|
}
|
|
|
log.info("newSortStrategyData planExeRecordList finish");
|
|
|
List<String> videoPoolSourceIds = publishContents.stream()
|
|
@@ -2744,7 +2744,7 @@ public class DataDashboardService {
|
|
|
// 获取晋级
|
|
|
List<String> sourceIds = datastatSortStrategyList.stream().map(DatastatSortStrategy::getSourceId).distinct()
|
|
|
.collect(Collectors.toList());
|
|
|
- List<ProducePlanExeRecord> exeRecordList = producePlanExeRecordRepository.findByPlanExeIdIn(sourceIds);
|
|
|
+ List<ProducePlanExeRecord> exeRecordList = producePlanExeRecordRepository.getByPlanExeIdIn(sourceIds);
|
|
|
Map<String, String> sourceIdMap = exeRecordList.stream()
|
|
|
.collect(Collectors.toMap(ProducePlanExeRecord::getPlanExeId, ProducePlanExeRecord::getChannelContentId));
|
|
|
List<String> channelContentIds = exeRecordList.stream().map(ProducePlanExeRecord::getChannelContentId)
|
|
@@ -2754,7 +2754,8 @@ public class DataDashboardService {
|
|
|
Map<String, String> promotionSourceMap = promotionSourceList.stream()
|
|
|
.collect(Collectors.toMap(ArticlePoolPromotionSource::getChannelContentId, ArticlePoolPromotionSource::getRootProduceContentId));
|
|
|
List<String> rootProduceContentIds = promotionSourceList.stream().map(ArticlePoolPromotionSource::getRootProduceContentId)
|
|
|
- .collect(Collectors.toList());
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ // 视频溯源信息
|
|
|
List<LongArticleCrawlerVideo> promotionCrawlerVideoList = crawlerVideoRepository.getByContentIdInAndIsIllegal(rootProduceContentIds, 0);
|
|
|
Map<String, List<LongArticleCrawlerVideo>> promotionCrawlerVideoMap = promotionCrawlerVideoList.stream()
|
|
|
.collect(Collectors.groupingBy(LongArticleCrawlerVideo::getContentId));
|
|
@@ -2763,6 +2764,13 @@ public class DataDashboardService {
|
|
|
List<PublishSingleVideoSource> promotionSingleVideoSourceList = videoPoolRepository.getByVideoOssPathIn(promotionVideoOssPathList);
|
|
|
Map<String, List<PublishSingleVideoSource>> promotionSinggleVideoSourceMap = promotionSingleVideoSourceList.stream()
|
|
|
.collect(Collectors.groupingBy(PublishSingleVideoSource::getVideoOssPath));
|
|
|
+ // 文章溯源信息
|
|
|
+ List<ProducePlanExeRecord> rootProduceContentList = producePlanExeRecordRepository.getByPlanExeIdIn(rootProduceContentIds);
|
|
|
+ Map<String, String> rootProduceContentMap = rootProduceContentList.stream()
|
|
|
+ .collect(Collectors.toMap(ProducePlanExeRecord::getPlanExeId, ProducePlanExeRecord::getPlanId));
|
|
|
+ List<String> rootPlanIdList = rootProduceContentList.stream().map(ProducePlanExeRecord::getPlanId).distinct().collect(Collectors.toList());
|
|
|
+ List<ProducePlan> producePlanList = producePlanRepository.findByIdIn(rootPlanIdList);
|
|
|
+ Map<String, ProducePlan> producePlanMap = producePlanList.stream().collect(Collectors.toMap(ProducePlan::getId, Function.identity()));
|
|
|
|
|
|
for (Article article : articleList) {
|
|
|
boolean isVideo = false;
|
|
@@ -2801,31 +2809,33 @@ public class DataDashboardService {
|
|
|
source = VideoPoolPlatformEnum.from(singleVideoSources.get(0).getPlatform()).getDescription();
|
|
|
}
|
|
|
// 判断是否是晋级内容池
|
|
|
- if (!isVideo && Objects.nonNull(datastatSortStrategy)) {
|
|
|
- String channelContentId = sourceIdMap.get(datastatSortStrategy.getSourceId());
|
|
|
- if (StringUtils.hasText(channelContentId)) {
|
|
|
- String rootProduceContentId = promotionSourceMap.get(channelContentId);
|
|
|
- if (StringUtils.hasText(rootProduceContentId)) {
|
|
|
- List<LongArticleCrawlerVideo> promotionCrawlerVideos = promotionCrawlerVideoMap.get(rootProduceContentId);
|
|
|
- if (CollectionUtil.isNotEmpty(promotionCrawlerVideos)) {
|
|
|
- List<String> promotionVideoOssPaths = promotionCrawlerVideos.stream().map(LongArticleCrawlerVideo::getVideoOssPath)
|
|
|
- .filter(StringUtils::hasText).collect(Collectors.toList());
|
|
|
- List<PublishSingleVideoSource> promotionSingleVideoSources = new ArrayList<>();
|
|
|
- for (String videoOssPath : promotionVideoOssPaths) {
|
|
|
- List<PublishSingleVideoSource> item = promotionSinggleVideoSourceMap.get(videoOssPath);
|
|
|
- if (CollectionUtil.isEmpty(item)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- promotionSingleVideoSources.addAll(item);
|
|
|
- }
|
|
|
- if (CollectionUtil.isNotEmpty(promotionSingleVideoSources)) {
|
|
|
- isVideo = true;
|
|
|
- source = VideoPoolPlatformEnum.from(promotionSingleVideoSources.get(0).getPlatform()).getDescription();
|
|
|
- }
|
|
|
- }
|
|
|
+ String channelContentId = null;
|
|
|
+ if (Objects.nonNull(datastatSortStrategy)) {
|
|
|
+ channelContentId = sourceIdMap.get(datastatSortStrategy.getSourceId());
|
|
|
+ }
|
|
|
+ String rootProduceContentId = promotionSourceMap.get(channelContentId);
|
|
|
+ List<LongArticleCrawlerVideo> promotionCrawlerVideos = promotionCrawlerVideoMap.get(rootProduceContentId);
|
|
|
+ if (!isVideo && CollectionUtil.isNotEmpty(promotionCrawlerVideos)) {
|
|
|
+ List<String> promotionVideoOssPaths = promotionCrawlerVideos.stream().map(LongArticleCrawlerVideo::getVideoOssPath)
|
|
|
+ .filter(StringUtils::hasText).collect(Collectors.toList());
|
|
|
+ List<PublishSingleVideoSource> promotionSingleVideoSources = new ArrayList<>();
|
|
|
+ for (String videoOssPath : promotionVideoOssPaths) {
|
|
|
+ List<PublishSingleVideoSource> item = promotionSinggleVideoSourceMap.get(videoOssPath);
|
|
|
+ if (CollectionUtil.isEmpty(item)) {
|
|
|
+ continue;
|
|
|
}
|
|
|
+ promotionSingleVideoSources.addAll(item);
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(promotionSingleVideoSources)) {
|
|
|
+ isVideo = true;
|
|
|
+ source = VideoPoolPlatformEnum.from(promotionSingleVideoSources.get(0).getPlatform()).getDescription();
|
|
|
}
|
|
|
}
|
|
|
+ if (!isVideo) {
|
|
|
+ String planId = rootProduceContentMap.get(rootProduceContentId);
|
|
|
+ ProducePlan producePlan = producePlanMap.get(planId);
|
|
|
+ source = getArticleSource(producePlan);
|
|
|
+ }
|
|
|
if (CollectionUtil.isNotEmpty(crawlerVideoList) && crawlerVideoList.size() == 1) {
|
|
|
isSameMiniProgram = true;
|
|
|
}
|
|
@@ -2861,9 +2871,6 @@ public class DataDashboardService {
|
|
|
if (Objects.isNull(datastatSortStrategy)) {
|
|
|
return;
|
|
|
}
|
|
|
- if ("文章".equals(type) && "".equals(source)) {
|
|
|
- source = getArticleSource(datastatSortStrategy);
|
|
|
- }
|
|
|
for (ContentEffectGroupBySourceExport export : result) {
|
|
|
if ((export.getType().contains("SUM") && export.getType().contains(type)) || export.getType().equals(type)) {
|
|
|
if ((export.getIsSameMiniprogram().equals("相同") && isSameMiniProgram)
|
|
@@ -2920,9 +2927,9 @@ public class DataDashboardService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private String getArticleSource(DatastatSortStrategy datastatSortStrategy) {
|
|
|
- if (StringUtils.hasText(datastatSortStrategy.getProducePlanName())
|
|
|
- && datastatSortStrategy.getProducePlanName().contains("头条")) {
|
|
|
+ private String getArticleSource(ProducePlan producePlan) {
|
|
|
+ if (Objects.nonNull(producePlan)
|
|
|
+ && producePlan.getName().contains("今日头条")) {
|
|
|
return "头条文章";
|
|
|
} else {
|
|
|
return "公众号文章";
|
|
@@ -3714,7 +3721,8 @@ public class DataDashboardService {
|
|
|
|
|
|
List<Pair<String, String>> styles = Arrays
|
|
|
.asList(
|
|
|
- Pair.of("G", "0.00%")
|
|
|
+ Pair.of("G", "0.00%"),
|
|
|
+ Pair.of("H", "0.00%")
|
|
|
);
|
|
|
doSendFeishuSheet(dateStrList, dailyDetailSheetToken, "bl1eL2", rowNum, rows,
|
|
|
2, styles, null, null);
|
|
@@ -3763,6 +3771,7 @@ public class DataDashboardService {
|
|
|
for (Map.Entry<String, CategoryGroupDataExport> item : entry.getValue().entrySet()) {
|
|
|
CategoryGroupDataExport export = item.getValue();
|
|
|
if (export.getFansCount() != null && export.getFansCount() != 0) {
|
|
|
+ export.setReadRate((double) export.getViewCount() / export.getFansCount());
|
|
|
export.setOpenRate((double) export.getFirstLevel() / export.getFansCount());
|
|
|
}
|
|
|
result.add(export);
|