Przeglądaj źródła

兼容新创建用户

wangyunpeng 2 tygodni temu
rodzic
commit
d17fe218ad

+ 5 - 3
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformVideoJob.java

@@ -373,10 +373,12 @@ public class ContentPlatformVideoJob {
                     if (!videoIdTypeChannelScoreMap.containsKey(type)) {
                         continue;
                     }
-                    Map<Long, Double> typeVideoScoreMap = videoIdTypeChannelScoreMap.get(type).getOrDefault("sum", new HashMap<>());
-                    Map<Long, Double> channelVideoScoreMap = videoIdTypeChannelScoreMap.get(type).getOrDefault(channel, new HashMap<>());
+                    Map<Long, Double> typeVideoScoreMap = videoIdTypeChannelScoreMap.getOrDefault(type, new HashMap<>())
+                            .getOrDefault("sum", new HashMap<>());
+                    Map<Long, Double> channelVideoScoreMap = videoIdTypeChannelScoreMap.getOrDefault(type, new HashMap<>())
+                            .getOrDefault(channel, new HashMap<>());
                     Double platformScore = video.getScore();
-                    Double channelRate = channelVideoScoreMap.get(video.getVideoId());
+                    Double channelRate = channel.equals("sum") ? 0 : channelVideoScoreMap.get(video.getVideoId());
                     Double typeRate = typeVideoScoreMap.get(video.getVideoId());
                     Double recommendScore = calRecommendScore(platformScore, channelRate, typeRate);
                     ContentPlatformVideoDataStatAgg agg = new ContentPlatformVideoDataStatAgg();

+ 2 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -547,7 +547,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             Set<Long> ids = new HashSet<>(partition);
             coverMap.putAll(messageAttachmentService.getVideoDetail(ids));
         }
-        List<ContentPlatformVideoDataStatAgg> videoDataStatAggList = getTypeChannelVideoDataStatAggList(datastatDt, type, Arrays.asList(channel, "sum"), videoIds);
+        List<ContentPlatformVideoDataStatAgg> videoDataStatAggList = getTypeChannelVideoDataStatAggList(datastatDt,
+                type, Arrays.asList("sum", userChannel), videoIds);
         Map<Long, Double> typeVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> channel.equals(o.getChannel()) && "normal".equals(o.getStrategy())).collect(Collectors.toMap(
                 ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));