Authored by wangnan9279

Merge branch 'wn_ufo_jianding' into 0920

... ... @@ -158,7 +158,6 @@ public class SearchRequestParams {
public static final String SHOPS_PARAM_STATUS = "status";
//ImageRepertory index param
public static final String IMAGEREPERTORY_PARAM_ID = "id";
public static final String IMAGEREPERTORY_PARAM_ITEMID = "itemId";
... ... @@ -185,6 +184,7 @@ public class SearchRequestParams {
public static final String UFOPRODUCTINDEX_PARAM_MIDSORT = "midSort";
public static final String UFOPRODUCTINDEX_PARAM_GENDER = "gender";
public static final String UFOPRODUCTINDEX_PARAM_BRAND = "brand";
public static final String UFOPRODUCTINDEX_PARAM_NOT_BRAND = "not_brand";
public static final String UFOPRODUCTINDEX_PARAM_SERIES = "series";
public static final String UFOPRODUCTINDEX_PARAM_SIZE = "size";
public static final String UFOPRODUCTINDEX_PARAM_COLOR = "color";
... ... @@ -202,5 +202,8 @@ public class SearchRequestParams {
public static final String UFO_PARAM_RANK_TYPE = "rankType";
// ufo发售日历 商品类型
public static final String UFO_PARAM_SEARCH_SALE_CALENDAR_PRODUCT_TYPE = "product_type";
// ufo过滤独家商品 ufo鉴定服务用
public static final String UFO_PARAM_SEARCH_IS_FILTER_LIMIT_SALE = "isFilterLimitSale";
}
... ...
... ... @@ -202,6 +202,17 @@ public class SearchCommonHelper {
}
/**
* 判断UFO搜索是否需要包含独家商品
*/
public boolean filterUfoLimitSale(Map<String, String> paramMap) {
if (paramMap.containsKey(SearchRequestParams.UFO_PARAM_SEARCH_IS_FILTER_LIMIT_SALE) && "Y".equals(paramMap.get(SearchRequestParams.UFO_PARAM_SEARCH_IS_FILTER_LIMIT_SALE))) {
return true;
}
return false;
}
/**
* 当前查询的关键字是否是skn
*
* @param keyword
... ... @@ -423,7 +434,6 @@ public class SearchCommonHelper {
/**
* 获取参数中的销售类目参数-仅支持一个
*
*
* @param paramMap
* @return
*/
... ...
... ... @@ -67,6 +67,7 @@ public class UfoSearchQueryHelper extends BaseService {
this.addMustIntTermsQuery(boolFilter, paramMap, SearchRequestParams.UFOPRODUCTINDEX_PARAM_MIDSORT, UfoProductIndexEsField.midSortId);
this.addMustIntTermsQuery(boolFilter, paramMap, SearchRequestParams.UFOPRODUCTINDEX_PARAM_GENDER, UfoProductIndexEsField.gender);
this.addMustIntTermsQuery(boolFilter, paramMap, SearchRequestParams.UFOPRODUCTINDEX_PARAM_BRAND, UfoProductIndexEsField.brandId);
this.addMustNotIntTermsQuery(boolFilter, paramMap, SearchRequestParams.UFOPRODUCTINDEX_PARAM_NOT_BRAND, UfoProductIndexEsField.brandId);
this.addMustIntTermsQuery(boolFilter, paramMap, SearchRequestParams.UFOPRODUCTINDEX_PARAM_SERIES, UfoProductIndexEsField.seriesId);
this.addMustIntTermsQuery(boolFilter, paramMap, SearchRequestParams.UFOPRODUCTINDEX_PARAM_SIZE, UfoProductIndexEsField.sizeIds);
this.addMustIntTermsQuery(boolFilter, paramMap, SearchRequestParams.UFOPRODUCTINDEX_PARAM_COLOR, UfoProductIndexEsField.colorIds);
... ... @@ -77,6 +78,11 @@ public class UfoSearchQueryHelper extends BaseService {
boolFilter.mustNot(QueryBuilders.termQuery(UfoProductIndexEsField.isYoho, "Y"));
}
//是否要过滤独家商品
if (searchCommonHelper.filterUfoLimitSale(paramMap)) {
boolFilter.mustNot(QueryBuilders.termQuery(UfoProductIndexEsField.isLimitSale, "Y"));
}
//硬过滤[有货无库存的商品,delStatus会设置为1]
boolFilter.must(QueryBuilders.termQuery(UfoProductIndexEsField.delStatus, 0));
boolFilter.must(QueryBuilders.termQuery(UfoProductIndexEsField.shelveStatus, 1));
... ...