Authored by hugufei

商品详情页添加年龄层Id的返回

... ... @@ -357,19 +357,19 @@ public class SearchServiceHelper {
String sknString = paramMap.get(ISearchConstans.PARAM_SYNC_SKN);
boolFilter.must(FilterBuilders.termsFilter("productSkn", sknString.split(",")));
}
// 年龄层
if (paramMap.containsKey(ISearchConstans.PARAM_SEARCH_AGELEVEL) && StringUtils.isNotBlank(paramMap.get(ISearchConstans.PARAM_SEARCH_AGELEVEL))
&& !ISearchConstans.PARAM_SEARCH_AGELEVEL.equals(filterParamName)) {
int[] ageLevels = ConvertUtils.stringToIntArray(paramMap.get(ISearchConstans.PARAM_SEARCH_AGELEVEL), ",");
boolFilter.must(FilterBuilders.termsFilter("ageLevel", ageLevels));
}
// 如果contain_global!=Y,则过滤掉全球购的商品[全球购商品融合需求]
if (!paramMap.containsKey("contain_global") || !"Y".equals(paramMap.get("contain_global")) || !ISearchConstans.TPL_ADAPTOR_VALID) {
boolFilter.mustNot(FilterBuilders.termsFilter("isGlobal", "Y"));
}
// 通用的过滤请求
for (String key : paramMap.keySet()) {
if (key.startsWith("not_")) {
... ... @@ -405,7 +405,7 @@ public class SearchServiceHelper {
}
return pageList;
}
@SuppressWarnings("unchecked")
public Map<String, Object> getProductMap(Map<String, Object> map) {
Map<String, Object> productMap = new HashMap<String, Object>();
... ... @@ -455,6 +455,9 @@ public class SearchServiceHelper {
// 是否是全球购商品
productMap.put("is_global", map.get("isGlobal") == null ? "N" : map.get("isGlobal"));
// 年龄层,逗号隔开的字符串
productMap.put("age_level", map.get("ageLevel") == null ? "" : map.get("ageLevel"));
return productMap;
}
... ...