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
1 package com.yohoufo.product.request; 1 package com.yohoufo.product.request;
2 2
  3 +import com.alibaba.fastjson.JSONObject;
3 import org.apache.commons.lang3.builder.ToStringBuilder; 4 import org.apache.commons.lang3.builder.ToStringBuilder;
4 5
5 public class ProductSearchReq { 6 public class ProductSearchReq {
@@ -33,29 +34,7 @@ public class ProductSearchReq { @@ -33,29 +34,7 @@ public class ProductSearchReq {
33 34
34 @Override 35 @Override
35 public String toString() { 36 public String toString() {
36 - return new ToStringBuilder(this)  
37 - .append("page", page)  
38 - .append("order", order)  
39 - .append("gender", gender)  
40 - .append("viewNum", viewNum)  
41 - .append("brand", brand)  
42 - .append("size", size)  
43 - .append("query", query)  
44 - .append("maxSort", maxSort)  
45 - .append("midSort", midSort)  
46 - .append("series", series)  
47 - .append("pool", pool)  
48 - .append("isSoonSale", isSoonSale)  
49 - .append("not_id", not_id)  
50 - .append("id", id)  
51 - .append("isIdFilter", isIdFilter)  
52 - .append("filterYearMonth",filterYearMonth)  
53 - .append("startTime",startTime)  
54 - .append("endTime",endTime)  
55 - .append("contain_yoho",containYoho)  
56 - .append("businessClient",businessClient)  
57 - .append("preSaleFlag", preSaleFlag)  
58 - .toString(); 37 + return JSONObject.toJSONString(this);
59 } 38 }
60 39
61 40
@@ -107,7 +107,7 @@ public class ProductSearchServiceImpl implements ProductSearchService { @@ -107,7 +107,7 @@ public class ProductSearchServiceImpl implements ProductSearchService {
107 } 107 }
108 req.setId(info.getContainsProductIds()); 108 req.setId(info.getContainsProductIds());
109 req.setNot_id(info.getExcludeProductIds()); 109 req.setNot_id(info.getExcludeProductIds());
110 - logger.info("contains {} ex {}",info.getContainsProductIds(), info.getExcludeProductIds()); 110 + //logger.info("contains {} ex {}",info.getContainsProductIds(), info.getExcludeProductIds());
111 searchParam = new SearchParam().buildPageSearchParam(req).setShowChannel(req.getBusinessClient()); 111 searchParam = new SearchParam().buildPageSearchParam(req).setShowChannel(req.getBusinessClient());
112 } else if (StringUtils.equals("Y", req.getIsSoonSale())) { 112 } else if (StringUtils.equals("Y", req.getIsSoonSale())) {
113 url = ProductSearchConstants.SOON_SALE_PRODUCT_LIST_URL; 113 url = ProductSearchConstants.SOON_SALE_PRODUCT_LIST_URL;
@@ -562,6 +562,17 @@ public class ProductSearchServiceImpl implements ProductSearchService { @@ -562,6 +562,17 @@ public class ProductSearchServiceImpl implements ProductSearchService {
562 562
563 private CouponInfo getCouponInfo(String token) { 563 private CouponInfo getCouponInfo(String token) {
564 ApiResponse resp = ufoServiceCaller.call("ufo.coupons.getProductIds", ApiResponse.class, token); 564 ApiResponse resp = ufoServiceCaller.call("ufo.coupons.getProductIds", ApiResponse.class, token);
565 - return (CouponInfo) resp.getData(); 565 + CouponInfo couponInfo = (CouponInfo) resp.getData();
  566 +
  567 + // 如果券包含的商品列表、排除的商品列表太多,则调用搜索的时候会报参数链接太长,所以这里进行截取
  568 + if (StringUtils.isNotEmpty(couponInfo.getContainsProductIds())
  569 + && couponInfo.getContainsProductIds().length() > 1800) {
  570 + couponInfo.setContainsProductIds(couponInfo.getContainsProductIds().substring(0, 1800));
  571 + }
  572 + if (StringUtils.isNotEmpty(couponInfo.getExcludeProductIds())
  573 + && couponInfo.getExcludeProductIds().length() > 1800) {
  574 + couponInfo.setExcludeProductIds(couponInfo.getExcludeProductIds().substring(0, 1800));
  575 + }
  576 + return couponInfo;
566 } 577 }
567 } 578 }