|
|
@@ -383,13 +383,16 @@ public class RankStrategyBy834 extends RankStrategyBasic {
|
|
|
|
|
|
// 如果第一名不是保量广告,则随机取一条,并取消保量标记
|
|
|
if (!top1IsGuaranteed && result.size() > 1) {
|
|
|
- int randomIndex = random.nextInt(result.size());
|
|
|
- top1Item = result.get(randomIndex);
|
|
|
+ Collections.shuffle(result);
|
|
|
+ top1Item = result.get(0);
|
|
|
// 随机取出的广告取消保量标记
|
|
|
top1Item.getExt().put("isGuaranteed", false);
|
|
|
top1Item.getExt().put("guaranteeWeight", 1.0);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(result)) {
|
|
|
+ AdRankItem top1Item = result.get(0);
|
|
|
List<String> participateCompetitionType = new ArrayList<>();
|
|
|
participateCompetitionType.add("engine");
|
|
|
top1Item.getExt().put("isGuaranteeType", isGuaranteeType);
|