cup 2 年 前
コミット
4afbfea7e5

+ 1 - 1
mp-admin/src/main/java/com/qs/mp/web/controller/api/user/UserTicketController.java

@@ -317,7 +317,7 @@ public class UserTicketController extends BaseApiController {
 
     // 兑奖
     String lockKey = RedisLockKey.build(RedisLockKey.USER_TICKET_CASH_LOCK, param.getPrizeId());
-    if (distributedLocker.tryLock(lockKey)) {
+    if (!distributedLocker.tryLock(lockKey)) {
       return AjaxResult.error("系统繁忙,请稍后再试");
     }
     try {

+ 1 - 1
mp-service/src/main/java/com/qs/mp/user/service/impl/UserHitPrizeServiceImpl.java

@@ -210,7 +210,7 @@ public class UserHitPrizeServiceImpl extends ServiceImpl<UserHitPrizeMapper, Use
 
             // 兑奖
             String lockKey = RedisLockKey.build(RedisLockKey.USER_TICKET_CASH_LOCK, ticketAwardsPrize.getPrizeId());
-            if (distributedLocker.tryLock(lockKey)) {
+            if (!distributedLocker.tryLock(lockKey)) {
                 throw new ServiceException("系统繁忙,请稍后再试");
             }
             try {