...
|
...
|
@@ -264,7 +264,60 @@ public class ProductSearchController { |
|
|
}
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).message("search.suggest.").data(resp).build();
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(name = "ufo.product.search.deposit", desc="现货寄存的商品列表")
|
|
|
@RequestMapping(params = "method=ufo.product.search.deposit")
|
|
|
@IgnoreSession
|
|
|
@Cachable(expire = 60)
|
|
|
public ApiResponse searchDepositProductList(
|
|
|
@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,
|
|
|
@RequestParam(value = "series", required = false)String series,
|
|
|
@RequestParam(value = "gender", required = false) String gender,
|
|
|
@RequestParam(value = "size", required = false) String size,
|
|
|
@RequestParam(value = "isSoonSale", required = false) String isSoonSale,
|
|
|
@RequestParam(value = "query", required = false)String query,
|
|
|
@RequestParam(value = "limit", required = false)Integer limit,
|
|
|
@RequestParam(value = "page", required = false)Integer page,
|
|
|
@RequestParam(value = "app_version", required = false)String appVersion
|
|
|
) {
|
|
|
if (type != null) {
|
|
|
Map<Integer,Integer> poolConfig = ufoServiceCaller.call("ufo.resource.goodsPool", Map.class);
|
|
|
if (type == 0) {
|
|
|
productPool = String.valueOf(poolConfig.get(2));
|
|
|
order = "pools.order_by:desc";
|
|
|
} else if (type == 1) {
|
|
|
productPool = String.valueOf(poolConfig.get(4));
|
|
|
order = "pools.order_by:desc";
|
|
|
} else if (type == 2) {
|
|
|
isSoonSale = "Y";
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(productPool)
|
|
|
&& StringUtils.isBlank(query)
|
|
|
&& StringUtils.isBlank(order)) {
|
|
|
order = "pools.order_by:desc"; // 如果走商品池接口,默认走排序倒序接口
|
|
|
}
|
|
|
SortIdLevel sortIdLevel = productSearchService.getSortLevelById(sort);
|
|
|
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).setSearchType(type);
|
|
|
searchHelpService.setQuery(query, req);
|
|
|
//设置是否包含有货商品
|
|
|
searchHelpService.setContainYoho(appVersion, req);
|
|
|
LOG.info("in method=ufo.product.search.list req={}", req.toString());
|
|
|
|
|
|
JSONObject resp = productSearchService.searchProductList(req);
|
|
|
if (resp != null) {
|
|
|
resp.put("rec_id", UUID.randomUUID());
|
|
|
}
|
|
|
return new ApiResponse.ApiResponseBuilder().code(200).message("Product List.").data(resp).build();
|
|
|
}
|
|
|
|
|
|
private Integer getValidTimestamp(String dateStr, boolean start) {
|
|
|
try {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
...
|
...
|
|