Authored by mali

Merge branch 'hotfix_copou_list' into test6.9.16

Conflicts:
	product/src/main/java/com/yohoufo/product/request/ProductSearchReq.java
	product/src/main/java/com/yohoufo/product/service/impl/ProductSearchServiceImpl.java
package com.yohoufo.product.request;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.builder.ToStringBuilder;
public class ProductSearchReq {
... ... @@ -33,29 +34,7 @@ public class ProductSearchReq {
@Override
public String toString() {
return new ToStringBuilder(this)
.append("page", page)
.append("order", order)
.append("gender", gender)
.append("viewNum", viewNum)
.append("brand", brand)
.append("size", size)
.append("query", query)
.append("maxSort", maxSort)
.append("midSort", midSort)
.append("series", series)
.append("pool", pool)
.append("isSoonSale", isSoonSale)
.append("not_id", not_id)
.append("id", id)
.append("isIdFilter", isIdFilter)
.append("filterYearMonth",filterYearMonth)
.append("startTime",startTime)
.append("endTime",endTime)
.append("contain_yoho",containYoho)
.append("businessClient",businessClient)
.append("preSaleFlag", preSaleFlag)
.toString();
return JSONObject.toJSONString(this);
}
... ...
... ... @@ -107,7 +107,7 @@ public class ProductSearchServiceImpl implements ProductSearchService {
}
req.setId(info.getContainsProductIds());
req.setNot_id(info.getExcludeProductIds());
logger.info("contains {} ex {}",info.getContainsProductIds(), info.getExcludeProductIds());
//logger.info("contains {} ex {}",info.getContainsProductIds(), info.getExcludeProductIds());
searchParam = new SearchParam().buildPageSearchParam(req).setShowChannel(req.getBusinessClient());
} else if (StringUtils.equals("Y", req.getIsSoonSale())) {
url = ProductSearchConstants.SOON_SALE_PRODUCT_LIST_URL;
... ... @@ -562,6 +562,17 @@ public class ProductSearchServiceImpl implements ProductSearchService {
private CouponInfo getCouponInfo(String token) {
ApiResponse resp = ufoServiceCaller.call("ufo.coupons.getProductIds", ApiResponse.class, token);
return (CouponInfo) resp.getData();
CouponInfo couponInfo = (CouponInfo) resp.getData();
// 如果券包含的商品列表、排除的商品列表太多,则调用搜索的时候会报参数链接太长,所以这里进行截取
if (StringUtils.isNotEmpty(couponInfo.getContainsProductIds())
&& couponInfo.getContainsProductIds().length() > 1800) {
couponInfo.setContainsProductIds(couponInfo.getContainsProductIds().substring(0, 1800));
}
if (StringUtils.isNotEmpty(couponInfo.getExcludeProductIds())
&& couponInfo.getExcludeProductIds().length() > 1800) {
couponInfo.setExcludeProductIds(couponInfo.getExcludeProductIds().substring(0, 1800));
}
return couponInfo;
}
}
... ...