Parcourir la source

[库存][修复]:减库存失败未处理

release_toaliyun_real
Stormeye Wu il y a 6 ans
Parent
révision
ed27928248
1 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. +4
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java

+ 4
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java Voir le fichier

@@ -489,15 +489,16 @@ public class WxOrderServiceImpl implements WxOrderService {
// 减库存
int num = wxCouponMapper.reduceInventory(coupon.getId(), 1, coupon.getRemainInventory());
if (num == 0) {
// 解锁
redisLock.unlock(couponIdStr, timeStr);
logger.error("此券减库存失败, couponId: " + couponIdStr);
throw new MallinkException(ErrorCode.ORDER_IS_FAIL);
}
} catch (RuntimeException e) {
// 解锁
redisLock.unlock(couponIdStr, timeStr);
logger.error("此券减库存失败, couponId: " + couponIdStr);
throw new MallinkException(ErrorCode.ORDER_IS_FAIL);
} finally {
//解锁
redisLock.unlock(couponIdStr, timeStr);
}
}



Chargement…
Annuler
Enregistrer