Authored by caoyan

二手商品搜索列表

... ... @@ -362,9 +362,10 @@ public class ProductSearchController {
@RequestParam(value = "gender", required = false)String gender,
@RequestParam(value = "brand", required = false) String brand,
@RequestParam(value = "size", required = false) String size,
@RequestParam(value = "price", required = false) String price) {
@RequestParam(value = "price", required = false) String price,
@RequestParam(value = "maxSot", required = false) String maxSort) {
ProductSearchReq req = new ProductSearchReq().setViewNum(limit).setPage(page).setPreSaleFlag(preSaleFlag).setBusinessClient(businessClient)
.setPool(productPool).setGender(gender).setBrand(brand).setSize(size).setPrice(price);
.setPool(productPool).setGender(gender).setBrand(brand).setSize(size).setPrice(price).setMaxSort(maxSort);
LOG.info("in method=ufo.product.search.secondhand.skupList req={}", req);
JSONObject resp = productSearchService.searchSecondhandSkupList(req);
return new ApiResponse.ApiResponseBuilder().code(200).message("secondhand skupList.").data(resp).build();
... ... @@ -380,9 +381,10 @@ public class ProductSearchController {
@RequestParam(value = "business_client", required = false) String businessClient,
@RequestParam(value = "brand", required = false) String brand,
@RequestParam(value = "size", required = false) String size,
@RequestParam(value = "price", required = false) String price) {
@RequestParam(value = "price", required = false) String price,
@RequestParam(value = "maxSort", required = false) String maxSort) {
ProductSearchReq req = new ProductSearchReq().setPreSaleFlag(preSaleFlag).setBusinessClient(businessClient).setPool(productPool)
.setGender(gender).setBrand(brand).setSize(size).setPrice(price);
.setGender(gender).setBrand(brand).setSize(size).setPrice(price).setMaxSort(maxSort);
LOG.info("in method=ufo.product.search.secondhand.skupList req={}", req);
SearchProductListFilterResp resp = productSearchService.searchSecondhandSkupListFilter(req);
return new ApiResponse.ApiResponseBuilder().code(200).message("secondhand skupList filter.").data(resp).build();
... ...
... ... @@ -560,12 +560,30 @@ public class ProductSearchServiceImpl implements ProductSearchService {
if (filterData != null) {
List<FilterItem> filterItems = new ArrayList<>();
if (!CollectionUtils.isEmpty(filterData.getJSONArray("maxSort"))) {
JSONArray preSaleFlagArray = filterData.getJSONArray("maxSort");
FilterItem preSaleFlagFilterItem = new FilterItem();
preSaleFlagFilterItem.setFilterId("maxSort");
preSaleFlagFilterItem.setFilterName("品类");
preSaleFlagFilterItem.setMultiSelect(true);
List<FilterItem.Item> itemList = new ArrayList<>();
for (Object sort : preSaleFlagArray) {
FilterItem.Item item = new FilterItem.Item();
item.setItemName(((JSONObject)sort).getString("sort_name"));
item.setItemId(((JSONObject)sort).getString("id"));
itemList.add(item);
}
preSaleFlagFilterItem.setItemList(itemList);
filterItems.add(preSaleFlagFilterItem);
}
if (!CollectionUtils.isEmpty(filterData.getJSONArray("preSaleFlag"))) {
JSONArray preSaleFlagArray = filterData.getJSONArray("preSaleFlag");
FilterItem preSaleFlagFilterItem = new FilterItem();
preSaleFlagFilterItem.setFilterId("preSaleFlag");
preSaleFlagFilterItem.setFilterName("新旧程度");
preSaleFlagFilterItem.setMultiSelect(false);
preSaleFlagFilterItem.setMultiSelect(true);
List<FilterItem.Item> itemList = new ArrayList<>();
for (Object sort : preSaleFlagArray) {
... ... @@ -601,7 +619,7 @@ public class ProductSearchServiceImpl implements ProductSearchService {
FilterItem sizeFilterItem = new FilterItem();
sizeFilterItem.setFilterId("size");
sizeFilterItem.setFilterName("尺码");
sizeFilterItem.setMultiSelect(false);
sizeFilterItem.setMultiSelect(true);
List<FilterItem.Item> itemList = new ArrayList<>();
for (Object size : sizeArray) {
... ... @@ -643,7 +661,7 @@ public class ProductSearchServiceImpl implements ProductSearchService {
FilterItem brandFilterItem = new FilterItem();
brandFilterItem.setFilterId("brand");
brandFilterItem.setFilterName("品牌");
brandFilterItem.setMultiSelect(false);
brandFilterItem.setMultiSelect(true);
List<FilterItem.Item> itemList = new ArrayList<>();
String brandLogo;
... ...