|
|
@@ -870,6 +870,11 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
rows = demandVideoMapperExt.selectForRecommend(
|
|
|
dt, channelName, crowdSegment, DEMAND_STRATEGY_PRIOR_SCENE, null, null, null, null, null, limit, false);
|
|
|
}
|
|
|
+ // 跨渠道退化:channel_name 命中但 crowd_segment 在对侧渠道下 0 行(如公众号账号切到企微入口)→ 去 crowd_segment,只按 channel_name 拉通用数据
|
|
|
+ if (channelName != null && rows.isEmpty()) {
|
|
|
+ rows = demandVideoMapperExt.selectForRecommend(
|
|
|
+ dt, channelName, null, DEMAND_STRATEGY_PRIOR_SCENE, null, null, null, null, null, limit, false);
|
|
|
+ }
|
|
|
// 1. 同 video_id 取 total_rov 最大的代表行(SQL 已排序,putIfAbsent 保留首次)
|
|
|
LinkedHashMap<Long, ContentPlatformDemandVideo> bestPerVideo = new LinkedHashMap<>();
|
|
|
for (ContentPlatformDemandVideo r : rows) {
|
|
|
@@ -921,6 +926,11 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
rows = demandVideoMapperExt.selectForRecommend(
|
|
|
dt, channelName, crowdSegment, DEMAND_STRATEGY_PRIOR, PRIOR_PREMIUM_DIMENSION, null, null, null, null, fetchLimit, false);
|
|
|
}
|
|
|
+ // 跨渠道退化:channel_name 命中但 crowd_segment 在对侧 0 行 → 去 crowd_segment 拉通用数据
|
|
|
+ if (channelName != null && rows.isEmpty()) {
|
|
|
+ rows = demandVideoMapperExt.selectForRecommend(
|
|
|
+ dt, channelName, null, DEMAND_STRATEGY_PRIOR, PRIOR_PREMIUM_DIMENSION, null, null, null, null, fetchLimit, false);
|
|
|
+ }
|
|
|
|
|
|
Function<ContentPlatformDemandVideo, String> keyFn = r ->
|
|
|
(r.getPointType() == null ? "" : r.getPointType()) + "\u0001"
|
|
|
@@ -994,6 +1004,13 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
stageRel = demandVideoMapperExt.selectForRecommend(
|
|
|
dt, channelName, crowdSegment, DEMAND_STRATEGY_POSTERIOR, null, null, POSTERIOR_FILTER_REL_LIKE, null, POSTERIOR_DRIVE_DIMENSION_TIME, fetchLimit, true);
|
|
|
}
|
|
|
+ // 跨渠道退化:channel_name 命中但 crowd_segment 在对侧 0 行 → 去 crowd_segment 拉通用数据
|
|
|
+ if (channelName != null && stageAbs.isEmpty() && stageRel.isEmpty()) {
|
|
|
+ stageAbs = demandVideoMapperExt.selectForRecommend(
|
|
|
+ dt, channelName, null, DEMAND_STRATEGY_POSTERIOR, null, null, POSTERIOR_FILTER_ABS_LIKE, null, POSTERIOR_DRIVE_DIMENSION_TIME, fetchLimit, true);
|
|
|
+ stageRel = demandVideoMapperExt.selectForRecommend(
|
|
|
+ dt, channelName, null, DEMAND_STRATEGY_POSTERIOR, null, null, POSTERIOR_FILTER_REL_LIKE, null, POSTERIOR_DRIVE_DIMENSION_TIME, fetchLimit, true);
|
|
|
+ }
|
|
|
|
|
|
Function<ContentPlatformDemandVideo, String> keyFn = r ->
|
|
|
r.getDemandContentId() == null ? "" : r.getDemandContentId();
|