|  | @@ -114,6 +114,10 @@ public class DataDashboardService {
 | 
	
		
			
				|  |  |      private LongArticlesRootSourceIdRepository rootSourceIdRepository;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private DatastatSortStrategyRepository datastatSortStrategyRepository;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private LongArticlesPublishMiniprogramRepository longArticlesPublishMiniprogramRepository;
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private LongArticlesNewVideoCoverRepository longArticlesNewVideoCoverRepository;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @ApolloJsonValue("${export.account.ghId:[]}")
 | 
	
		
			
				|  |  |      private static List<String> ghIdList;
 | 
	
	
		
			
				|  | @@ -2924,4 +2928,329 @@ public class DataDashboardService {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    public void coverStatisticDataExport(String dateStr) {
 | 
	
		
			
				|  |  | +        List<String> dateStrList = Arrays.asList(dateStr);
 | 
	
		
			
				|  |  | +        List<CoverStatisticDataExport> exportList = buildCoverStatisticDataExport(dateStr);
 | 
	
		
			
				|  |  | +        if (CollectionUtil.isEmpty(exportList)) {
 | 
	
		
			
				|  |  | +            return;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        int rowNum = exportList.size();
 | 
	
		
			
				|  |  | +        List<List<Object>> rows = new ArrayList<>();
 | 
	
		
			
				|  |  | +        Field[] fields = CoverStatisticDataExport.class.getDeclaredFields();
 | 
	
		
			
				|  |  | +        for (CoverStatisticDataExport datum : exportList) {
 | 
	
		
			
				|  |  | +            List<Object> rowDatas = new ArrayList<>();
 | 
	
		
			
				|  |  | +            rows.add(rowDatas);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            for (Field field : fields) {
 | 
	
		
			
				|  |  | +                field.setAccessible(true);
 | 
	
		
			
				|  |  | +                try {
 | 
	
		
			
				|  |  | +                    rowDatas.add(field.get(datum));
 | 
	
		
			
				|  |  | +                } catch (IllegalAccessException e) {
 | 
	
		
			
				|  |  | +                    log.error("获取值出错:{}", field.getName());
 | 
	
		
			
				|  |  | +                } catch (Exception e) {
 | 
	
		
			
				|  |  | +                    throw new RuntimeException(e.getMessage());
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        doSendFeishuSheet(dateStrList, dailyDetailSheetToken, "jwayC4", rowNum, rows,
 | 
	
		
			
				|  |  | +                2, null, null, null);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private List<CoverStatisticDataExport> buildCoverStatisticDataExport(String dateStr) {
 | 
	
		
			
				|  |  | +        List<CoverStatisticDataExport> result = new ArrayList<>();
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport articleTestFirst = new CoverStatisticDataExport(dateStr, "文章", "实验组", "头条");
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport articleTestSecond = new CoverStatisticDataExport(dateStr, "文章", "实验组", "次条");
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport articleTestLast = new CoverStatisticDataExport(dateStr, "文章", "实验组", "3-8条");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport articleBaseFirst = new CoverStatisticDataExport(dateStr, "文章", "base组", "头条");
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport articleBaseSecond = new CoverStatisticDataExport(dateStr, "文章", "base组", "次条");
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport articleBaseLast = new CoverStatisticDataExport(dateStr, "文章", "base组", "3-8条");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport articleMinimumFirst = new CoverStatisticDataExport(dateStr, "文章", "兜底组", "头条");
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport articleMinimumSecond = new CoverStatisticDataExport(dateStr, "文章", "兜底组", "次条");
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport articleMinimumLast = new CoverStatisticDataExport(dateStr, "文章", "兜底组", "3-8条");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport articleSumFirst = new CoverStatisticDataExport(dateStr, "文章", "sum", "sum");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport videoTestFirst = new CoverStatisticDataExport(dateStr, "视频", "实验组", "头条");
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport videoTestSecond = new CoverStatisticDataExport(dateStr, "视频", "实验组", "次条");
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport videoTestLast = new CoverStatisticDataExport(dateStr, "视频", "实验组", "3-8条");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport videoBaseFirst = new CoverStatisticDataExport(dateStr, "视频", "base组", "头条");
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport videoBaseSecond = new CoverStatisticDataExport(dateStr, "视频", "base组", "次条");
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport videoBaseLast = new CoverStatisticDataExport(dateStr, "视频", "base组", "3-8条");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport videoMinimumFirst = new CoverStatisticDataExport(dateStr, "视频", "兜底组", "头条");
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport videoMinimumSecond = new CoverStatisticDataExport(dateStr, "视频", "兜底组", "次条");
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport videoMinimumLast = new CoverStatisticDataExport(dateStr, "视频", "兜底组", "3-8条");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        CoverStatisticDataExport videoSumFirst = new CoverStatisticDataExport(dateStr, "视频", "sum", "sum");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        Long start = DateUtils.getStartOfDay(dateStr, "yyyyMMdd");
 | 
	
		
			
				|  |  | +        Long end = start + 86400;
 | 
	
		
			
				|  |  | +        Date startDate = new Date(start * 1000);
 | 
	
		
			
				|  |  | +        Date endDate = new Date(end * 1000);
 | 
	
		
			
				|  |  | +        List<Article> articleList = articleRepository.getByPublishTimestampBetweenAndTypeEquals(start, end, ArticleTypeEnum.QUNFA.getVal());
 | 
	
		
			
				|  |  | +        List<String> wxSnList = articleList.stream().map(Article::getWxSn).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +        List<ArticleDetailInfo> articleDetailInfoList = new ArrayList<>();
 | 
	
		
			
				|  |  | +        for (List<String> partitions : Lists.partition(wxSnList, 1000)) {
 | 
	
		
			
				|  |  | +            articleDetailInfoList.addAll(articleDetailInfoRepository.findByWxSnInAndPublishDtBetween(partitions, startDate, endDate));
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        List<DatastatSortStrategy> datastatSortStrategyList = datastatSortStrategyRepository.getByWxSnIn(wxSnList);
 | 
	
		
			
				|  |  | +        Map<String, DatastatSortStrategy> datastatSortStrategyMap = datastatSortStrategyList.stream()
 | 
	
		
			
				|  |  | +                .collect(Collectors.toMap(DatastatSortStrategy::getWxSn, Function.identity()));
 | 
	
		
			
				|  |  | +        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) {
 | 
	
		
			
				|  |  | +            boolean isVideo = false;
 | 
	
		
			
				|  |  | +            boolean isSameMiniProgram = false;
 | 
	
		
			
				|  |  | +            boolean isTest = false;
 | 
	
		
			
				|  |  | +            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)) {
 | 
	
		
			
				|  |  | +                        rootSourceIdItemList.add(longArticlesRootSourceId);
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                    LongArticlesPublishMiniprogram longArticlesPublishMiniprogram
 | 
	
		
			
				|  |  | +                            = longArticlesPublishMiniprogramRepository.findByRootSourceIdEquals(rootSourceId);
 | 
	
		
			
				|  |  | +                    if (!Objects.isNull(longArticlesPublishMiniprogram)) {
 | 
	
		
			
				|  |  | +                        if (longArticlesPublishMiniprogram.getNewVideoCoverId() != null) {
 | 
	
		
			
				|  |  | +                            isTest = true;
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                String contentId = rootSourceIdItemList.get(0).getContentId();
 | 
	
		
			
				|  |  | +                List<LongArticleCrawlerVideo> crawlerVideoList = longArticleCrawlerVideoMap.get(contentId);
 | 
	
		
			
				|  |  | +                List<String> videoOssPaths = crawlerVideoList.stream().map(LongArticleCrawlerVideo::getVideoOssPath)
 | 
	
		
			
				|  |  | +                        .filter(StringUtils::hasText).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +                List<PublishSingleVideoSource> singleVideoSources = videoPoolRepository.getByVideoOssPathIn(videoOssPaths);
 | 
	
		
			
				|  |  | +                if (CollectionUtil.isNotEmpty(singleVideoSources)) {
 | 
	
		
			
				|  |  | +                    isVideo = true;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +                if (CollectionUtil.isNotEmpty(crawlerVideoList) && crawlerVideoList.size() == 1) {
 | 
	
		
			
				|  |  | +                    isSameMiniProgram = true;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            List<ArticleDetailInfo> detailInfoList = articleDetailInfoMap.get(article.getWxSn());
 | 
	
		
			
				|  |  | +            List<AccountAvgInfo> accountAvgInfoList = accountAvgInfoRepository.getAllByGhIdEqualsAndStatusEquals(article.getGhId(), 1);
 | 
	
		
			
				|  |  | +            Integer fans = 0;
 | 
	
		
			
				|  |  | +            if (CollectionUtils.isNotEmpty(accountAvgInfoList)) {
 | 
	
		
			
				|  |  | +                fans = accountAvgInfoList.get(0).getFans();
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if (isVideo) {
 | 
	
		
			
				|  |  | +                if (isSameMiniProgram) {
 | 
	
		
			
				|  |  | +                    if (isTest) {
 | 
	
		
			
				|  |  | +                        if (article.getItemIndex() == 1) {
 | 
	
		
			
				|  |  | +                            save(videoTestFirst, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                            for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                                saveMini(videoTestFirst, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        } else if (article.getItemIndex() == 2) {
 | 
	
		
			
				|  |  | +                            save(videoTestSecond, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                            for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                                saveMini(videoTestSecond, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        } else {
 | 
	
		
			
				|  |  | +                            save(videoTestLast, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                            for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                                saveMini(videoTestLast, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    } else {
 | 
	
		
			
				|  |  | +                        if (article.getItemIndex() == 1) {
 | 
	
		
			
				|  |  | +                            save(videoMinimumFirst, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                            for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                                saveMini(videoMinimumFirst, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        } else if (article.getItemIndex() == 2) {
 | 
	
		
			
				|  |  | +                            save(videoMinimumSecond, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                            for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                                saveMini(videoMinimumSecond, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        } else {
 | 
	
		
			
				|  |  | +                            save(videoMinimumLast, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                            for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                                saveMini(videoMinimumLast, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  | +                    if (article.getItemIndex() == 1) {
 | 
	
		
			
				|  |  | +                        save(videoBaseFirst, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                        for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                            saveMini(videoBaseFirst, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    } else if (article.getItemIndex() == 2) {
 | 
	
		
			
				|  |  | +                        save(videoBaseSecond, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                        for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                            saveMini(videoBaseSecond, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    } else {
 | 
	
		
			
				|  |  | +                        save(videoBaseLast, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                        for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                            saveMini(videoBaseLast, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                if (isSameMiniProgram) {
 | 
	
		
			
				|  |  | +                    if (isTest) {
 | 
	
		
			
				|  |  | +                        if (article.getItemIndex() == 1) {
 | 
	
		
			
				|  |  | +                            save(articleTestFirst, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                            for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                                saveMini(articleTestFirst, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        } else if (article.getItemIndex() == 2) {
 | 
	
		
			
				|  |  | +                            save(articleTestSecond, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                            for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                                saveMini(articleTestSecond, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        } else {
 | 
	
		
			
				|  |  | +                            save(articleTestLast, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                            for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                                saveMini(articleTestLast, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    } else {
 | 
	
		
			
				|  |  | +                        if (article.getItemIndex() == 1) {
 | 
	
		
			
				|  |  | +                            save(articleMinimumFirst, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                            for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                                saveMini(articleMinimumFirst, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        } else if (article.getItemIndex() == 2) {
 | 
	
		
			
				|  |  | +                            save(articleMinimumSecond, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                            for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                                saveMini(articleMinimumSecond, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        } else {
 | 
	
		
			
				|  |  | +                            save(articleMinimumLast, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                            for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                                saveMini(articleMinimumLast, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                            }
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                } else {
 | 
	
		
			
				|  |  | +                    if (article.getItemIndex() == 1) {
 | 
	
		
			
				|  |  | +                        save(articleBaseFirst, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                        for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                            saveMini(articleBaseFirst, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    } else if (article.getItemIndex() == 2) {
 | 
	
		
			
				|  |  | +                        save(articleBaseSecond, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                        for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                            saveMini(articleBaseSecond, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    } else {
 | 
	
		
			
				|  |  | +                        save(articleBaseLast, fans, article.getShowViewCount());
 | 
	
		
			
				|  |  | +                        for (ArticleDetailInfo articleDetailInfo : detailInfoList) {
 | 
	
		
			
				|  |  | +                            saveMini(articleBaseLast, articleDetailInfo.getFirstLevel(), articleDetailInfo.getFission0(), articleDetailInfo.getVideoIndex());
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +                    }
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        result.add(rate(articleTestFirst));
 | 
	
		
			
				|  |  | +        result.add(rate(articleTestSecond));
 | 
	
		
			
				|  |  | +        result.add(rate(articleTestLast));
 | 
	
		
			
				|  |  | +        result.add(rate(articleBaseFirst));
 | 
	
		
			
				|  |  | +        result.add(rate(articleBaseSecond));
 | 
	
		
			
				|  |  | +        result.add(rate(articleBaseLast));
 | 
	
		
			
				|  |  | +        result.add(rate(articleMinimumFirst));
 | 
	
		
			
				|  |  | +        result.add(rate(articleMinimumSecond));
 | 
	
		
			
				|  |  | +        result.add(rate(articleMinimumLast));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        result.add(rate(videoTestFirst));
 | 
	
		
			
				|  |  | +        result.add(rate(videoTestSecond));
 | 
	
		
			
				|  |  | +        result.add(rate(videoTestLast));
 | 
	
		
			
				|  |  | +        result.add(rate(videoBaseFirst));
 | 
	
		
			
				|  |  | +        result.add(rate(videoBaseSecond));
 | 
	
		
			
				|  |  | +        result.add(rate(videoBaseLast));
 | 
	
		
			
				|  |  | +        result.add(rate(videoMinimumFirst));
 | 
	
		
			
				|  |  | +        result.add(rate(videoMinimumSecond));
 | 
	
		
			
				|  |  | +        result.add(rate(videoMinimumLast));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        return result;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private void save(CoverStatisticDataExport coverStatisticDataExport, Integer fans, Integer showViewCount) {
 | 
	
		
			
				|  |  | +        if (fans != null) {
 | 
	
		
			
				|  |  | +            coverStatisticDataExport.setFans(coverStatisticDataExport.getFans() + fans);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (showViewCount != null) {
 | 
	
		
			
				|  |  | +            coverStatisticDataExport.setShowViewCount(coverStatisticDataExport.getShowViewCount() + showViewCount);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        coverStatisticDataExport.setPublishCount(coverStatisticDataExport.getPublishCount() + 1);
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private void saveMini(CoverStatisticDataExport coverStatisticDataExport, Integer firstLevel, Integer fission0, Integer index) {
 | 
	
		
			
				|  |  | +        if (firstLevel != null) {
 | 
	
		
			
				|  |  | +            coverStatisticDataExport.setAllFirstLevel(coverStatisticDataExport.getAllFirstLevel() + firstLevel);
 | 
	
		
			
				|  |  | +            if (index == 1) {
 | 
	
		
			
				|  |  | +                coverStatisticDataExport.setOneFirstLevel(coverStatisticDataExport.getOneFirstLevel() + firstLevel);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if (index == 2) {
 | 
	
		
			
				|  |  | +                coverStatisticDataExport.setTwoFirstLevel(coverStatisticDataExport.getTwoFirstLevel() + firstLevel);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (fission0 != null) {
 | 
	
		
			
				|  |  | +            coverStatisticDataExport.setAllFission0(coverStatisticDataExport.getAllFission0() + fission0);
 | 
	
		
			
				|  |  | +            if (index == 1) {
 | 
	
		
			
				|  |  | +                coverStatisticDataExport.setOneFission0(coverStatisticDataExport.getOneFission0() + fission0);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if (index == 2) {
 | 
	
		
			
				|  |  | +                coverStatisticDataExport.setTwoFission0(coverStatisticDataExport.getTwoFission0() + fission0);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    private CoverStatisticDataExport rate(CoverStatisticDataExport coverStatisticDataExport) {
 | 
	
		
			
				|  |  | +        if (coverStatisticDataExport.getShowViewCount() != null && coverStatisticDataExport.getFans() != null) {
 | 
	
		
			
				|  |  | +            coverStatisticDataExport.setShowViewRate((double) coverStatisticDataExport.getShowViewCount() / coverStatisticDataExport.getFans());
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (coverStatisticDataExport.getShowViewCount() != null) {
 | 
	
		
			
				|  |  | +            if (coverStatisticDataExport.getAllFirstLevel() != null) {
 | 
	
		
			
				|  |  | +                coverStatisticDataExport.setAllFirstLevelRate((double) coverStatisticDataExport.getAllFirstLevel() / coverStatisticDataExport.getShowViewCount());
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if (coverStatisticDataExport.getOneFirstLevel() != null) {
 | 
	
		
			
				|  |  | +                coverStatisticDataExport.setOneFirstLevelRate((double) coverStatisticDataExport.getOneFirstLevel() / coverStatisticDataExport.getShowViewCount());
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            if (coverStatisticDataExport.getTwoFirstLevel() != null) {
 | 
	
		
			
				|  |  | +                coverStatisticDataExport.setTwoFirstLevelRate((double) coverStatisticDataExport.getTwoFirstLevel() / coverStatisticDataExport.getShowViewCount());
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        if (coverStatisticDataExport.getAllFirstLevel() != null && coverStatisticDataExport.getAllFission0() != null) {
 | 
	
		
			
				|  |  | +            coverStatisticDataExport.setAllFission0Rate((double) coverStatisticDataExport.getAllFission0() / coverStatisticDataExport.getAllFirstLevel());
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (coverStatisticDataExport.getOneFirstLevel() != null && coverStatisticDataExport.getOneFission0() != null) {
 | 
	
		
			
				|  |  | +            coverStatisticDataExport.setOneFission0Rate((double) coverStatisticDataExport.getOneFission0() / coverStatisticDataExport.getOneFirstLevel());
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        if (coverStatisticDataExport.getTwoFirstLevel() != null && coverStatisticDataExport.getTwoFission0() != null) {
 | 
	
		
			
				|  |  | +            coverStatisticDataExport.setTwoFission0Rate((double) coverStatisticDataExport.getTwoFission0() / coverStatisticDataExport.getTwoFirstLevel());
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return coverStatisticDataExport;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  }
 |