Authored by zhaojun2

bug fix

... ... @@ -46,10 +46,10 @@ public class ProductController {
@RequestMapping(params = "method=ufo.product.data")
@Cachable(expire=600)
public ApiResponse queryProductDetailById(
@RequestParam(value = "product_id", required = false) Integer productId) {
@RequestParam(value = "product_id", required = true) Integer productId) {
if (null == productId) {
return new ApiResponse(500, "product_id Is Null", null);
return new ApiResponse(400, "product_id Is Null", null);
}
ProductDetailResp resp = productService.queryProductDetailById(productId);
... ...
... ... @@ -4,11 +4,10 @@ import java.math.BigDecimal;
import java.util.*;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.ToIntFunction;
import java.util.stream.Collectors;
import com.google.common.collect.Lists;
import com.yoho.core.common.helpers.ImagesHelper;
import com.yohoufo.common.utils.UfoStringUtils;
import com.yohoufo.dal.product.*;
import com.yohoufo.dal.product.model.*;
import com.yohoufo.product.model.GoodsImageBO;
... ... @@ -143,8 +142,21 @@ public class ProductServiceImpl implements ProductService{
public ProductSeriesTemplateResp querySortTemplateData(String skns) {
ProductSeriesTemplateResp resp = new ProductSeriesTemplateResp();
List<Integer> sknlist = UfoStringUtils.string2IntegerList(skns);
List<String> sknlist = Lists.newArrayList(skns.split(","));
if (!CollectionUtils.isEmpty(sknlist)) {
List<Product> products = productMapper.selectByIds(sknlist);
if (!CollectionUtils.isEmpty(products)) {
List<Integer> seriesIds = products.stream().map(Product::getSeriesId).filter(Objects::nonNull).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(seriesIds)) {
List<BrandSeries> seriesList = brandSeriesMapper.selectByIds(seriesIds);
}
List<Goods> goodsList = goodsMapper.selectByProductIds(sknlist);
}
}
return null;
}
... ... @@ -316,7 +328,7 @@ public class ProductServiceImpl implements ProductService{
List<GoodsImages> goodsImages = goodsImagesMapper.selectByGoodsId(goodId);
List<GoodsImageBO> imageList = new ArrayList<>();
if (!CollectionUtils.isEmpty(goodsImages)) {
List<String> imageUrlList = goodsImages.stream().map(GoodsImages::getImageUrl).filter(StringUtils::isNotBlank).map(this::buildImageFullUrl).collect(Collectors.toList());
List<String> imageUrlList = goodsImages.stream().map(GoodsImages::getImageUrl).filter(StringUtils::isNotBlank).collect(Collectors.toList());
imageUrlList.forEach(e -> imageList.add(GoodsImageBO.create(e)));
}
goodsBO.setImageList(imageList);
... ...