From 3e4cfdd9da5ed748292e7da7ec42a64d0fe4b75c Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Sun, 26 Sep 2021 19:00:46 +0800 Subject: [PATCH] Merge branch 'master' of http://120.27.238.55:7000/r/xc-mall --- src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java index 7471bf9..b7fc216 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java +++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallGoodsServiceImpl.java @@ -17,7 +17,9 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import java.math.BigDecimal; import java.util.List; +import java.util.Map; /** * @author wzy @@ -44,6 +46,10 @@ } List<String> images = goodsImagesMapper.selectGoodsImagesByGoodsId(mallGoods.getId()); MallGoodsDetailsVo mallGoodsDetailsVo = MallGoodsConversion.INSTANCE.entityToDetailsVo(mallGoods); + + Map<String, BigDecimal> stockAndVolume = this.baseMapper.selectGoodsStockAndVolume(id); + mallGoodsDetailsVo.setStock(stockAndVolume.get("stock").intValue()); + mallGoodsDetailsVo.setVolume(stockAndVolume.get("volume").intValue()); mallGoodsDetailsVo.setImages(images); return mallGoodsDetailsVo; } -- Gitblit v1.9.1