|
|
@@ -195,6 +195,9 @@ public class OrderService {
|
|
|
throw new BusinessException("必须使用优惠券支付");
|
|
|
}
|
|
|
coupon = userCouponRepo.findById(userCouponId).orElseThrow(new BusinessException("兑换券不存在"));
|
|
|
+ if (!coupon.getUserId().equals(userId)) {
|
|
|
+ throw new BusinessException("兑换券不属于您");
|
|
|
+ }
|
|
|
if (coupon.isUsed()) {
|
|
|
throw new BusinessException("该兑换券已使用");
|
|
|
}
|