...
|
...
|
@@ -27,6 +27,29 @@ public class SceneRecommendBrandsService { |
|
|
@Autowired
|
|
|
private UserPersionalFactorComponent userPersionalFactorComponent;
|
|
|
|
|
|
public void getRecommendBrands(Map<String, String> paramMap, SearchApiResult result) {
|
|
|
getRecommendBrands(paramMap, result, null);
|
|
|
}
|
|
|
|
|
|
public void getRecommendBrands(Map<String, String> paramMap, SearchApiResult result, BoolQueryBuilder extFilter) {
|
|
|
if (result != null && result.getData() != null) {
|
|
|
JSONObject data = (JSONObject) result.getData();
|
|
|
JSONObject commonFilters = data.getJSONObject("filter");
|
|
|
if (commonFilters != null) {
|
|
|
getRecommendBrandsNew(commonFilters, paramMap);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void getRecommendBrandsNew(JSONObject commonFilters, Map<String, String> paramMap) {
|
|
|
JSONArray recommendBrands = new JSONArray();
|
|
|
JSONArray brandList = commonFilters.getJSONArray("brand");
|
|
|
if (!CollectionUtils.isEmpty(brandList)) {
|
|
|
recommendBrands = getRecommendBrands(paramMap, brandList);
|
|
|
}
|
|
|
commonFilters.put("recommendBrand", recommendBrands);
|
|
|
}
|
|
|
|
|
|
private JSONArray getRecommendBrands(Map<String, String> paramMap, JSONArray brandList) {
|
|
|
List<JSONObject> brandListTemp = JSON.parseObject(brandList.toJSONString(), new TypeReference<List<JSONObject>>() {
|
|
|
});
|
...
|
...
|
@@ -68,26 +91,4 @@ public class SceneRecommendBrandsService { |
|
|
return recBrands;
|
|
|
}
|
|
|
|
|
|
public void getRecommendBrands(Map<String, String> paramMap, SearchApiResult result) {
|
|
|
getRecommendBrands(paramMap, result, null);
|
|
|
}
|
|
|
|
|
|
public void getRecommendBrands(Map<String, String> paramMap, SearchApiResult result, BoolQueryBuilder extFilter) {
|
|
|
if (result != null && result.getData() != null) {
|
|
|
JSONObject data = (JSONObject) result.getData();
|
|
|
JSONObject commonFilters = data.getJSONObject("filter");
|
|
|
if (commonFilters != null) {
|
|
|
getRecommendBrandsNew(commonFilters, paramMap);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void getRecommendBrandsNew(JSONObject commonFilters, Map<String, String> paramMap) {
|
|
|
JSONArray recommendBrands = new JSONArray();
|
|
|
JSONArray brandList = commonFilters.getJSONArray("brand");
|
|
|
if (!CollectionUtils.isEmpty(brandList)) {
|
|
|
recommendBrands = getRecommendBrands(paramMap, brandList);
|
|
|
}
|
|
|
commonFilters.put("recommendBrand", recommendBrands);
|
|
|
}
|
|
|
} |
...
|
...
|
|