Authored by csgyoho

Merge branch 'dev' of http://git.yoho.cn/ufo/yohoufo-fore into dev

@@ -153,7 +153,7 @@ public class ProductController { @@ -153,7 +153,7 @@ public class ProductController {
153 public ApiResponse setDepotNum( 153 public ApiResponse setDepotNum(
154 @RequestParam(value = "skup", required = true) Integer skup, 154 @RequestParam(value = "skup", required = true) Integer skup,
155 @RequestParam(value = "depotNum", required = true) Integer depotNum) { 155 @RequestParam(value = "depotNum", required = true) Integer depotNum) {
156 - LOG.info("in method=ufo.product.cancelSaleSkup skup={}, depotNum={}", skup, depotNum); 156 + LOG.info("in method=ufo.product.setDepotNum skup={}, depotNum={}", skup, depotNum);
157 try { 157 try {
158 productService.setDepotNum(skup, depotNum); 158 productService.setDepotNum(skup, depotNum);
159 return new ApiResponse(200, "设置成功!", Boolean.TRUE); 159 return new ApiResponse(200, "设置成功!", Boolean.TRUE);
@@ -169,7 +169,7 @@ public class ProductController { @@ -169,7 +169,7 @@ public class ProductController {
169 public ApiResponse saleSkup( 169 public ApiResponse saleSkup(
170 @RequestParam(value = "product_id", required = true) Integer productId, 170 @RequestParam(value = "product_id", required = true) Integer productId,
171 @RequestParam(value = "skup", required = true) Integer skup) { 171 @RequestParam(value = "skup", required = true) Integer skup) {
172 - LOG.info("in method=ufo.product.createSkup productId = {}, skup={}", productId, skup); 172 + LOG.info("in method=ufo.product.saleSkup productId = {}, skup={}", productId, skup);
173 try { 173 try {
174 productService.saleSkup(productId, skup); 174 productService.saleSkup(productId, skup);
175 LOG.info("saleSkup success and async clearProductCache skup = {}", skup); 175 LOG.info("saleSkup success and async clearProductCache skup = {}", skup);
@@ -38,6 +38,7 @@ public class ProductSearchController { @@ -38,6 +38,7 @@ public class ProductSearchController {
38 public ApiResponse searchProductList( 38 public ApiResponse searchProductList(
39 @RequestParam(value = "type", required = false)Integer type, 39 @RequestParam(value = "type", required = false)Integer type,
40 @RequestParam(value = "order", required = false)String order, 40 @RequestParam(value = "order", required = false)String order,
  41 + @RequestParam(value = "product_id", required = false)String id,
41 @RequestParam(value = "productPool", required = false) String productPool, 42 @RequestParam(value = "productPool", required = false) String productPool,
42 @RequestParam(value = "sort", required = false)String sort, 43 @RequestParam(value = "sort", required = false)String sort,
43 @RequestParam(value = "brand", required = false)String brand, 44 @RequestParam(value = "brand", required = false)String brand,
@@ -50,8 +51,8 @@ public class ProductSearchController { @@ -50,8 +51,8 @@ public class ProductSearchController {
50 @RequestParam(value = "page", required = false)Integer page 51 @RequestParam(value = "page", required = false)Integer page
51 ) { 52 ) {
52 SortIdLevel sortIdLevel = productSearchService.getSortLevelById(sort); 53 SortIdLevel sortIdLevel = productSearchService.getSortLevelById(sort);
53 - ProductSearchReq req = new ProductSearchReq().setOrder(order).setPool(productPool).setBrand(brand).setMidSort(sortIdLevel.getMidSortId()).setMaxSort(sortIdLevel.getMaxSortId())  
54 - .setSeries(series).setGender(gender).setSize(size).setIsSoonSale(isSoonSale).setViewNum(limit).setPage(page); 54 + ProductSearchReq req = new ProductSearchReq().setOrder(order).setId(id).setPool(productPool).setBrand(brand).setMidSort(sortIdLevel.getMidSortId()).setMaxSort(sortIdLevel.getMaxSortId())
  55 + .setSeries(series).setGender(gender).setSize(size).setIsSoonSale(isSoonSale).setViewNum(limit).setPage(page).setIsIdFilter(type);
55 searchHelpService.setQuery(query, req); 56 searchHelpService.setQuery(query, req);
56 LOG.info("in method=ufo.product.search.list req={}", req.toString()); 57 LOG.info("in method=ufo.product.search.list req={}", req.toString());
57 58
@@ -14,7 +14,10 @@ public final class SearchConstants { @@ -14,7 +14,10 @@ public final class SearchConstants {
14 /** 14 /**
15 * 品牌ID查多个品牌以逗号分隔 15 * 品牌ID查多个品牌以逗号分隔
16 */ 16 */
17 - String BRAND_ID = "brand"; 17 + String PRODUCT_ID = "id";
  18 +
  19 + String PRODUCT_ID_FILTER = "isIdFilter";
  20 +
18 21
19 /** 22 /**
20 * 性别1-男,2-女,3-通用 23 * 性别1-男,2-女,3-通用
@@ -44,7 +44,7 @@ public class SearchParam { @@ -44,7 +44,7 @@ public class SearchParam {
44 setOrder(req.getOrder()).setBrand(req.getBrand()).setSize(req.getSize()) 44 setOrder(req.getOrder()).setBrand(req.getBrand()).setSize(req.getSize())
45 .setMaxSort(req.getMaxSort()).setMidSort(req.getMidSort()) 45 .setMaxSort(req.getMaxSort()).setMidSort(req.getMidSort())
46 .setQuery(req.getQuery()).setSoonSale(req.getIsSoonSale()) 46 .setQuery(req.getQuery()).setSoonSale(req.getIsSoonSale())
47 - .setProductPool(req.getPool()) 47 + .setProductPool(req.getPool()).setId(req.getId()).setIdFilter(req.getIsIdFilter())
48 .setViewNum(req.getViewNum()).setPage(req.getPage()) 48 .setViewNum(req.getViewNum()).setPage(req.getPage())
49 .setBrandSeries(req.getSeries()).setGender(req.getGender()); 49 .setBrandSeries(req.getSeries()).setGender(req.getGender());
50 return this; 50 return this;
@@ -117,6 +117,20 @@ public class SearchParam { @@ -117,6 +117,20 @@ public class SearchParam {
117 } 117 }
118 118
119 119
  120 + public SearchParam setId(String id) {
  121 + if (StringUtils.isNotEmpty(id)) {
  122 + param.put(SearchConstants.IndexNameConstant.PRODUCT_ID, id);
  123 + }
  124 + return this;
  125 + }
  126 +
  127 + public SearchParam setIdFilter(String idFilter) {
  128 + if (StringUtils.isNotEmpty(idFilter)) {
  129 + param.put(SearchConstants.IndexNameConstant.PRODUCT_ID_FILTER, idFilter);
  130 + }
  131 + return this;
  132 + }
  133 +
120 public SearchParam setProductPool(String productPool) { 134 public SearchParam setProductPool(String productPool) {
121 if (StringUtils.isNotEmpty(productPool)) { 135 if (StringUtils.isNotEmpty(productPool)) {
122 param.put(SearchConstants.IndexNameConstant.PRODUCT_POOL, productPool); 136 param.put(SearchConstants.IndexNameConstant.PRODUCT_POOL, productPool);
@@ -4,7 +4,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder; @@ -4,7 +4,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
4 4
5 public class ProductSearchReq { 5 public class ProductSearchReq {
6 6
7 - private Integer id; 7 + private String id;
8 private Integer viewNum; 8 private Integer viewNum;
9 private Integer page; 9 private Integer page;
10 private String query; 10 private String query;
@@ -18,6 +18,7 @@ public class ProductSearchReq { @@ -18,6 +18,7 @@ public class ProductSearchReq {
18 private String order; 18 private String order;
19 private String isSoonSale; //Y saletime查了大于now的 19 private String isSoonSale; //Y saletime查了大于now的
20 private String not_id; 20 private String not_id;
  21 + private String isIdFilter;
21 22
22 23
23 @Override 24 @Override
@@ -36,15 +37,17 @@ public class ProductSearchReq { @@ -36,15 +37,17 @@ public class ProductSearchReq {
36 .append("pool", pool) 37 .append("pool", pool)
37 .append("isSoonSale", isSoonSale) 38 .append("isSoonSale", isSoonSale)
38 .append("not_id", not_id) 39 .append("not_id", not_id)
  40 + .append("id", id)
  41 + .append("isIdFilter", isIdFilter)
39 .toString(); 42 .toString();
40 } 43 }
41 44
42 45
43 - public Integer getId() { 46 + public String getId() {
44 return id; 47 return id;
45 } 48 }
46 49
47 - public ProductSearchReq setId(Integer id) { 50 + public ProductSearchReq setId(String id) {
48 this.id = id; 51 this.id = id;
49 return this; 52 return this;
50 } 53 }
@@ -167,4 +170,14 @@ public class ProductSearchReq { @@ -167,4 +170,14 @@ public class ProductSearchReq {
167 return this; 170 return this;
168 } 171 }
169 172
  173 + public String getIsIdFilter() {
  174 + return isIdFilter;
  175 + }
  176 +
  177 + public ProductSearchReq setIsIdFilter(Integer type) {
  178 + if (type != null && type.equals(Integer.valueOf(7))) {
  179 + this.isIdFilter = "Y";
  180 + }
  181 + return this;
  182 + }
170 } 183 }
@@ -5,6 +5,7 @@ import com.yoho.tools.common.beans.ApiResponse; @@ -5,6 +5,7 @@ import com.yoho.tools.common.beans.ApiResponse;
5 import com.yohoufo.common.caller.UfoServiceCaller; 5 import com.yohoufo.common.caller.UfoServiceCaller;
6 import com.yohoufo.user.requestVO.FavoriteRequestVO; 6 import com.yohoufo.user.requestVO.FavoriteRequestVO;
7 import com.yohoufo.user.service.IFavoriteService; 7 import com.yohoufo.user.service.IFavoriteService;
  8 +import org.apache.commons.lang3.StringUtils;
8 import org.slf4j.Logger; 9 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory; 10 import org.slf4j.LoggerFactory;
10 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
@@ -51,9 +52,18 @@ public class FavoriteController { @@ -51,9 +52,18 @@ public class FavoriteController {
51 52
52 //分页获取收藏的商品id, 53 //分页获取收藏的商品id,
53 List<String> productIds= favoriteService.listFavorite(vo); 54 List<String> productIds= favoriteService.listFavorite(vo);
  55 + String product_id = StringUtils.join(productIds,",");
  56 + int type=7;
  57 + int limit = productIds==null?0:productIds.size();
  58 + int page=1;
  59 +
54 //调用商品接口返回商品list 60 //调用商品接口返回商品list
55 - ApiResponse productApiResponse = serviceCaller.call("ufo.product.batch.data",  
56 - ApiResponse.class, productIds); 61 + ApiResponse productApiResponse = serviceCaller.call("ufo.product.search.list",
  62 + ApiResponse.class,
  63 + type,null, product_id,null
  64 + ,null,null,null,null,null,null,null
  65 + ,limit,page
  66 + );
57 return productApiResponse; 67 return productApiResponse;
58 } 68 }
59 69