|
@@ -3895,10 +3895,12 @@ public class DataDashboardService {
|
|
|
Pair.of("J", "0%"),
|
|
|
Pair.of("K", "0%"),
|
|
|
Pair.of("L", "0%"),
|
|
|
- Pair.of("M", "0%"),
|
|
|
+ Pair.of("M", "0.00%"),
|
|
|
Pair.of("N", "0%"),
|
|
|
Pair.of("O", "0%"),
|
|
|
- Pair.of("P", "0%")
|
|
|
+ Pair.of("P", "0.00%"),
|
|
|
+ Pair.of("Q", "0.00%"),
|
|
|
+ Pair.of("R", "0%")
|
|
|
);
|
|
|
doSendFeishuSheet(dateStrList, dailyDetailSheetToken, "0Lwz8A", rowNum, rows,
|
|
|
2, styles, null, null);
|
|
@@ -3957,9 +3959,10 @@ public class DataDashboardService {
|
|
|
}
|
|
|
int sevenSumViewCount = dataSevenDaysList.stream().filter(o -> o.getPosition().equals("头条"))
|
|
|
.filter(o -> Objects.nonNull(o.getViewCount()))
|
|
|
- .mapToInt(CategoryGroupDataExport::getViewCount).sum();
|
|
|
+ .mapToInt(CategoryGroupDataExport::getViewCount).sum();
|
|
|
Map<String, List<CategoryGroupDataExport>> categoryDataSevenDaysMap = dataSevenDaysList.stream().filter(o -> o.getPosition().equals("头条"))
|
|
|
.collect(Collectors.groupingBy(CategoryGroupDataExport::getCategory));
|
|
|
+ double sumReadOpenFissionRate = 0;
|
|
|
for (CategoryGroupFunnelExport export : result) {
|
|
|
CategoryGroupDataExport data = categoryDataMap.get(export.getCategory());
|
|
|
if (Objects.nonNull(data)) {
|
|
@@ -3973,7 +3976,7 @@ public class DataDashboardService {
|
|
|
List<CategoryGroupDataExport> sevenDaysCategoryDataList = categoryDataSevenDaysMap.get(export.getCategory());
|
|
|
if (CollectionUtil.isNotEmpty(sevenDaysCategoryDataList)) {
|
|
|
int sevenDaysViewCount = sevenDaysCategoryDataList.stream().filter(o -> Objects.nonNull(o.getViewCount()))
|
|
|
- .mapToInt(CategoryGroupDataExport::getViewCount).sum();
|
|
|
+ .mapToInt(CategoryGroupDataExport::getViewCount).sum();
|
|
|
if (sevenSumViewCount > 0) {
|
|
|
export.setSupplyDemandProportion(round((double) sevenDaysViewCount / sevenSumViewCount, 2));
|
|
|
}
|
|
@@ -3986,19 +3989,18 @@ public class DataDashboardService {
|
|
|
&& Objects.nonNull(export.getAuditPassTotalProportion())) {
|
|
|
export.setAuditPassSupplyDemandRate(round(export.getAuditPassTotalProportion() / export.getSupplyDemandProportion(), 2));
|
|
|
}
|
|
|
+ if (Objects.nonNull(export.getReadRate()) && Objects.nonNull(export.getOpenRate()) && Objects.nonNull(export.getFissionRate())) {
|
|
|
+ export.setReadOpenFissionRate(export.getReadRate() * export.getOpenRate() * export.getFissionRate());
|
|
|
+ sumReadOpenFissionRate += export.getReadOpenFissionRate();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (CategoryGroupFunnelExport item : result) {
|
|
|
+ if (Objects.nonNull(item.getVideoAuditPassRate()) && Objects.nonNull(item.getReadOpenFissionRate()) && sumReadOpenFissionRate > 0) {
|
|
|
+ item.setPassReadOpenFissionRate(item.getVideoAuditPassRate() / (item.getReadOpenFissionRate() / sumReadOpenFissionRate));
|
|
|
+ }
|
|
|
}
|
|
|
- List<String> categorySort = Arrays.asList("历史人物","国家大事","社会法治","奇闻趣事","现代人物","情感故事","家长里短","怀旧时光","社会现象","名人八卦","知识科普","军事历史","健康养生","政治新闻","财经科技");
|
|
|
- // 创建自定义排序比较器
|
|
|
- Comparator<CategoryGroupFunnelExport> comparator = (o1, o2) -> {
|
|
|
- int index1 = categorySort.indexOf(o1.getCategory());
|
|
|
- int index2 = categorySort.indexOf(o2.getCategory());
|
|
|
- // 处理未出现在排序列表中的分类(放到最后)
|
|
|
- if (index1 == -1) index1 = Integer.MAX_VALUE;
|
|
|
- if (index2 == -1) index2 = Integer.MAX_VALUE;
|
|
|
- return Integer.compare(index1, index2);
|
|
|
- };
|
|
|
- // 使用自定义排序器进行排序
|
|
|
- result.sort(comparator);
|
|
|
+
|
|
|
+ result.sort((o1, o2) -> -Double.compare(o2.getReadOpenFissionRate(), o1.getReadOpenFissionRate()));
|
|
|
return result;
|
|
|
}
|
|
|
|