fix: 优惠券为空不消耗券

This commit is contained in:
张松
2024-11-25 15:08:45 +08:00
parent ec27167f8a
commit 41b6a18676

View File

@@ -1590,6 +1590,9 @@ public class CartService {
} }
private void consumeCoupon(List<TbActivateOutRecord> outRecordList, Integer memberId, TbOrderInfo orderInfo) { private void consumeCoupon(List<TbActivateOutRecord> outRecordList, Integer memberId, TbOrderInfo orderInfo) {
if (outRecordList.isEmpty()) {
return;
}
boolean use = shopCouponService.use(Integer.valueOf(orderInfo.getShopId()), orderInfo.getId(), memberId, outRecordList); boolean use = shopCouponService.use(Integer.valueOf(orderInfo.getShopId()), orderInfo.getId(), memberId, outRecordList);
if (!use) { if (!use) {
throw new MsgException("消耗券失败"); throw new MsgException("消耗券失败");