wangyunpeng 2 тижнів тому
батько
коміт
3864f282b6

+ 9 - 2
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformVideoJob.java

@@ -378,8 +378,15 @@ public class ContentPlatformVideoJob {
                     Map<Long, Double> channelVideoScoreMap = videoIdTypeChannelScoreMap.getOrDefault(type, new HashMap<>())
                             .getOrDefault(channel, new HashMap<>());
                     Double platformScore = video.getScore();
-                    Double channelRate = "sum".equals(channel) ? 0.0 : channelVideoScoreMap.get(video.getVideoId());
-                    Double typeRate = typeVideoScoreMap.get(video.getVideoId());
+
+                    Double channelRate = 0.0;
+                    if (Objects.nonNull(channelVideoScoreMap) && channelVideoScoreMap.containsKey(video.getVideoId())) {
+                        channelRate = channelVideoScoreMap.get(video.getVideoId());
+                    }
+                    Double typeRate = 0.0;
+                    if (Objects.nonNull(typeVideoScoreMap) && typeVideoScoreMap.containsKey(video.getVideoId())) {
+                        typeRate = typeVideoScoreMap.get(video.getVideoId());
+                    }
                     Double recommendScore = calRecommendScore(platformScore, channelRate, typeRate);
                     ContentPlatformVideoDataStatAgg agg = new ContentPlatformVideoDataStatAgg();
                     agg.setDt(datastatDt);