...
|
...
|
@@ -9,6 +9,7 @@ import java.util.List; |
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
|
|
|
import com.yoho.search.service.helper.SearchCommonHelper;
|
|
|
import org.apache.commons.collections.MapUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
...
|
...
|
@@ -48,6 +49,8 @@ public class SortRecallSceneService extends AbstractRecallService { |
|
|
private RecallServiceHelper recallServiceHelper;
|
|
|
@Autowired
|
|
|
private RecallPersionalHelper recallPersionalHelper;
|
|
|
@Autowired
|
|
|
private SearchCommonHelper searchCommonHelper;
|
|
|
|
|
|
@SearchCacheAble(cacheInMinute = 10, cacheName = "SORT_PAGE_PRODUCT_LIST")
|
|
|
public SearchApiResult recallProductList(Map<String, String> paramMap) {
|
...
|
...
|
@@ -56,8 +59,8 @@ public class SortRecallSceneService extends AbstractRecallService { |
|
|
recallServiceHelper.setLogEnableThreadLocal(paramMap);
|
|
|
|
|
|
// 1)验证查询条数
|
|
|
int page = recallServiceHelper.getPage(paramMap);
|
|
|
int pageSize = recallServiceHelper.getPageSize(paramMap);
|
|
|
int page = searchCommonHelper.getPage(paramMap);
|
|
|
int pageSize = searchCommonHelper.getPageSize(paramMap);
|
|
|
|
|
|
// 2)召回skn以及总数
|
|
|
RecallProductSknList recallProductSknList = recallServiceHelper.doRecallProductSkns(paramMap, this);
|
...
|
...
|
@@ -73,7 +76,7 @@ public class SortRecallSceneService extends AbstractRecallService { |
|
|
dataMap.put("total", recallProductInfoList.getTotal());
|
|
|
dataMap.put("page", page);
|
|
|
dataMap.put("page_size", pageSize);
|
|
|
dataMap.put("page_total", recallServiceHelper.getTotalPage(recallProductInfoList.getTotal(), pageSize));
|
|
|
dataMap.put("page_total", searchCommonHelper.getTotalPage(recallProductInfoList.getTotal(), pageSize));
|
|
|
dataMap.put("product_list", product_list);
|
|
|
return new SearchApiResult().setData(dataMap);
|
|
|
} catch (Exception e) {
|
...
|
...
|
@@ -96,7 +99,7 @@ public class SortRecallSceneService extends AbstractRecallService { |
|
|
// 0、获取用户偏好品牌
|
|
|
UserLikeBrands userLikeBrands = recallPersionalHelper.getSortPageUserLikeBrands(paramMap);
|
|
|
|
|
|
int pageSize = recallServiceHelper.getPageSize(paramMap);
|
|
|
int pageSize = searchCommonHelper.getPageSize(paramMap);
|
|
|
// 1、支持firstProductSkn的召回
|
|
|
recallStrategy.add(new FirstProductSknStrategy(1, recallServiceHelper.getFirstProductSkns(paramMap)));
|
|
|
// 2、支持直通车的召回-随机召回
|
...
|
...
|
@@ -218,7 +221,7 @@ public class SortRecallSceneService extends AbstractRecallService { |
|
|
iterator.remove();
|
|
|
}
|
|
|
// 4、数量截取-保留整数页个商品[只能召回一页,则保留一页]
|
|
|
int pageSize = recallServiceHelper.getPageSize(paramMap);
|
|
|
int pageSize = searchCommonHelper.getPageSize(paramMap);
|
|
|
int count = newProductList.size();
|
|
|
int maxPage = count / pageSize;
|
|
|
if (maxPage == 0) {
|
...
|
...
|
|