领取优惠券操作

This commit is contained in:
19991905653
2024-04-13 10:39:47 +08:00
parent e86ec29a33
commit f203d7bccc

View File

@@ -374,11 +374,12 @@ public class OrderService {
if (Objects.isNull(userCoupons) || userCoupons.getIsDouble().equals("true")){ if (Objects.isNull(userCoupons) || userCoupons.getIsDouble().equals("true")){
throw new MsgException("该优惠券翻倍已领取"); throw new MsgException("该优惠券翻倍已领取");
} }
modityDouble(conponsId);
return Result.success(CodeEnum.SUCCESS); return Result.success(CodeEnum.SUCCESS);
} }
private void modityDouble(Integer conponsId) throws ParseException { private void modityDouble(Integer conponsId) {
boolean lock_coin = redisUtils.lock(RedisCst.COUPONS_COIN_KEY + conponsId, 5000, TimeUnit.MILLISECONDS); boolean lock_coin = redisUtils.lock(RedisCst.COUPONS_COIN_KEY + conponsId, 5000, TimeUnit.MILLISECONDS);
if (lock_coin) { if (lock_coin) {