|
|
|
@@ -462,7 +462,7 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
* @param counpon |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private int getUserCouponOrderCount(WxCUserBasicInfo user, WxCoupon counpon) { |
|
|
|
private int getUserCouponOrderCount(WxCUserBasicInfo user, WxCoupon counpon,int couponNumber) { |
|
|
|
// + couponOrder ---待使用 |
|
|
|
try { |
|
|
|
WxCouponOrder couponOrderQ = new WxCouponOrder(); |
|
|
|
@@ -475,7 +475,7 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
// if (counpon.getSendType().equals(EnumCouponSendType.PASSIVE.getCode())) { |
|
|
|
// couponOrderQ.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()); |
|
|
|
// } |
|
|
|
return wxCouponOrderMapper.findCount(couponOrderQ); |
|
|
|
return wxCouponOrderMapper.findProductCount(couponOrderQ)+couponNumber; |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("购买是否超限-DB, couponId: " + counpon.getId() + ", e:" + e.getMessage(),e); |
|
|
|
throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(),"["+counpon.getTitle()+"]查询待使用订单错误."); |
|
|
|
@@ -532,7 +532,7 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
// } |
|
|
|
// 检查用户已购买数量 |
|
|
|
try { |
|
|
|
count = getUserCouponOrderCount(user, coupon); |
|
|
|
count = getUserCouponOrderCount(user, coupon,1); |
|
|
|
} catch (Exception e) { |
|
|
|
//解锁 |
|
|
|
redisLock.unlock(couponIdStr, timeStr); |
|
|
|
@@ -632,7 +632,7 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
|
|
|
|
// 检查用户已购买数量 |
|
|
|
try { |
|
|
|
count = getUserCouponOrderCount(user, coupon); |
|
|
|
count = getUserCouponOrderCount(user, coupon,number); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(),"["+coupon.getTitle()+"]查询待使用订单错误."); |
|
|
|
} |
|
|
|
|