...
|
...
|
@@ -81,9 +81,6 @@ public class ProductSearchServiceImpl implements ProductSearchService { |
|
|
private BrandMapper brandMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private ProductMapper productMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private ConfigReader configReader;
|
|
|
|
|
|
@Autowired
|
...
|
...
|
@@ -154,16 +151,19 @@ public class ProductSearchServiceImpl implements ProductSearchService { |
|
|
req.setId(info.getContainsProductIds());
|
|
|
req.setNot_id(info.getExcludeProductIds());
|
|
|
logger.info("contains {} ex {}",info.getContainsProductIds(), info.getExcludeProductIds());
|
|
|
searchParam = new SearchParam().buildPageSearchParam(req);
|
|
|
searchParam = new SearchParam().buildPageSearchParam(req).setShowChannel(req.getBusinessClient());
|
|
|
} else if (StringUtils.equals("Y", req.getIsSoonSale())) {
|
|
|
url = ProductSearchConstants.SOON_SALE_PRODUCT_LIST_URL;
|
|
|
} else if (StringUtils.equals("Y", req.getIsIdFilter())) {
|
|
|
url = ProductSearchConstants.FAVORITE_PRODUCT_LIST_URL;
|
|
|
} else if (StringUtils.isNotBlank(req.getQuery())
|
|
|
|| (req.getSearchType() != null && req.getSearchType() == 6)) {
|
|
|
|
|
|
searchParam.setShowChannel(req.getBusinessClient());
|
|
|
url = ProductSearchConstants.PRODUCT_SEARCH_QUERY_URL;
|
|
|
} else if (StringUtils.isNotBlank(req.getPool())
|
|
|
|| (req.getSearchType() != null && (req.getSearchType() == 0 || req.getSearchType() == 1))) {
|
|
|
searchParam.setShowChannel(req.getBusinessClient());
|
|
|
url = ProductSearchConstants.PRODUCT_POOL_URL;
|
|
|
}
|
|
|
JSONObject data = search(searchParam.getParam(), url);
|
...
|
...
|
@@ -251,7 +251,7 @@ public class ProductSearchServiceImpl implements ProductSearchService { |
|
|
req.setId(info.getContainsProductIds());
|
|
|
req.setNot_id(info.getExcludeProductIds());
|
|
|
}
|
|
|
SearchParam searchParam = new SearchParam().buildSearchParam(req);
|
|
|
SearchParam searchParam = new SearchParam().buildSearchParam(req).setShowChannel(req.getBusinessClient());;
|
|
|
/*if (req.getMaxSort() == null && req.getMidSort() == null) {
|
|
|
searchParam.setXianYuSort(req.getBusinessClient(), configReader);
|
|
|
}*/
|
...
|
...
|
@@ -354,7 +354,7 @@ public class ProductSearchServiceImpl implements ProductSearchService { |
|
|
@Override
|
|
|
public SearchBrandListResp searchBrandList(String businessClient) {
|
|
|
SearchBrandListResp resp = new SearchBrandListResp();
|
|
|
SearchParam searchParam = new SearchParam();
|
|
|
SearchParam searchParam = new SearchParam().setShowChannel(businessClient);
|
|
|
//searchParam.setXianYuSort(businessClient, configReader); //闲鱼改成全品类 如果是闲鱼请求,则设置大品类
|
|
|
|
|
|
JSONObject data = search(searchParam.getParam(), ProductSearchConstants.BRAND_LIST_URL);
|
...
|
...
|
@@ -374,7 +374,7 @@ public class ProductSearchServiceImpl implements ProductSearchService { |
|
|
@Override
|
|
|
public SearchProductRecommendResp searchProductRecommendById(Integer productId, String businessClient) {
|
|
|
SearchProductRecommendResp resp = new SearchProductRecommendResp();
|
|
|
Product product = productMapper.selectByPrimaryKey(productId);
|
|
|
Product product = productHelpService.selectByIdCache(productId);
|
|
|
if (product != null) {
|
|
|
ProductSearchReq req = new ProductSearchReq().setNot_id(productId + "").setMidSort(product.getMidSortId() + "").setBrand(product.getBrandId() + "").setQuery(product.getProductName());
|
|
|
SearchParam searchParam = new SearchParam().buildSearchParam(req);
|
...
|
...
|
@@ -531,7 +531,7 @@ public class ProductSearchServiceImpl implements ProductSearchService { |
|
|
@Override
|
|
|
public JSONObject searchHotSale(Integer page, Integer limit, String businessClient) {
|
|
|
ProductSearchReq req = new ProductSearchReq().setViewNum(limit).setPage(page);
|
|
|
SearchParam searchParam = new SearchParam().buildPageSearchParam(req);
|
|
|
SearchParam searchParam = new SearchParam().buildPageSearchParam(req).setShowChannel(businessClient);
|
|
|
JSONObject data = search(searchParam.getParam(), ProductSearchConstants.HOT_SALE_LIST_URL);
|
|
|
// 将图片的相对路径转成绝对路径
|
|
|
if (null != data) {
|
...
|
...
|
@@ -546,7 +546,7 @@ public class ProductSearchServiceImpl implements ProductSearchService { |
|
|
if (REGULARIZE_NFC.equals(regularize)) { // NFC分享页列表 需要返回18个商品
|
|
|
req.setViewNum(18);
|
|
|
}
|
|
|
SearchParam searchParam = new SearchParam().buildPageSearchParam(req);
|
|
|
SearchParam searchParam = new SearchParam().buildPageSearchParam(req).setShowChannel(req.getBusinessClient());
|
|
|
String url = ProductSearchConstants.PRODUCT_UVSCORE_LIST_URL;
|
|
|
JSONObject data = search(searchParam.getParam(), url);
|
|
|
// 将图片的相对路径转成绝对路径
|
...
|
...
|
@@ -574,7 +574,7 @@ public class ProductSearchServiceImpl implements ProductSearchService { |
|
|
if(null != product.getSeriesId() && product.getSeriesId().intValue() != 0) {
|
|
|
req.setSeries(product.getSeriesId() + "");
|
|
|
}
|
|
|
SearchParam searchParam = new SearchParam().buildSearchParam(req);
|
|
|
SearchParam searchParam = new SearchParam().buildSearchParam(req).setShowChannel(businessClient);
|
|
|
|
|
|
JSONObject data = search(searchParam.getParam(), ProductSearchConstants.PRODUCT_RECOMMEND_BY_SERIESBRAND_LIST_URL);
|
|
|
if(data != null && !CollectionUtils.isEmpty(data.getJSONArray("product_list"))) {
|
...
|
...
|
@@ -594,7 +594,7 @@ public class ProductSearchServiceImpl implements ProductSearchService { |
|
|
|
|
|
@Override
|
|
|
public JSONObject searchSecondhandSkupList(ProductSearchReq req) {
|
|
|
SearchParam searchParam = new SearchParam().buildPageSearchParam(req);
|
|
|
SearchParam searchParam = new SearchParam().buildPageSearchParam(req).setShowChannel(req.getBusinessClient());
|
|
|
String url = ProductSearchConstants.SECONDHAND_SKUP_QUERY_URL;
|
|
|
JSONObject data = search(searchParam.getParam(), url);
|
|
|
// 将图片的相对路径转成绝对路径
|
...
|
...
|
|