优惠券问题

This commit is contained in:
wangw 2025-03-08 18:24:12 +08:00
parent a904f555b3
commit 965c88eb3a
1 changed files with 3 additions and 2 deletions

View File

@ -449,9 +449,10 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
private void checkCoupon(Map<Long, Integer> prodCouponMap, BigDecimalDTO fullAmount, BigDecimalDTO discountAmount, CheckOrderPay param) {
if (CollUtil.isNotEmpty(param.getCouponList())) {
//校验优惠券
List<ShopActivateCouponRecord> records = couponRecordService.list(QueryWrapper.create()
List<ShopActivateCouponRecord> records = couponRecordService.listAs(
QueryWrapper.create()
.where(ShopActivateCouponRecord::getId).in(param.getCouponList())
.and(ShopActivateCouponRecord::getStatus).eq(0));
.and(ShopActivateCouponRecord::getStatus).eq(0),ShopActivateCouponRecord.class);
if (CollUtil.isEmpty(records)) {
throw new ValidateException("生成支付订单失败,优惠券信息不存在");
} else if (records.size() != param.getCouponList().size()) {