Bladeren bron

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

release_toaliyun_real
Stormeye Wu 6 jaren geleden
bovenliggende
commit
ed27928248
1 gewijzigde bestanden met toevoegingen van 4 en 3 verwijderingen
  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 Bestand weergeven

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




Laden…
Annuleren
Opslaan