|
|
package com.yoho.search.recall.scene.beans.builder;
|
|
|
|
|
|
import com.yoho.search.core.personalized.models.SortBrand;
|
|
|
import com.yoho.search.recall.scene.beans.config.SknCountConfig;
|
|
|
import com.yoho.search.recall.scene.beans.config.SknCountConfigService;
|
|
|
import com.yoho.search.recall.scene.beans.config.ProductCountConfig;
|
|
|
import com.yoho.search.recall.scene.beans.config.ProductCountConfigService;
|
|
|
import com.yoho.search.recall.scene.beans.strategy.IStrategy;
|
|
|
import com.yoho.search.recall.scene.beans.strategy.SortBrandType;
|
|
|
import com.yoho.search.recall.scene.beans.strategy.impls.*;
|
|
|
import com.yoho.search.recall.scene.constants.SknCountConstants;
|
|
|
import com.yoho.search.recall.scene.models.common.ParamQueryFilter;
|
|
|
import com.yoho.search.recall.scene.models.req.RecallRequest;
|
|
|
import com.yoho.search.recall.scene.models.req.UserRecallRequest;
|
|
|
import com.yoho.search.service.base.SearchDynamicConfigService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
...
|
...
|
@@ -21,7 +19,7 @@ import java.util.List; |
|
|
public class SortBrandRecallRequestBuilder {
|
|
|
|
|
|
@Autowired
|
|
|
private SknCountConfigService sknCountConfigService;
|
|
|
private ProductCountConfigService productCountConfigService;
|
|
|
|
|
|
/**
|
|
|
* 构造品牌+品类的召回请求
|
...
|
...
|
@@ -42,29 +40,29 @@ public class SortBrandRecallRequestBuilder { |
|
|
|
|
|
// 3)、参数构造
|
|
|
for (SortBrand sortBrand : sortBrands) {
|
|
|
SknCountConfig sknCountConfig = this.queryRecallSknCount(pageId, sortBrand);
|
|
|
if (sknCountConfig == null) {
|
|
|
ProductCountConfig productCountConfig = this.queryRecallSknCount(pageId, sortBrand);
|
|
|
if (productCountConfig == null) {
|
|
|
continue;
|
|
|
}
|
|
|
// 1) 新品
|
|
|
if (sknCountConfig.getNewShelve() > 0) {
|
|
|
requests.add(this.buildSortBrandNewShelveRequest(paramQueryFilter, sortBrand, sknCountConfig.getNewShelve(), sortBrandType));
|
|
|
if (productCountConfig.getNewShelve() > 0) {
|
|
|
requests.add(this.buildSortBrandNewShelveRequest(paramQueryFilter, sortBrand, productCountConfig.getNewShelve(), sortBrandType));
|
|
|
}
|
|
|
// 2) 人气
|
|
|
if (sknCountConfig.getHeatValue() > 0) {
|
|
|
requests.add(this.buildSortBrandHeatValueRequest(paramQueryFilter, sortBrand, sknCountConfig.getHeatValue(), sortBrandType));
|
|
|
if (productCountConfig.getHeatValue() > 0) {
|
|
|
requests.add(this.buildSortBrandHeatValueRequest(paramQueryFilter, sortBrand, productCountConfig.getHeatValue(), sortBrandType));
|
|
|
}
|
|
|
// 3) 新降价
|
|
|
if (sknCountConfig.getReducePrice() > 0) {
|
|
|
requests.add(this.buildSortBrandReducePriceRequest(paramQueryFilter, sortBrand, sknCountConfig.getReducePrice(), sortBrandType));
|
|
|
if (productCountConfig.getReducePrice() > 0) {
|
|
|
requests.add(this.buildSortBrandReducePriceRequest(paramQueryFilter, sortBrand, productCountConfig.getReducePrice(), sortBrandType));
|
|
|
}
|
|
|
// 4) 新开促销
|
|
|
if (sknCountConfig.getPromotion() > 0) {
|
|
|
requests.add(this.buildSortBrandPromotionRequest(paramQueryFilter, sortBrand, sknCountConfig.getPromotion(), sortBrandType));
|
|
|
if (productCountConfig.getPromotion() > 0) {
|
|
|
requests.add(this.buildSortBrandPromotionRequest(paramQueryFilter, sortBrand, productCountConfig.getPromotion(), sortBrandType));
|
|
|
}
|
|
|
// 5) 转化率
|
|
|
if (sknCountConfig.getCtrValue() > 0) {
|
|
|
requests.add(this.buildSortBrandCtrValueRequest(paramQueryFilter, sortBrand, sknCountConfig.getCtrValue(), sortBrandType));
|
|
|
if (productCountConfig.getCtrValue() > 0) {
|
|
|
requests.add(this.buildSortBrandCtrValueRequest(paramQueryFilter, sortBrand, productCountConfig.getCtrValue(), sortBrandType));
|
|
|
}
|
|
|
}
|
|
|
return requests;
|
...
|
...
|
@@ -77,8 +75,8 @@ public class SortBrandRecallRequestBuilder { |
|
|
* @param sortBrand
|
|
|
* @return
|
|
|
*/
|
|
|
private SknCountConfig queryRecallSknCount(int pageId, SortBrand sortBrand) {
|
|
|
return sknCountConfigService.getSknCountConfig(pageId, sortBrand);
|
|
|
private ProductCountConfig queryRecallSknCount(int pageId, SortBrand sortBrand) {
|
|
|
return productCountConfigService.getProductCountConfig(pageId, sortBrand);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|