Authored by Lixiaodi

鉴定服务排除品牌等

... ... @@ -12,4 +12,6 @@ public interface BrandMapper {
List<Brand> selectAll();
int updateByPrimaryKey(Brand record);
List<Integer> selectExcludeAppraise();
}
\ No newline at end of file
... ...
... ... @@ -48,4 +48,8 @@
edit_time, edit_pid, order_by
from brand
</select>
<select id="selectExcludeAppraise" resultMap="BaseResultMap">
select id
from brand where ex_raise = 1
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -339,7 +339,7 @@ public class ProductSearchController {
@RequestParam(value = "page", required = false)Integer page,
@RequestParam(value = "app_version", required = false)String appVersion
) {
ProductSearchReq req = new ProductSearchReq().setViewNum(limit).setPage(page).setExcludeLimit("true");
ProductSearchReq req = new ProductSearchReq().setViewNum(limit).setPage(page).setExcludeLimit("Y");
searchHelpService.setQuery(query, req);
//设置是否包含有货商品
LOG.info("in method=ufo.product.search.appraise.list req={}", req.toString());
... ...
... ... @@ -84,6 +84,8 @@ public final class SearchConstants {
String SOON_SALE = "isSoonSale";
String NOT_ID = "not_id";
String NOT_BRAND = "not_brand";
String FILTER_YEAR_MONTH = "filter_year_month";
... ... @@ -95,7 +97,7 @@ public final class SearchConstants {
String RANK_TYPE = "rankType";
String TYPE = "product_type";
String EXCLUDE_LIMIT = "exclude_limit";
String EXCLUDE_LIMIT = "isFilterLimitSale";
}
... ...
... ... @@ -57,7 +57,8 @@ public class SearchParam {
.setContainYoho(req.getContainYoho())
.setRankType(req.getRankType())
.setNotId(req.getNot_id())
.setExcludeLimit(req.getExcludeLimit());
.setExcludeLimit(req.getExcludeLimit())
.setNotBrand(req.getNot_brand());
return this;
}
... ... @@ -70,7 +71,7 @@ public class SearchParam {
.setStartTime(req.getStartTime())
.setEndTime(req.getEndTime())
.setContainYoho(req.getContainYoho())
.setRankType(req.getRankType()).setId(req.getId()).setNotId(req.getNot_id()).setExcludeLimit(req.getExcludeLimit());;
.setRankType(req.getRankType()).setId(req.getId()).setNotId(req.getNot_id()).setExcludeLimit(req.getExcludeLimit()).setNotBrand(req.getNot_brand());
return this;
}
... ... @@ -237,6 +238,13 @@ public class SearchParam {
return this;
}
public SearchParam setNotBrand(String notBrand) {
if (StringUtils.isNotBlank(notBrand)) {
param.put(SearchConstants.IndexNameConstant.NOT_BRAND, notBrand);
}
return this;
}
/**
* 每次查询的条数
*
... ...
... ... @@ -27,6 +27,7 @@ public class ProductSearchReq {
private String rankType;
private String couponToken;
private String excludeLimit;
private String not_brand;
@Override
public String toString() {
... ... @@ -256,6 +257,15 @@ public class ProductSearchReq {
return this;
}
public ProductSearchReq setNotBrand(String notBrand) {
this.not_brand = notBrand;
return this;
}
public String getNot_brand() {
return not_brand;
}
public String getExcludeLimit() {
return excludeLimit;
}
... ...
... ... @@ -13,6 +13,7 @@ import java.util.stream.Collectors;
import com.yohobuy.ufo.model.promotion.response.CouponInfo;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.dal.product.BrandMapper;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
... ... @@ -72,6 +73,9 @@ public class ProductSearchServiceImpl implements ProductSearchService {
private ProductSortMapper productSortMapper;
@Autowired
private BrandMapper brandMapper;
@Autowired
ProductSalesService productSalesService;
@Autowired
... ... @@ -183,6 +187,7 @@ public class ProductSearchServiceImpl implements ProductSearchService {
@Override
public JSONObject searchAppraiseProductList(ProductSearchReq req) {
req.setNotBrand(StringUtils.join(brandMapper.selectExcludeAppraise(), ","))
SearchParam searchParam = new SearchParam().buildPageSearchParam(req);
String url = PRODUCT_SEARCH_QUERY_URL;
JSONObject data = search(searchParam.getParam(), url);
... ...