...
|
...
|
@@ -110,7 +110,7 @@ public class UfoProductListService { |
|
|
return new SearchApiResult().setCode(400).setMessage("参数不合法,缺少必传参数");
|
|
|
}
|
|
|
//第一次查询
|
|
|
paramMap.put("viewNum", "1000");
|
|
|
paramMap.put("viewNum", "100");
|
|
|
SearchApiResult searchApiResult = this.productList(paramMap);
|
|
|
if (searchApiResult.getData() == null) {
|
|
|
return new SearchApiResult().setData(null).setCode(500);
|
...
|
...
|
@@ -123,20 +123,13 @@ public class UfoProductListService { |
|
|
Set<Integer> idList = new HashSet<>();
|
|
|
if (returnInfoList.size() < RECOMMEND_LIMIT) {
|
|
|
returnInfoList.stream().map(p -> MapUtils.getIntValue(p, "id")).forEach(id -> idList.add(id));
|
|
|
//可能的第二次查询
|
|
|
paramMap = new HashMap<>();
|
|
|
paramMap.put("brand", brandId.toString());
|
|
|
paramMap.put("midSort", midSortId.toString());
|
|
|
paramMap.put("not_id", not_id.toString());
|
|
|
paramMap.put("viewNum", "1000");
|
|
|
//可能的第二次查询,去掉query去查
|
|
|
paramMap.remove("query");
|
|
|
this.addReturnInfoList(paramMap, idList, returnInfoList);
|
|
|
}
|
|
|
if (returnInfoList.size() < RECOMMEND_LIMIT) {
|
|
|
//可能的第三次查询
|
|
|
paramMap = new HashMap<>();
|
|
|
paramMap.put("brand", brandId.toString());
|
|
|
paramMap.put("viewNum", "1000");
|
|
|
paramMap.put("not_id", not_id.toString());
|
|
|
//可能的第三次查询,去掉中分类去查
|
|
|
paramMap.remove("midSort");
|
|
|
this.addReturnInfoList(paramMap, idList, returnInfoList);
|
|
|
}
|
|
|
dataMap.put("total", returnInfoList.size());
|
...
|
...
|
@@ -168,7 +161,7 @@ public class UfoProductListService { |
|
|
|
|
|
public SearchApiResult productListForPlatform(Map<String, String> paramMap) {
|
|
|
try {
|
|
|
// 2. 构建SearchParam
|
|
|
// 构建SearchParam
|
|
|
SearchParam searchParam = new SearchParam();
|
|
|
searchParam.setQuery(QueryBuilders.matchAllQuery());
|
|
|
BoolQueryBuilder boolFilter = ufoSearchQueryHelper.constructFilterBuilderForPlatform(paramMap, null);
|
...
|
...
|
|