商品非空判定处理

This commit is contained in:
Chopper 2021-12-22 12:42:04 +08:00
parent 0ae1ae5df4
commit 3d56c9cc81

View File

@ -226,13 +226,13 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
//从缓存拿商品Sku
GoodsSku goodsSku = this.getGoodsSkuByIdFromCache(skuId);
//如果使用商品ID无法查询SKU则返回错误
if (goodsVO == null | goodsSku == null) {
if (goodsVO == null || goodsSku == null) {
throw new ServiceException(ResultCode.GOODS_NOT_EXIST);
}
//商品下架||商品未审核通过||商品删除则提示商品已下架
if (goodsVO.getMarketEnable().equals(GoodsStatusEnum.DOWN.name())
|| !goodsVO.getAuthFlag().equals(GoodsAuthEnum.PASS.name())
if (GoodsStatusEnum.DOWN.name().equals(goodsVO.getMarketEnable())
|| !GoodsAuthEnum.PASS.name().equals(goodsVO.getAuthFlag())
|| Boolean.TRUE.equals(goodsVO.getDeleteFlag())) {
throw new ServiceException(ResultCode.GOODS_NOT_EXIST);
}