|
@@ -59,6 +59,8 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
@ApolloJsonValue("${alpha:1.0}")
|
|
|
Double alpha;
|
|
|
|
|
|
+ String key = "ad:platform:guarantee:data:{date}:{adrId}";
|
|
|
+
|
|
|
Set<String> sparseFeatureSet;
|
|
|
|
|
|
@Autowired
|
|
@@ -165,14 +167,17 @@ public class RankStrategyBy688 extends RankStrategyBasic {
|
|
|
}
|
|
|
Map<String, GuaranteeView> map = new HashMap<>();
|
|
|
if (scoreParam.getExpCodeSet().contains(guaranteeExp)) {
|
|
|
- List<String> adVerIdList = request.getAdIdList().stream().map(AdPlatformCreativeDTO::getAdVerId).distinct().collect(Collectors.toList());
|
|
|
- List<String> values = adRedisHelper.mget(adVerIdList);
|
|
|
+ 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());
|
|
|
+ List<String> values = adRedisHelper.mget(redisKeys);
|
|
|
if (CollectionUtils.isNotEmpty(values)) {
|
|
|
- for (int i = 0; i < adVerIdList.size(); i++) {
|
|
|
+ for (int i = 0; i < redisKeys.size(); i++) {
|
|
|
String value = values.get(i);
|
|
|
if (value != null) {
|
|
|
GuaranteeView guaranteeView = JSONObject.parseObject(value, GuaranteeView.class);
|
|
|
- map.put(adVerIdList.get(i), guaranteeView);
|
|
|
+ map.put(redisKeys.get(i), guaranteeView);
|
|
|
}
|
|
|
}
|
|
|
}
|