|
@@ -170,9 +170,9 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
if (scoreParam.getExpCodeSet().contains(guaranteeExp)) {
|
|
|
String thatDayDateString = DateUtils.getThatDayDateString();
|
|
|
String redisKey = key.replace("{date}", thatDayDateString);
|
|
|
- List<String> redisKeys = request.getAdIdList().stream().map(AdPlatformCreativeDTO::getAdVerId).distinct()
|
|
|
- .map(e -> redisKey.replace("{adrId}", e)).collect(Collectors.toList());
|
|
|
- log.info("redisKeys={}", redisKeys);
|
|
|
+ List<String> adVerIds = request.getAdIdList().stream().map(AdPlatformCreativeDTO::getAdVerId).distinct()
|
|
|
+ .filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+ List<String> redisKeys = adVerIds.stream().map(e -> redisKey.replace("{adrId}", e)).collect(Collectors.toList());
|
|
|
List<String> values = adRedisHelper.mget(redisKeys);
|
|
|
log.info("redisValues={}", values);
|
|
|
if (CollectionUtils.isNotEmpty(values)) {
|
|
@@ -180,12 +180,12 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
String value = values.get(i);
|
|
|
if (value != null) {
|
|
|
GuaranteeView guaranteeView = JSONObject.parseObject(value, GuaranteeView.class);
|
|
|
- map.put(redisKeys.get(i), guaranteeView);
|
|
|
+ map.put(adVerIds.get(i), guaranteeView);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- log.info("guarantee map={}", map);
|
|
|
+
|
|
|
Map<String, String> sceneFeatureMap = this.handleSceneFeature(ts);
|
|
|
long time1 = System.currentTimeMillis();
|
|
|
|
|
@@ -214,7 +214,6 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
adRankItem.getExt().put("recallsources", dto.getRecallSources());
|
|
|
if (MapUtils.isNotEmpty(map)) {
|
|
|
GuaranteeView guaranteeView = map.get(dto.getAdVerId());
|
|
|
- log.info("map guaranteeView={}", guaranteeView);
|
|
|
if (guaranteeView != null) {
|
|
|
double guaranteeWeight = getGuaranteeWeight(guaranteeView);
|
|
|
adRankItem.getExt().put("guaranteeView", guaranteeView.toString());
|
|
@@ -330,7 +329,7 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
double cpmCoefficient = weightParam.getOrDefault("cpmCoefficient", 0.9);
|
|
|
|
|
|
for (AdRankItem item : result) {
|
|
|
- log.info("item.getExt={}", item.getExt());
|
|
|
+
|
|
|
double scoreCoefficient = creativeScoreCoefficient.getOrDefault(item.getAdId(), 1d);
|
|
|
if (scoreParam.getExpCodeSet().contains(guaranteeExp)) {
|
|
|
double guaranteeScoreCoefficient;
|