Showing
1 changed file
with
6 additions
and
5 deletions
@@ -101,19 +101,20 @@ public class GoodProductListService implements IGoodProductsService { | @@ -101,19 +101,20 @@ public class GoodProductListService implements IGoodProductsService { | ||
101 | } | 101 | } |
102 | 102 | ||
103 | // 1.1 SKN参数获取 | 103 | // 1.1 SKN参数获取 |
104 | - List<String> product_skns = stringToList(paramMap.getOrDefault(view_product_skn, ""), ","); | 104 | + List<String> view_product_skns = stringToList(paramMap.getOrDefault(view_product_skn, ""), ","); |
105 | List<String> cart_productskns = stringToList(paramMap.getOrDefault(cart_product_skn, ""), ","); | 105 | List<String> cart_productskns = stringToList(paramMap.getOrDefault(cart_product_skn, ""), ","); |
106 | List<String> collect_product_skns = stringToList(paramMap.getOrDefault(collect_product_skn, ""), ","); | 106 | List<String> collect_product_skns = stringToList(paramMap.getOrDefault(collect_product_skn, ""), ","); |
107 | 107 | ||
108 | // 2、先获取用户浏览的SKN对应的品类列表 | 108 | // 2、先获取用户浏览的SKN对应的品类列表 |
109 | List<String> allProductSkn = new ArrayList<String>(); | 109 | List<String> allProductSkn = new ArrayList<String>(); |
110 | - allProductSkn.addAll(product_skns); | 110 | + allProductSkn.addAll(view_product_skns); |
111 | allProductSkn.addAll(cart_productskns); | 111 | allProductSkn.addAll(cart_productskns); |
112 | + allProductSkn.addAll(collect_product_skns); | ||
112 | 113 | ||
113 | JSONObject sortAndBrandInfo = this.querySknSortAndBrand(allProductSkn); | 114 | JSONObject sortAndBrandInfo = this.querySknSortAndBrand(allProductSkn); |
114 | 115 | ||
115 | // 3、再根据品类和品牌推荐SKN | 116 | // 3、再根据品类和品牌推荐SKN |
116 | - List<String> recommondSkns = this.recommondSknsBySortAndBrandInfo(sortAndBrandInfo, paramMap, product_skns, cart_productskns, collect_product_skns); | 117 | + List<String> recommondSkns = this.recommondSknsBySortAndBrandInfo(sortAndBrandInfo, paramMap, view_product_skns, cart_productskns, collect_product_skns); |
117 | 118 | ||
118 | if (searchCommonHelper.isDebugUser(paramMap)) { | 119 | if (searchCommonHelper.isDebugUser(paramMap)) { |
119 | logger.warn("goodProductList recommondSkns is : [{}]", recommondSkns); | 120 | logger.warn("goodProductList recommondSkns is : [{}]", recommondSkns); |
@@ -235,7 +236,7 @@ public class GoodProductListService implements IGoodProductsService { | @@ -235,7 +236,7 @@ public class GoodProductListService implements IGoodProductsService { | ||
235 | * | 236 | * |
236 | * @return | 237 | * @return |
237 | */ | 238 | */ |
238 | - private List<String> recommondSknsBySortAndBrandInfo(JSONObject sortAndBrandInfo, Map<String, String> paramMap, List<String> product_skns, List<String> cart_productskns, | 239 | + private List<String> recommondSknsBySortAndBrandInfo(JSONObject sortAndBrandInfo, Map<String, String> paramMap, List<String> view_product_skns, List<String> cart_productskns, |
239 | List<String> collect_product_skns) throws Exception { | 240 | List<String> collect_product_skns) throws Exception { |
240 | // 1、获取品牌id和品类id | 241 | // 1、获取品牌id和品类id |
241 | if (sortAndBrandInfo == null || sortAndBrandInfo.isEmpty()) { | 242 | if (sortAndBrandInfo == null || sortAndBrandInfo.isEmpty()) { |
@@ -340,7 +341,7 @@ public class GoodProductListService implements IGoodProductsService { | @@ -340,7 +341,7 @@ public class GoodProductListService implements IGoodProductsService { | ||
340 | this.addListToJsonArray(recommendedSknJSONArray, cart_productskns); | 341 | this.addListToJsonArray(recommendedSknJSONArray, cart_productskns); |
341 | this.addListToJsonArray(recommendedSknJSONArray, collect_product_skns); | 342 | this.addListToJsonArray(recommendedSknJSONArray, collect_product_skns); |
342 | if (cart_productskns.isEmpty() && collect_product_skns.isEmpty()) { | 343 | if (cart_productskns.isEmpty() && collect_product_skns.isEmpty()) { |
343 | - this.addListToJsonArray(recommendedSknJSONArray, product_skns); | 344 | + this.addListToJsonArray(recommendedSknJSONArray, view_product_skns); |
344 | } | 345 | } |
345 | searchCacheService.addJSONArrayToCache(productListSearchCache, indexName, searchParam, recommendedSknJSONArray); | 346 | searchCacheService.addJSONArrayToCache(productListSearchCache, indexName, searchParam, recommendedSknJSONArray); |
346 | return this.jsonArrayToList(recommendedSknJSONArray, String.class); | 347 | return this.jsonArrayToList(recommendedSknJSONArray, String.class); |
-
Please register or login to post a comment