Authored by 胡古飞

fix

... ... @@ -11,6 +11,7 @@ import com.yoho.search.service.service.SearchCommonService;
import com.yoho.search.service.service.SearchDynamicConfigService;
import com.yoho.search.service.service.SearchKeyWordService;
import com.yoho.search.service.utils.SearchRequestParams;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.elasticsearch.index.query.*;
... ... @@ -337,8 +338,8 @@ public class SearchServiceHelper {
}
// 促销标记
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISPROMOTION) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISPROMOTION))) {
int[] ispromotions = ConvertUtils.stringToIntArray(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISPROMOTION),",");
boolFilter.must(QueryBuilders.termsQuery("ispromotion",ispromotions));
int[] ispromotions = ConvertUtils.stringToIntArray(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISPROMOTION), ",");
boolFilter.must(QueryBuilders.termsQuery("ispromotion", ispromotions));
}
// vip折扣类型
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_VIPDISCOUNTTYPE) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_VIPDISCOUNTTYPE))) {
... ... @@ -382,6 +383,17 @@ public class SearchServiceHelper {
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISLIMITED) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISLIMITED))) {
boolFilter.must(QueryBuilders.termQuery("islimited", paramMap.get(SearchRequestParams.PARAM_SEARCH_ISLIMITED)));
}
// 是否限购
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISLIMITEDBUY) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISLIMITEDBUY))) {
boolFilter.must(QueryBuilders.termQuery("isLimitbuy", paramMap.get(SearchRequestParams.PARAM_SEARCH_ISLIMITEDBUY)));
}
// 是否预售
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISADVANCE) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISADVANCE))) {
boolFilter.must(QueryBuilders.termQuery("isAdvance", paramMap.get(SearchRequestParams.PARAM_SEARCH_ISADVANCE)));
}// 是否定金预售
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISDESPOSITADVANCE) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISDESPOSITADVANCE))) {
boolFilter.must(QueryBuilders.termQuery("isDepositAdvance", paramMap.get(SearchRequestParams.PARAM_SEARCH_ISDESPOSITADVANCE)));
}
// 是否新品
if (paramMap.containsKey(SearchRequestParams.PARAM_SEARCH_ISNEW) && StringUtils.isNotBlank(paramMap.get(SearchRequestParams.PARAM_SEARCH_ISNEW))) {
boolFilter.must(QueryBuilders.termQuery("isnew", paramMap.get(SearchRequestParams.PARAM_SEARCH_ISNEW)));
... ... @@ -673,7 +685,6 @@ public class SearchServiceHelper {
productMap.put("small_sort_id", map.get("smallSortId"));
productMap.put("max_sort_id", map.get("maxSortId"));
productMap.put("is_discount", map.get("isDiscount"));
productMap.put("is_advance", map.get("isAdvance"));
productMap.put("is_soon_sold_out", map.get("isSoonSoldOut"));
productMap.put("edit_time", map.get("editTime"));
productMap.put("shelve_time", map.get("shelveTime"));
... ... @@ -702,7 +713,7 @@ public class SearchServiceHelper {
productMap.put("is_student_rebate", map.get("isstudentrebate") == null ? "N" : map.get("isstudentrebate"));
// 年龄层,逗号隔开的字符串
productMap.put("age_level", map.get("ageLevel") == null ? "" : map.get("ageLevel"));
// 是否是全球购商品
productMap.put("is_global", map.get("isGlobal") == null ? "N" : map.get("isGlobal"));
Integer tbl_country_id = 0;
... ... @@ -712,7 +723,7 @@ public class SearchServiceHelper {
}
productMap.put("tbl_country_id", tbl_country_id);
productMap.put("tbl_country_name", map.get("tblCountryName"));
String tbl_plane = (tbl_country_id !=null && tbl_country_id!=86) ? "Y" : "N";
String tbl_plane = (tbl_country_id != null && tbl_country_id != 86) ? "Y" : "N";
productMap.put("tbl_plane", tbl_plane);
return productMap;
}
... ...
... ... @@ -24,6 +24,12 @@ public class SearchRequestParams {
public static final String PARAM_SEARCH_ISNEW = "new"; // 查询是否新品
public static final String PARAM_SEARCH_ISOUTLETS = "outlets"; // 查询是否奥莱
public static final String PARAM_SEARCH_ISLIMITED = "limited"; // 查询是否限量
public static final String PARAM_SEARCH_ISLIMITEDBUY = "isLimitbuy"; // 查询是否限购
public static final String PARAM_SEARCH_ISADVANCE = "isAdvance"; // 查询是否预售
public static final String PARAM_SEARCH_ISDESPOSITADVANCE = "isDepositAdvance"; // 查询是否定金预售
public static final String PARAM_SEARCH_SPECIALOFFER = "specialoffer"; // ◆是否为促销品
public static final String PARAM_SEARCH_ISSALES = "sales"; // ◆查询是否销售(有货不销售)
public static final String PARAM_SEARCH_ISPROMOTION = "promotion"; // 特价类型
... ...