|
@@ -201,15 +201,22 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
|
|
|
return null;
|
|
|
}
|
|
|
List<String> rootSourceIds = datastatList.stream().map(ContentPlatformQwDataStat::getRootSourceId).distinct().collect(Collectors.toList());
|
|
|
- List<ContentPlatformQwPlan> qwPlanList = planService.getQwPlanListByRootSourceIds(rootSourceIds);
|
|
|
+ List<ContentPlatformQwPlan> qwPlanList = new ArrayList<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(rootSourceIds)) {
|
|
|
+ qwPlanList = planService.getQwPlanListByRootSourceIds(rootSourceIds);
|
|
|
+ }
|
|
|
Map<String, Long> qwPlanMap = qwPlanList.stream().collect(Collectors.toMap(ContentPlatformQwPlan::getRootSourceId, ContentPlatformQwPlan::getId));
|
|
|
List<Long> planIds = qwPlanList.stream().map(ContentPlatformQwPlan::getId).distinct().collect(Collectors.toList());
|
|
|
- List<ContentPlatformQwPlanVideo> qwPlanVideoList = planService.getQwPlanVideoListByPlanIds(planIds);
|
|
|
- Map<Long, List<ContentPlatformQwPlanVideo>> qwPlanVideoMap = qwPlanVideoList.stream().collect(Collectors.groupingBy(ContentPlatformQwPlanVideo::getPlanId));
|
|
|
+ Map<Long, List<ContentPlatformQwPlanVideo>> qwPlanVideoMap = new HashMap<>();
|
|
|
+ if (CollectionUtils.isNotEmpty(planIds)) {
|
|
|
+ List<ContentPlatformQwPlanVideo> qwPlanVideoList = planService.getQwPlanVideoListByPlanIds(planIds);
|
|
|
+ qwPlanVideoMap = qwPlanVideoList.stream().collect(Collectors.groupingBy(ContentPlatformQwPlanVideo::getPlanId));
|
|
|
+ }
|
|
|
List<QwDatastatItemVO> result = new ArrayList<>();
|
|
|
for (ContentPlatformQwDataStat datastat : datastatList) {
|
|
|
QwDatastatItemVO vo = new QwDatastatItemVO();
|
|
|
vo.setDateStr(datastat.getDateStr());
|
|
|
+ vo.setFirstLevel(datastat.getFirstLevelCount());
|
|
|
vo.setScore(datastat.getScore());
|
|
|
Long planId = qwPlanMap.get(datastat.getRootSourceId());
|
|
|
if (Objects.nonNull(planId)) {
|
|
@@ -238,7 +245,7 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
|
|
|
if (CollectionUtils.isNotEmpty(dataList)) {
|
|
|
for (GzhDatastatItemVO data : dataList) {
|
|
|
list.add(new GzhDatastatItemExportVO(data.getDateStr(), data.getName(),
|
|
|
- data.getFansIncreaseCount(), data.getFirstLevel(), data.getOpenRate(), data.getScore()));
|
|
|
+ data.getFansIncreaseCount(), data.getFirstLevel(), data.getOpenRate(), data.getScore()));
|
|
|
}
|
|
|
} else {
|
|
|
list.add(new GzhDatastatItemExportVO());
|
|
@@ -265,7 +272,7 @@ public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatast
|
|
|
if (CollectionUtils.isNotEmpty(dataList)) {
|
|
|
for (QwDatastatItemVO data : dataList) {
|
|
|
list.add(new QwDatastatItemExportVO(data.getDateStr(), data.getFirstLevel(),
|
|
|
- data.getScore(), data.getTitle(), data.getVideoId()));
|
|
|
+ data.getScore(), data.getTitle(), data.getVideoId()));
|
|
|
}
|
|
|
} else {
|
|
|
list.add(new QwDatastatItemExportVO());
|