Authored by zhaojun2

bug fix

... ... @@ -39,8 +39,8 @@
select id, goods_id, product_id, is_default, image_url, order_by
from goods_images
</select>
<select id="selectByGoodsId" resultMap="BaseResultMap">
select image_url
from goods_images where goods_id = #{goodsId,jdbcType=INTEGER} order BY order_by;
</select>
<select id="selectByGoodsId" resultMap="BaseResultMap">
select id, goods_id, image_url
from goods_images where goods_id = #{goodsId,jdbcType=INTEGER} order BY order_by;
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -303,7 +303,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::isBlank).map(this::buildImageFullUrl).collect(Collectors.toList());
List<String> imageUrlList = goodsImages.stream().map(GoodsImages::getImageUrl).filter(StringUtils::isNotBlank).map(this::buildImageFullUrl).collect(Collectors.toList());
imageUrlList.forEach(e -> imageList.add(GoodsImageBO.create(e)));
}
goodsBO.setImageList(imageList);
... ...