wangyunpeng 1 month ago
parent
commit
8b5580fef8

+ 9 - 3
api-module/src/main/java/com/tzld/piaoquan/api/job/ContentPlatformDatastatJob.java

@@ -687,7 +687,7 @@ public class ContentPlatformDatastatJob {
         if (CollectionUtils.isNotEmpty(saveList)) {
             List<String> channels = saveList.stream().map(ContentPlatformQwDataStatReplyTotal::getChannel).distinct().collect(Collectors.toList());
             List<ContentPlatformQwDataStatReplyTotal> channelScoreList = dataStatMapperExt.getQwTotalDatastatReplyScoreList(dt, channels);
-            Map<String, Double> channelScoreMap = channelScoreList.stream().filter(o -> Objects.nonNull(o.getChannel()) && Objects.nonNull(o.getScore()))
+            Map<String, Double> channelScoreMap = channelScoreList.stream()
                     .collect(Collectors.toMap(ContentPlatformQwDataStatReplyTotal::getChannel, ContentPlatformQwDataStatReplyTotal::getScore, (a, b) -> a));
             for (ContentPlatformQwDataStatReplyTotal item : saveList) {
                 item.setScore(channelScoreMap.get(item.getChannel()));
@@ -713,11 +713,17 @@ public class ContentPlatformDatastatJob {
         Map<Long, List<ContentPlatformQwPlan>> qwPlanMap = qwPlanList.stream().collect(
                 Collectors.groupingBy(ContentPlatformQwPlan::getCreateAccountId));
         List<Long> qwPlanIds = qwPlanList.stream().map(ContentPlatformQwPlan::getId).collect(Collectors.toList());
-        List<ContentPlatformQwPlanVideo> qwPlanVideoList = getSubChannelQwPlanVideoList(qwPlanIds);
+        List<ContentPlatformQwPlanVideo> qwPlanVideoList = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(qwPlanIds)) {
+            qwPlanVideoList = getSubChannelQwPlanVideoList(qwPlanIds);
+        }
         Map<Long, List<ContentPlatformQwPlanVideo>> qwPlanVideoMap = qwPlanVideoList.stream()
                .collect(Collectors.groupingBy(ContentPlatformQwPlanVideo::getPlanId));
         List<Long> videoIdList = qwPlanVideoList.stream().map(ContentPlatformQwPlanVideo::getVideoId).collect(Collectors.toList());
-        List<ContentPlatformVideo> videoList = planService.getVideoContentListByVideoIds(videoIdList);
+        List<ContentPlatformVideo> videoList = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(videoIdList)) {
+            videoList = planService.getVideoContentListByVideoIds(videoIdList);
+        }
         Map<Long, Double> videoScoreMap = videoList.stream()
                 .collect(Collectors.toMap(ContentPlatformVideo::getVideoId, ContentPlatformVideo::getScore, (a, b) -> a));
         Long now = System.currentTimeMillis();

+ 1 - 1
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.xml

@@ -137,7 +137,7 @@
 
     <select id="getQwSubChannelDatastatList"
             resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStatReplyTotal">
-        select date_str, sub_channel, first_level_count, score
+        select date_str, sub_channel as channel, first_level_count, score
         from content_platform_qw_datastat_sub_channel
         where create_account_id = #{createAccountId}
         order by date_str desc