|
@@ -107,6 +107,8 @@ public class DataDashboardService {
|
|
|
private LongArticleTitleAuditRepository longArticleTitleAuditRepository;
|
|
|
@Autowired
|
|
|
private PublishSingleVideoSourceRepository videoPoolRepository;
|
|
|
+ @Autowired
|
|
|
+ private LongArticlesRootSourceIdRepository rootSourceIdRepository;
|
|
|
|
|
|
@ApolloJsonValue("${export.account.ghId:[]}")
|
|
|
private static List<String> ghIdList;
|
|
@@ -2670,6 +2672,22 @@ public class DataDashboardService {
|
|
|
}
|
|
|
Map<String, List<ArticleDetailInfo>> articleDetailInfoMap = articleDetailInfoList.stream()
|
|
|
.collect(Collectors.groupingBy(ArticleDetailInfo::getWxSn));
|
|
|
+ // 获取rootSourceId
|
|
|
+ Map<String, List<String>> rootSourceIdMap = new HashMap<>();
|
|
|
+ List<String> rootSourceIdList = new ArrayList<>();
|
|
|
+ for (Article article : articleList) {
|
|
|
+ List<String> rootSourceIds = JSONArray.parseArray(article.getRootSourceIdList(), String.class);
|
|
|
+ rootSourceIdMap.put(article.getWxSn(), rootSourceIds);
|
|
|
+ rootSourceIdList.addAll(rootSourceIds);
|
|
|
+ }
|
|
|
+ List<LongArticlesRootSourceId> longArticlesRootSourceIdList = rootSourceIdRepository.getByRootSourceIdIn(rootSourceIdList);
|
|
|
+ Map<String, LongArticlesRootSourceId> longArticlesRootSourceIdMap = longArticlesRootSourceIdList.stream()
|
|
|
+ .collect(Collectors.toMap(LongArticlesRootSourceId::getRootSourceId, Function.identity()));
|
|
|
+ // 获取视频
|
|
|
+ List<String> contentIdList = longArticlesRootSourceIdList.stream().map(LongArticlesRootSourceId::getContentId).distinct().collect(Collectors.toList());
|
|
|
+ List<LongArticleCrawlerVideo> longArticleCrawlerVideoList = crawlerVideoRepository.getByContentIdInAndIsIllegal(contentIdList, 0);
|
|
|
+ Map<String, List<LongArticleCrawlerVideo>> longArticleCrawlerVideoMap = longArticleCrawlerVideoList.stream()
|
|
|
+ .collect(Collectors.groupingBy(LongArticleCrawlerVideo::getContentId));
|
|
|
|
|
|
for (Article article : articleList) {
|
|
|
FirstEndMiniprogramFirstLevelExport item = new FirstEndMiniprogramFirstLevelExport();
|
|
@@ -2678,10 +2696,30 @@ public class DataDashboardService {
|
|
|
item.setTitle(article.getTitle());
|
|
|
item.setPosition(article.getItemIndex());
|
|
|
item.setViewCount(article.getShowViewCount());
|
|
|
-
|
|
|
if (Objects.isNull(item.getViewCount()) || item.getViewCount() == 0) {
|
|
|
continue;
|
|
|
}
|
|
|
+ List<String> rootSourceIds = rootSourceIdMap.get(article.getWxSn());
|
|
|
+ if (CollectionUtil.isNotEmpty(rootSourceIds)) {
|
|
|
+ List<LongArticlesRootSourceId> rootSourceIdItemList = new ArrayList<>();
|
|
|
+ for (String rootSourceId : rootSourceIds) {
|
|
|
+ LongArticlesRootSourceId longArticlesRootSourceId = longArticlesRootSourceIdMap.get(rootSourceId);
|
|
|
+ if (Objects.isNull(longArticlesRootSourceId)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ rootSourceIdItemList.add(longArticlesRootSourceId);
|
|
|
+ }
|
|
|
+ String contentId = rootSourceIdItemList.get(0).getContentId();
|
|
|
+ List<LongArticleCrawlerVideo> crawlerVideoList = longArticleCrawlerVideoMap.get(contentId);
|
|
|
+ List<String> videoOssPaths = crawlerVideoList.stream().map(LongArticleCrawlerVideo::getVideoOssPath).collect(Collectors.toList());
|
|
|
+ List<PublishSingleVideoSource> singleVideoSources = videoPoolRepository.getByVideoOssPathIn(videoOssPaths);
|
|
|
+ if (CollectionUtil.isNotEmpty(singleVideoSources)) {
|
|
|
+ item.setIsVideo(1);
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(crawlerVideoList) && crawlerVideoList.size() == 1) {
|
|
|
+ item.setIsSameMiniProgram(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
List<ArticleDetailInfo> detailInfoList = articleDetailInfoMap.get(article.getWxSn());
|
|
|
if (CollectionUtil.isNotEmpty(detailInfoList)) {
|
|
|
int totalFirstLevel = 0;
|