|
|
|
@@ -531,7 +531,13 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
wxCouponMapper.backInventory(coupon.getId(), 1, coupon.getRemainInventory()); |
|
|
|
int num = wxCouponMapper.backInventory(coupon.getId(), 1, coupon.getRemainInventory()); |
|
|
|
if (num <= 0) { |
|
|
|
// 解锁 |
|
|
|
redisLock.unlock(couponIdStr, timeStr); |
|
|
|
logger.error("此券加库存失败, couponId: " + couponIdStr); |
|
|
|
throw new MallinkException(ErrorCode.ORDER_IS_FAIL); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("数据库更新失败,库存+1失败, e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "库存恢复失败"); |
|
|
|
|