!1181 【缺陷修复】退款回收优惠券错误

Merge pull request !1181 from 壁虎在家/master-jdk17
This commit is contained in:
芋道源码 2025-01-05 08:38:09 +00:00 committed by Gitee
commit 0e9827e5a0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 0 deletions

View File

@ -178,6 +178,9 @@ public class CouponServiceImpl implements CouponService {
*/
@Transactional(rollbackFor = Exception.class)
public void invalidateCoupon(Long couponId, Long userId) {
if (couponId == null || couponId <= 0) {
return;
}
// 1.1 校验优惠券
CouponDO coupon = couponMapper.selectByIdAndUserId(couponId, userId);
if (coupon == null) {