Authored by hugufei

重命名

@@ -4,7 +4,7 @@ import com.yoho.search.base.utils.ISearchConstants; @@ -4,7 +4,7 @@ import com.yoho.search.base.utils.ISearchConstants;
4 import com.yoho.search.base.utils.ProductIndexEsField; 4 import com.yoho.search.base.utils.ProductIndexEsField;
5 import com.yoho.search.core.es.model.SearchParam; 5 import com.yoho.search.core.es.model.SearchParam;
6 import com.yoho.search.core.es.model.SearchResult; 6 import com.yoho.search.core.es.model.SearchResult;
7 -import com.yoho.search.dal.model.SimilarSkn; 7 +import com.yoho.search.dal.model.BidataSimilarSkn;
8 import com.yoho.search.common.SearchCommonService; 8 import com.yoho.search.common.SearchCommonService;
9 import org.apache.commons.beanutils.BeanUtils; 9 import org.apache.commons.beanutils.BeanUtils;
10 import org.elasticsearch.index.query.BoolQueryBuilder; 10 import org.elasticsearch.index.query.BoolQueryBuilder;
@@ -26,7 +26,7 @@ public class BigdataSimilarSknIndexBaseService { @@ -26,7 +26,7 @@ public class BigdataSimilarSknIndexBaseService {
26 @Autowired 26 @Autowired
27 private SearchCommonService searchCommonService; 27 private SearchCommonService searchCommonService;
28 28
29 - public SimilarSkn querySimilarSkn(String productSkn) { 29 + public BidataSimilarSkn querySimilarSkn(String productSkn) {
30 try { 30 try {
31 SearchParam searchParam = new SearchParam(); 31 SearchParam searchParam = new SearchParam();
32 BoolQueryBuilder boolFilter = QueryBuilders.boolQuery(); 32 BoolQueryBuilder boolFilter = QueryBuilders.boolQuery();
@@ -45,9 +45,9 @@ public class BigdataSimilarSknIndexBaseService { @@ -45,9 +45,9 @@ public class BigdataSimilarSknIndexBaseService {
45 return null; 45 return null;
46 } 46 }
47 Map<String, Object> result = similarSknResults.get(0); 47 Map<String, Object> result = similarSknResults.get(0);
48 - SimilarSkn similarSkn = new SimilarSkn();  
49 - BeanUtils.populate(similarSkn, result);  
50 - return similarSkn; 48 + BidataSimilarSkn bidataSimilarSkn = new BidataSimilarSkn();
  49 + BeanUtils.populate(bidataSimilarSkn, result);
  50 + return bidataSimilarSkn;
51 }catch (Exception e){ 51 }catch (Exception e){
52 logger.error(e.getMessage(),e); 52 logger.error(e.getMessage(),e);
53 return null; 53 return null;
@@ -5,7 +5,7 @@ import com.yoho.search.base.utils.SearchCollectionUtils; @@ -5,7 +5,7 @@ import com.yoho.search.base.utils.SearchCollectionUtils;
5 import com.yoho.search.base.utils.ProductIndexEsField; 5 import com.yoho.search.base.utils.ProductIndexEsField;
6 import com.yoho.search.aop.cache.SearchCacheAble; 6 import com.yoho.search.aop.cache.SearchCacheAble;
7 import com.yoho.search.core.es.model.SearchParam; 7 import com.yoho.search.core.es.model.SearchParam;
8 -import com.yoho.search.dal.model.SimilarSkn; 8 +import com.yoho.search.dal.model.BidataSimilarSkn;
9 import com.yoho.search.models.SearchApiResult; 9 import com.yoho.search.models.SearchApiResult;
10 import com.yoho.search.common.SearchRequestParams; 10 import com.yoho.search.common.SearchRequestParams;
11 import com.yoho.search.service.index.BigdataSimilarSknIndexBaseService; 11 import com.yoho.search.service.index.BigdataSimilarSknIndexBaseService;
@@ -69,21 +69,21 @@ public class BigdataSimilarSknService { @@ -69,21 +69,21 @@ public class BigdataSimilarSknService {
69 return new SearchApiResult().setCode(400).setMessage("SKN不存在"); 69 return new SearchApiResult().setCode(400).setMessage("SKN不存在");
70 } 70 }
71 //4、获取similarskn 71 //4、获取similarskn
72 - SimilarSkn similarSkn = bigdataSimilarSknIndexBaseService.querySimilarSkn(productSkn); 72 + BidataSimilarSkn bidataSimilarSkn = bigdataSimilarSknIndexBaseService.querySimilarSkn(productSkn);
73 73
74 //5、构造searchParams 74 //5、构造searchParams
75 List<SearchParam> searchParams = new ArrayList<>(); 75 List<SearchParam> searchParams = new ArrayList<>();
76 //5.1)图片[性别+不同店铺] 76 //5.1)图片[性别+不同店铺]
77 List<String> diffShopImgSimilarSkns = new ArrayList<>(); 77 List<String> diffShopImgSimilarSkns = new ArrayList<>();
78 - if (similarSkn != null && StringUtils.isNotEmpty(similarSkn.getDiffShopImgSimilarSkns())) {  
79 - diffShopImgSimilarSkns = this.getDistinctSknList(similarSkn.getDiffShopImgSimilarSkns()); 78 + if (bidataSimilarSkn != null && StringUtils.isNotEmpty(bidataSimilarSkn.getDiffShopImgSimilarSkns())) {
  79 + diffShopImgSimilarSkns = this.getDistinctSknList(bidataSimilarSkn.getDiffShopImgSimilarSkns());
80 } 80 }
81 searchParams.add(this.builderSimilarSknSearchParam(productInfoInEs, diffShopImgSimilarSkns, true)); 81 searchParams.add(this.builderSimilarSknSearchParam(productInfoInEs, diffShopImgSimilarSkns, true));
82 82
83 //5.2)行为[性别+不同店铺+同品类] 83 //5.2)行为[性别+不同店铺+同品类]
84 List<String> diffShopActionSimilarSkns = new ArrayList<>(); 84 List<String> diffShopActionSimilarSkns = new ArrayList<>();
85 - if (similarSkn != null && StringUtils.isNotEmpty(similarSkn.getDiffShopActionSimilarSkns())) {  
86 - diffShopActionSimilarSkns = this.getDistinctSknList(similarSkn.getDiffShopActionSimilarSkns()); 85 + if (bidataSimilarSkn != null && StringUtils.isNotEmpty(bidataSimilarSkn.getDiffShopActionSimilarSkns())) {
  86 + diffShopActionSimilarSkns = this.getDistinctSknList(bidataSimilarSkn.getDiffShopActionSimilarSkns());
87 } 87 }
88 searchParams.add(this.builderSimilarSknSearchParam(productInfoInEs, diffShopActionSimilarSkns, true)); 88 searchParams.add(this.builderSimilarSknSearchParam(productInfoInEs, diffShopActionSimilarSkns, true));
89 89