|
@@ -547,14 +547,18 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
Set<Long> ids = new HashSet<>(partition);
|
|
Set<Long> ids = new HashSet<>(partition);
|
|
|
coverMap.putAll(messageAttachmentService.getVideoDetail(ids));
|
|
coverMap.putAll(messageAttachmentService.getVideoDetail(ids));
|
|
|
}
|
|
}
|
|
|
- List<ContentPlatformVideoDataStatAgg> typeVideoDataStatAggList = getTypeChannelVideoDataStatAggList(datastatDt, type, channel, "normal", videoIds);
|
|
|
|
|
- Map<Long, Double> typeVideoScoreMap = typeVideoDataStatAggList.stream().collect(Collectors.toMap(
|
|
|
|
|
|
|
+ List<ContentPlatformVideoDataStatAgg> videoDataStatAggList = getTypeChannelVideoDataStatAggList(datastatDt, type, Arrays.asList(channel, "sum"), videoIds);
|
|
|
|
|
+ Map<Long, Double> typeVideoScoreMap = videoDataStatAggList.stream()
|
|
|
|
|
+ .filter(o -> channel.equals(o.getChannel()) && "normal".equals(o.getStrategy())).collect(Collectors.toMap(
|
|
|
ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
|
|
ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
|
|
|
- List<ContentPlatformVideoDataStatAgg> channelVideoDataStatAggList = getTypeChannelVideoDataStatAggList(datastatDt, type, userChannel, "normal", videoIds);
|
|
|
|
|
- Map<Long, Double> channelVideoScoreMap = channelVideoDataStatAggList.stream().collect(Collectors.toMap(
|
|
|
|
|
|
|
+ Map<Long, Double> channelVideoScoreMap = videoDataStatAggList.stream()
|
|
|
|
|
+ .filter(o -> userChannel.equals(o.getChannel()) && "normal".equals(o.getStrategy())).collect(Collectors.toMap(
|
|
|
ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
|
|
ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
|
|
|
- List<ContentPlatformVideoDataStatAgg> recommendVideoDataStatAggList = getTypeChannelVideoDataStatAggList(datastatDt, type, userChannel, "recommend", videoIds);
|
|
|
|
|
- Map<Long, Double> recommendVideoScoreMap = recommendVideoDataStatAggList.stream().collect(Collectors.toMap(
|
|
|
|
|
|
|
+ Map<Long, Double> recommendTypeVideoScoreMap = videoDataStatAggList.stream()
|
|
|
|
|
+ .filter(o -> channel.equals(o.getChannel()) && "recommend".equals(o.getStrategy())).collect(Collectors.toMap(
|
|
|
|
|
+ ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
|
|
|
|
|
+ Map<Long, Double> recommendChannelVideoScoreMap = videoDataStatAggList.stream()
|
|
|
|
|
+ .filter(o -> userChannel.equals(o.getChannel()) && "recommend".equals(o.getStrategy())).collect(Collectors.toMap(
|
|
|
ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
|
|
ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
|
|
|
List<VideoContentItemVO> result = new ArrayList<>();
|
|
List<VideoContentItemVO> result = new ArrayList<>();
|
|
|
for (ContentPlatformVideo video : videoList) {
|
|
for (ContentPlatformVideo video : videoList) {
|
|
@@ -571,7 +575,10 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
item.setScore(video.getScore());
|
|
item.setScore(video.getScore());
|
|
|
item.setIndustryFissionRate(typeVideoScoreMap.get(video.getVideoId()));
|
|
item.setIndustryFissionRate(typeVideoScoreMap.get(video.getVideoId()));
|
|
|
item.setChannelFissionRate(channelVideoScoreMap.get(video.getVideoId()));
|
|
item.setChannelFissionRate(channelVideoScoreMap.get(video.getVideoId()));
|
|
|
- item.setRecommendScore(recommendVideoScoreMap.get(video.getVideoId()));
|
|
|
|
|
|
|
+ item.setRecommendScore(recommendChannelVideoScoreMap.get(video.getVideoId()));
|
|
|
|
|
+ if (Objects.isNull(item.getRecommendScore())) {
|
|
|
|
|
+ item.setRecommendScore(recommendTypeVideoScoreMap.get(video.getVideoId()));
|
|
|
|
|
+ }
|
|
|
result.add(item);
|
|
result.add(item);
|
|
|
}
|
|
}
|
|
|
return result;
|
|
return result;
|
|
@@ -580,12 +587,11 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
@Override
|
|
@Override
|
|
|
public List<ContentPlatformVideoDataStatAgg> getTypeChannelVideoDataStatAggList(String datastatDt,
|
|
public List<ContentPlatformVideoDataStatAgg> getTypeChannelVideoDataStatAggList(String datastatDt,
|
|
|
String type,
|
|
String type,
|
|
|
- String channel,
|
|
|
|
|
- String strategy,
|
|
|
|
|
|
|
+ List<String> channels,
|
|
|
List<Long> videoIds) {
|
|
List<Long> videoIds) {
|
|
|
ContentPlatformVideoDataStatAggExample example = new ContentPlatformVideoDataStatAggExample();
|
|
ContentPlatformVideoDataStatAggExample example = new ContentPlatformVideoDataStatAggExample();
|
|
|
example.createCriteria().andVideoIdIn(videoIds).andDtEqualTo(datastatDt).andTypeEqualTo(type)
|
|
example.createCriteria().andVideoIdIn(videoIds).andDtEqualTo(datastatDt).andTypeEqualTo(type)
|
|
|
- .andChannelEqualTo(channel).andStrategyEqualTo(strategy);
|
|
|
|
|
|
|
+ .andChannelIn(channels);
|
|
|
return videoDataStatAggMapper.selectByExample(example);
|
|
return videoDataStatAggMapper.selectByExample(example);
|
|
|
}
|
|
}
|
|
|
|
|
|