修复秒杀活动

This commit is contained in:
paulGao 2022-03-02 20:33:45 +08:00
parent 3506e1c738
commit 1688a7ba15

View File

@ -209,12 +209,12 @@ public class SkuPromotionRender implements CartRenderStep {
quantity = promotionGoodsService.getPromotionGoodsStock(PromotionTypeEnum.valueOf(promotionSkuVO.getPromotionType()), promotionSkuVO.getActivityId(), cartSkuVO.getGoodsSku().getId());
break;
default:
break;
return;
}
}
if (cartSkuVO.getNum() > (Integer) quantity) {//设置购物车未选中
if (quantity != null && cartSkuVO.getNum() > (Integer) quantity) {//设置购物车未选中
cartSkuVO.setChecked(false);
//设置失效消息
cartSkuVO.setErrorMessage("促销商品库存不足,现有库存数量[" + quantity + "]");