feat:领取商品增加是否上架和库存校验
This commit is contained in:
parent
ad097d5c97
commit
906e8ee2e2
@ -893,6 +893,16 @@ public class StorePinkServiceImpl extends ServiceImpl<StorePinkMapper, StorePink
|
|||||||
throw new YztException("商品不存在");
|
throw new YztException("商品不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 校验商品是否上架
|
||||||
|
if (!storeProduct.getIsShow()) {
|
||||||
|
throw new YztException("商品已下架,无法领取");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验商品库存
|
||||||
|
if (storeProduct.getStock() == null || storeProduct.getStock() < 1) {
|
||||||
|
throw new YztException("商品库存不足,无法领取");
|
||||||
|
}
|
||||||
|
|
||||||
// 生成订单号
|
// 生成订单号
|
||||||
String orderNo = YztUtil.getOrderNo("claim");
|
String orderNo = YztUtil.getOrderNo("claim");
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user