|
|
|
@@ -119,7 +119,7 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL); |
|
|
|
} |
|
|
|
|
|
|
|
if (count > coupon.getUseLimitQuantity()) { |
|
|
|
if (count >= coupon.getUseLimitQuantity()) { |
|
|
|
//解锁 |
|
|
|
redisLock.unlock(couponIdStr, timeStr); |
|
|
|
logger.error("此券购买数量已超限, couponId: " + couponIdStr + ", count: " + count); |
|
|
|
@@ -266,12 +266,22 @@ public class WxOrderServiceImpl implements WxOrderService { |
|
|
|
else { |
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
calendar.setTime(curr); |
|
|
|
// 普通券精确到天 |
|
|
|
calendar.set(Calendar.HOUR_OF_DAY, 0); |
|
|
|
calendar.set(Calendar.MINUTE, 0); |
|
|
|
calendar.set(Calendar.SECOND, 0); |
|
|
|
Date zero = calendar.getTime(); |
|
|
|
valid_date = new Date(zero.getTime() + (coupon.getValidDays()+1) * 24 * 60 * 60 * 1000); |
|
|
|
if (coupon.getType() != EnumCouponType.COUPON_TINGCHE.getCode()) { |
|
|
|
// 普通券精确到天 |
|
|
|
calendar.set(Calendar.HOUR_OF_DAY, 0); |
|
|
|
calendar.set(Calendar.MINUTE, 0); |
|
|
|
calendar.set(Calendar.SECOND, 0); |
|
|
|
calendar.add(Calendar.DAY_OF_MONTH, 1+coupon.getValidDays()); |
|
|
|
valid_date = calendar.getTime(); |
|
|
|
} else { |
|
|
|
// 停车券过期日期到月 |
|
|
|
calendar.set(Calendar.DAY_OF_MONTH, 0); |
|
|
|
calendar.set(Calendar.HOUR_OF_DAY, 0); |
|
|
|
calendar.set(Calendar.MINUTE, 0); |
|
|
|
calendar.set(Calendar.SECOND, 0); |
|
|
|
calendar.add(Calendar.MONTH, 1); |
|
|
|
valid_date = calendar.getTime(); |
|
|
|
} |
|
|
|
} |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
|
|
|
|
|