|
|
package com.yoho.ufo.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.yoho.core.common.utils.DateUtil;
|
|
|
import com.yoho.ufo.dal.ProductSortMapper;
|
|
|
import com.yoho.ufo.exception.CommonException;
|
|
|
import com.yoho.ufo.model.commoditybasicrole.category.ProductSort;
|
|
|
import com.yoho.ufo.service.IProductSortService;
|
|
|
import com.yoho.ufo.util.OrikaUtils;
|
|
|
import com.yohobuy.ufo.model.common.PageModel;
|
|
|
import com.yohobuy.ufo.model.common.PageResponseBO;
|
|
|
import com.yohobuy.ufo.model.request.productsort.ProductSortRequestBo;
|
|
|
import com.yohobuy.ufo.model.response.productsort.ProductSortResponseBo;
|
|
|
import com.yohobuy.ufo.model.response.productsort.ProductSortTreeViewResponseBo;
|
...
|
...
|
@@ -83,19 +82,18 @@ public class ProductSortServiceImpl implements IProductSortService { |
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public PageResponseBO<ProductSortTreeViewResponseBo> getProductSortPageList(ProductSortRequestBo productSortRequestBo) {
|
|
|
public List<ProductSortTreeViewResponseBo> getProductSortList(ProductSortRequestBo productSortRequestBo) {
|
|
|
LOGGER.info("getProductSortPageList param = {}", productSortRequestBo);
|
|
|
ProductSort productSort = OrikaUtils.map(productSortRequestBo, ProductSort.class);
|
|
|
PageModel pageModel = productSortRequestBo.toPageModel();
|
|
|
int count = productSortMapper.selectProductSortCount(productSort);
|
|
|
if (count == 0) {
|
|
|
LOGGER.warn("getProductSortPageList count is 0. param = {}", productSortRequestBo);
|
|
|
return new PageResponseBO<>();
|
|
|
return Lists.newArrayList();
|
|
|
}
|
|
|
List<ProductSort> productSorts = productSortMapper.getProductSortPageList(productSort, pageModel);
|
|
|
List<ProductSort> productSorts = productSortMapper.getProductSortList(productSort);
|
|
|
List<ProductSortTreeViewResponseBo> responseBos = new ArrayList<>();
|
|
|
processResult(productSorts, responseBos);
|
|
|
return new PageResponseBO<>(count, responseBos, pageModel.getCurrentPage(), pageModel.getPageSize());
|
|
|
return responseBos;
|
|
|
}
|
|
|
|
|
|
private void processResult(List<ProductSort> productSorts, List<ProductSortTreeViewResponseBo> responseBos) {
|
...
|
...
|
|