|
|
@@ -358,6 +358,12 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
}
|
|
|
|
|
|
protected void filterRequestAdList(RankRecommendRequestParam request, ScoreParam scoreParam) {
|
|
|
+ // adProfessionName 覆盖 profession(上游逐步废弃 profession,统一用 adProfessionName)
|
|
|
+ for (AdPlatformCreativeDTO dto : request.getAdIdList()) {
|
|
|
+ if (StringUtils.isNotBlank(dto.getAdProfessionName())) {
|
|
|
+ dto.setProfession(dto.getAdProfessionName());
|
|
|
+ }
|
|
|
+ }
|
|
|
Map<String, String> userLayer = this.getUserLayer(request.getMid());
|
|
|
String layer;
|
|
|
String clazz;
|
|
|
@@ -903,6 +909,7 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
adRankItem.setCpm(ObjUtil.nullOrDefault(dto.getCpm(), 90).doubleValue());
|
|
|
adRankItem.setSkuId(dto.getSkuId());
|
|
|
adRankItem.getExt().put("recallsources", dto.getRecallSources());
|
|
|
+ fillAdRankItemExt(adRankItem, dto);
|
|
|
adRankItem.setRandom(new Random().nextInt(1000));
|
|
|
if (CollectionUtils.isNotEmpty(noApiAdVerIds)) {
|
|
|
if (noApiAdVerIds.contains(dto.getAdVerId())) {
|
|
|
@@ -915,6 +922,28 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
return adRankItem;
|
|
|
}
|
|
|
|
|
|
+ protected void fillAdRankItemExt(AdRankItem adRankItem, AdPlatformCreativeDTO dto) {
|
|
|
+ adRankItem.setAdProfessionName(dto.getAdProfessionName());
|
|
|
+ adRankItem.setAdSkuId(dto.getAdSkuId());
|
|
|
+ adRankItem.setAdCategoryName(dto.getAdCategoryName());
|
|
|
+ adRankItem.setAdCategoryId(dto.getAdCategoryId() != null ? String.valueOf(dto.getAdCategoryId()) : null);
|
|
|
+ if (StringUtils.isNotBlank(dto.getAdSkuCode())) {
|
|
|
+ try {
|
|
|
+ Long adSkuCode = Long.valueOf(dto.getAdSkuCode());
|
|
|
+ if (dto.getAdSkuCode().equals(String.valueOf(adSkuCode))) {
|
|
|
+ adRankItem.setAdSkuCode(adSkuCode);
|
|
|
+ }
|
|
|
+ } catch (NumberFormatException ignored) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ adRankItem.setAdSkuName(dto.getAdSkuName());
|
|
|
+ adRankItem.getExt().put("categoryName", StringUtils.defaultString(dto.getCategoryName()));
|
|
|
+ adRankItem.getExt().put("adCategoryName", StringUtils.defaultString(dto.getAdCategoryName()));
|
|
|
+ adRankItem.getExt().put("adCategoryId", dto.getAdCategoryId() != null ? String.valueOf(dto.getAdCategoryId()) : "");
|
|
|
+ adRankItem.getExt().put("adSkuCode", StringUtils.defaultString(dto.getAdSkuCode()));
|
|
|
+ adRankItem.getExt().put("adSkuName", StringUtils.defaultString(dto.getAdSkuName()));
|
|
|
+ }
|
|
|
+
|
|
|
protected void putMetaFeature(AdRankItem adRankItem, Feature feature, Map<String, String> reqFeature,
|
|
|
Map<String, String> sceneFeatureMap, RankRecommendRequestParam request) {
|
|
|
if (feature == null) {
|
|
|
@@ -974,6 +1003,11 @@ public abstract class RankStrategyBasic implements RankStrategy {
|
|
|
reqFeature.put("landingPageType", String.valueOf(adPlatformCreativeDTO.getLandingPageType()));
|
|
|
reqFeature.put("category_name", adPlatformCreativeDTO.getCategoryName());
|
|
|
reqFeature.put("material_md5", adPlatformCreativeDTO.getMaterialMd5());
|
|
|
+ reqFeature.put("ad_category_name", adPlatformCreativeDTO.getAdCategoryName());
|
|
|
+ reqFeature.put("ad_category_id", adPlatformCreativeDTO.getAdCategoryId() != null ? String.valueOf(adPlatformCreativeDTO.getAdCategoryId()) : "");
|
|
|
+ reqFeature.put("ad_sku_id", adPlatformCreativeDTO.getAdSkuId() != null ? String.valueOf(adPlatformCreativeDTO.getAdSkuId()) : "");
|
|
|
+ reqFeature.put("ad_sku_code", adPlatformCreativeDTO.getAdSkuCode() != null ? adPlatformCreativeDTO.getAdSkuCode() : "");
|
|
|
+ reqFeature.put("ad_sku_name", adPlatformCreativeDTO.getAdSkuName() != null ? adPlatformCreativeDTO.getAdSkuName() : "");
|
|
|
}
|
|
|
adRankItem.getMetaFeatureMap().put("reqFeature", reqFeature);
|
|
|
adRankItem.getMetaFeatureMap().put("sceneFeature", sceneFeatureMap);
|