|
@@ -118,18 +118,45 @@ public class RankService680 {
|
|
|
item.setScore(item.getLrScore() * item.getCpa());
|
|
|
item.getScoreMap().put("cpa", item.getCpa());
|
|
|
item.getFeatureMap().putAll(userFeatureMap);
|
|
|
- if (MapUtils.isNotEmpty(videoFeature)) {
|
|
|
- item.getMetaFeatureMap().putAll(videoFeature);
|
|
|
+
|
|
|
+ for (Map.Entry<String, Map<String, String>> entry : videoFeature.entrySet()) {
|
|
|
+ if (MapUtils.isNotEmpty(entry.getValue())) {
|
|
|
+ item.getMetaFeatureMap().put(entry.getKey(), entry.getValue());
|
|
|
+ }
|
|
|
}
|
|
|
- if (MapUtils.isNotEmpty(userFeature)) {
|
|
|
- item.getMetaFeatureMap().putAll(userFeature);
|
|
|
+
|
|
|
+ for (Map.Entry<String, Map<String, String>> entry : userFeature.entrySet()) {
|
|
|
+ if (MapUtils.isNotEmpty(entry.getValue())) {
|
|
|
+ item.getMetaFeatureMap().put(entry.getKey(), entry.getValue());
|
|
|
+ }
|
|
|
}
|
|
|
- if (allAdVerFeature.containsKey(item.getAdVerId())) {
|
|
|
- item.getMetaFeatureMap().putAll(allAdVerFeature.get(item.getAdVerId()));
|
|
|
+
|
|
|
+ Map<String, Map<String, String>> adVerFeature = allAdVerFeature.getOrDefault(item.getAdVerId(), new HashMap<>());
|
|
|
+ for (Map.Entry<String, Map<String, String>> entry : adVerFeature.entrySet()) {
|
|
|
+ if (MapUtils.isNotEmpty(entry.getValue())) {
|
|
|
+ item.getMetaFeatureMap().put(entry.getKey(), entry.getValue());
|
|
|
+ }
|
|
|
}
|
|
|
- if (allCidFeature.containsKey(String.valueOf(item.getAdId()))) {
|
|
|
- item.getMetaFeatureMap().putAll(allCidFeature.get(String.valueOf(item.getAdId())));
|
|
|
+
|
|
|
+ Map<String, Map<String, String>> cidFeature = allCidFeature.getOrDefault(String.valueOf(item.getAdId()), new HashMap<>());
|
|
|
+ for (Map.Entry<String, Map<String, String>> entry : cidFeature.entrySet()) {
|
|
|
+ if (MapUtils.isNotEmpty(entry.getValue())) {
|
|
|
+ item.getMetaFeatureMap().put(entry.getKey(), entry.getValue());
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ // if (MapUtils.isNotEmpty(videoFeature)) {
|
|
|
+ // item.getMetaFeatureMap().putAll(videoFeature);
|
|
|
+ // }
|
|
|
+ // if (MapUtils.isNotEmpty(userFeature)) {
|
|
|
+ // item.getMetaFeatureMap().putAll(userFeature);
|
|
|
+ // }
|
|
|
+ // if (allAdVerFeature.containsKey(item.getAdVerId())) {
|
|
|
+ // item.getMetaFeatureMap().putAll(allAdVerFeature.get(item.getAdVerId()));
|
|
|
+ // }
|
|
|
+ // if (allCidFeature.containsKey(String.valueOf(item.getAdId()))) {
|
|
|
+ // item.getMetaFeatureMap().putAll(allCidFeature.get(String.valueOf(item.getAdId())));
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
Collections.sort(result);
|