|
|
@@ -96,8 +96,8 @@ public class LiveGoodsServiceImpl implements ILiveGoodsService {
|
|
|
liveGoods.setUpdateTime(DateUtils.getNowDate());
|
|
|
LiveGoods existGoods = baseMapper.selectLiveGoodsByGoodsId(liveGoods.getGoodsId());
|
|
|
if (liveGoods.getStock() != null) {
|
|
|
- if(liveGoods.getProductId() == null) return R.error("店铺已停止售卖商品!");
|
|
|
- FsStoreProduct fsStoreProduct = fsStoreProductMapper.selectFsStoreProductById(liveGoods.getProductId());
|
|
|
+ if(existGoods.getProductId() == null) return R.error("店铺已停止售卖商品!");
|
|
|
+ FsStoreProduct fsStoreProduct = fsStoreProductMapper.selectFsStoreProductById(existGoods.getProductId());
|
|
|
if(fsStoreProduct == null) return R.error("商品不存在");
|
|
|
if(fsStoreProduct.getIsShow() == 0 || existGoods.getStatus() == 0) return R.error("商品已下架");
|
|
|
if(fsStoreProduct.getStock() < liveGoods.getStock()) return R.error("商品库存不足");
|