From d25ba76094ab8bf8679808ccd2b53f5233866070 Mon Sep 17 00:00:00 2001 From: paulGao Date: Thu, 1 Jul 2021 10:12:33 +0800 Subject: [PATCH] fix https://gitee.com/beijing_hongye_huicheng/lilishop/issues/I3YFU4 --- .../modules/goods/serviceimpl/GoodsSkuServiceImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java index 99f46de6..9f8e0f68 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java @@ -191,6 +191,11 @@ public class GoodsSkuServiceImpl extends ServiceImpl i GoodsSku goodsSku = this.getGoodsSkuByIdFromCache(skuId); GoodsVO goodsVO = goodsService.getGoodsVO(goodsId); + if (goodsVO == null || !goodsVO.getMarketEnable().equals(GoodsStatusEnum.UPPER.name()) + || !goodsVO.getIsAuth().equals(GoodsAuthEnum.PASS.name()) + || Boolean.TRUE.equals(goodsVO.getDeleteFlag())) { + throw new ServiceException(ResultCode.GOODS_NOT_EXIST); + } //如果规格为空则使用商品ID进行查询 if (goodsSku == null) { skuId = goodsVO.getSkuList().get(0).getId(); @@ -199,8 +204,6 @@ public class GoodsSkuServiceImpl extends ServiceImpl i if (goodsSku == null) { throw new ServiceException(ResultCode.GOODS_NOT_EXIST); } - } else if (!goodsSku.getMarketEnable().equals(GoodsStatusEnum.UPPER.name()) || !goodsVO.getIsAuth().equals(GoodsAuthEnum.PASS.name()) || Boolean.TRUE.equals(goodsSku.getDeleteFlag())) { - throw new ServiceException(ResultCode.GOODS_NOT_EXIST); } //获取当前商品的索引信息 EsGoodsIndex goodsIndex = goodsIndexService.findById(skuId);