Authored by csgyoho

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

... ... @@ -153,7 +153,7 @@ public class ProductController {
public ApiResponse setDepotNum(
@RequestParam(value = "skup", required = true) Integer skup,
@RequestParam(value = "depotNum", required = true) Integer depotNum) {
LOG.info("in method=ufo.product.cancelSaleSkup skup={}, depotNum={}", skup, depotNum);
LOG.info("in method=ufo.product.setDepotNum skup={}, depotNum={}", skup, depotNum);
try {
productService.setDepotNum(skup, depotNum);
return new ApiResponse(200, "设置成功!", Boolean.TRUE);
... ... @@ -169,7 +169,7 @@ public class ProductController {
public ApiResponse saleSkup(
@RequestParam(value = "product_id", required = true) Integer productId,
@RequestParam(value = "skup", required = true) Integer skup) {
LOG.info("in method=ufo.product.createSkup productId = {}, skup={}", productId, skup);
LOG.info("in method=ufo.product.saleSkup productId = {}, skup={}", productId, skup);
try {
productService.saleSkup(productId, skup);
LOG.info("saleSkup success and async clearProductCache skup = {}", skup);
... ...
... ... @@ -38,6 +38,7 @@ public class ProductSearchController {
public ApiResponse searchProductList(
@RequestParam(value = "type", required = false)Integer type,
@RequestParam(value = "order", required = false)String order,
@RequestParam(value = "product_id", required = false)String id,
@RequestParam(value = "productPool", required = false) String productPool,
@RequestParam(value = "sort", required = false)String sort,
@RequestParam(value = "brand", required = false)String brand,
... ... @@ -50,8 +51,8 @@ public class ProductSearchController {
@RequestParam(value = "page", required = false)Integer page
) {
SortIdLevel sortIdLevel = productSearchService.getSortLevelById(sort);
ProductSearchReq req = new ProductSearchReq().setOrder(order).setPool(productPool).setBrand(brand).setMidSort(sortIdLevel.getMidSortId()).setMaxSort(sortIdLevel.getMaxSortId())
.setSeries(series).setGender(gender).setSize(size).setIsSoonSale(isSoonSale).setViewNum(limit).setPage(page);
ProductSearchReq req = new ProductSearchReq().setOrder(order).setId(id).setPool(productPool).setBrand(brand).setMidSort(sortIdLevel.getMidSortId()).setMaxSort(sortIdLevel.getMaxSortId())
.setSeries(series).setGender(gender).setSize(size).setIsSoonSale(isSoonSale).setViewNum(limit).setPage(page).setIsIdFilter(type);
searchHelpService.setQuery(query, req);
LOG.info("in method=ufo.product.search.list req={}", req.toString());
... ...
... ... @@ -14,7 +14,10 @@ public final class SearchConstants {
/**
* 品牌ID查多个品牌以逗号分隔
*/
String BRAND_ID = "brand";
String PRODUCT_ID = "id";
String PRODUCT_ID_FILTER = "isIdFilter";
/**
* 性别1-男,2-女,3-通用
... ...
... ... @@ -44,7 +44,7 @@ public class SearchParam {
setOrder(req.getOrder()).setBrand(req.getBrand()).setSize(req.getSize())
.setMaxSort(req.getMaxSort()).setMidSort(req.getMidSort())
.setQuery(req.getQuery()).setSoonSale(req.getIsSoonSale())
.setProductPool(req.getPool())
.setProductPool(req.getPool()).setId(req.getId()).setIdFilter(req.getIsIdFilter())
.setViewNum(req.getViewNum()).setPage(req.getPage())
.setBrandSeries(req.getSeries()).setGender(req.getGender());
return this;
... ... @@ -117,6 +117,20 @@ public class SearchParam {
}
public SearchParam setId(String id) {
if (StringUtils.isNotEmpty(id)) {
param.put(SearchConstants.IndexNameConstant.PRODUCT_ID, id);
}
return this;
}
public SearchParam setIdFilter(String idFilter) {
if (StringUtils.isNotEmpty(idFilter)) {
param.put(SearchConstants.IndexNameConstant.PRODUCT_ID_FILTER, idFilter);
}
return this;
}
public SearchParam setProductPool(String productPool) {
if (StringUtils.isNotEmpty(productPool)) {
param.put(SearchConstants.IndexNameConstant.PRODUCT_POOL, productPool);
... ...
... ... @@ -4,7 +4,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
public class ProductSearchReq {
private Integer id;
private String id;
private Integer viewNum;
private Integer page;
private String query;
... ... @@ -18,6 +18,7 @@ public class ProductSearchReq {
private String order;
private String isSoonSale; //Y saletime查了大于now的
private String not_id;
private String isIdFilter;
@Override
... ... @@ -36,15 +37,17 @@ public class ProductSearchReq {
.append("pool", pool)
.append("isSoonSale", isSoonSale)
.append("not_id", not_id)
.append("id", id)
.append("isIdFilter", isIdFilter)
.toString();
}
public Integer getId() {
public String getId() {
return id;
}
public ProductSearchReq setId(Integer id) {
public ProductSearchReq setId(String id) {
this.id = id;
return this;
}
... ... @@ -167,4 +170,14 @@ public class ProductSearchReq {
return this;
}
public String getIsIdFilter() {
return isIdFilter;
}
public ProductSearchReq setIsIdFilter(Integer type) {
if (type != null && type.equals(Integer.valueOf(7))) {
this.isIdFilter = "Y";
}
return this;
}
}
... ...
... ... @@ -5,6 +5,7 @@ import com.yoho.tools.common.beans.ApiResponse;
import com.yohoufo.common.caller.UfoServiceCaller;
import com.yohoufo.user.requestVO.FavoriteRequestVO;
import com.yohoufo.user.service.IFavoriteService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -51,9 +52,18 @@ public class FavoriteController {
//分页获取收藏的商品id,
List<String> productIds= favoriteService.listFavorite(vo);
String product_id = StringUtils.join(productIds,",");
int type=7;
int limit = productIds==null?0:productIds.size();
int page=1;
//调用商品接口返回商品list
ApiResponse productApiResponse = serviceCaller.call("ufo.product.batch.data",
ApiResponse.class, productIds);
ApiResponse productApiResponse = serviceCaller.call("ufo.product.search.list",
ApiResponse.class,
type,null, product_id,null
,null,null,null,null,null,null,null
,limit,page
);
return productApiResponse;
}
... ...