Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history


Merge pull request !13 from OceansDeep/feature/pg
  • Loading branch information
OceansDeep authored and gitee-org committed Jul 1, 2021
2 parents 7e3a9eb + 696e075 commit e38f9aa
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ public Map<String, Object> getGoodsSkuDetail(String goodsId, String skuId) {
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();
Expand All @@ -198,8 +203,6 @@ public Map<String, Object> getGoodsSkuDetail(String goodsId, String skuId) {
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);
Expand Down

0 comments on commit e38f9aa

Please sign in to comment.