优惠券数量

This commit is contained in:
2025-09-27 18:33:18 +08:00
parent 83a929b063
commit a59f76cd76

View File

@@ -381,7 +381,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
couponRecordQuery.eq(MkShopCouponRecord::getStatus, 0);
couponRecordQuery.ne(MkShopCouponRecord::getIsDel, 1);
List<MkShopCouponRecord> list = couponRecordService.list(couponRecordQuery);
if (CollUtil.isEmpty(list) || param.getCouponList().size() != list.size()) {
if (CollUtil.isEmpty(list) || param.getCouponList().size() > list.size()) {
throw new ValidateException("生成支付订单失败,优惠券不可用");
}
Map<Integer, MkShopCouponRecord> couponRecordMap = list.stream().collect(Collectors.toMap(MkShopCouponRecord::getType, t -> t));