Browse Source

修改key

xueyiming 1 day ago
parent
commit
7ed18dff46

+ 4 - 3
ad-engine-service/src/main/java/com/tzld/piaoquan/ad/engine/service/score/strategy/RankStrategyBy688.java

@@ -169,15 +169,16 @@ 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());
+            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);
             if (CollectionUtils.isNotEmpty(values)) {
                 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(redisKeys.get(i), guaranteeView);
+                        map.put(adVerIds.get(i), guaranteeView);
                     }
                 }
             }