Commit e014b56d by 章家宝

feat:仅对固定日志的优惠券运行重新发放

1 parent 84c033f6
...@@ -959,6 +959,14 @@ public class CouponActivityService { ...@@ -959,6 +959,14 @@ public class CouponActivityService {
throw new BusinessCodeException(ErrorCodeEnum.COMMON_ERROR, "原券可用库存不足"); throw new BusinessCodeException(ErrorCodeEnum.COMMON_ERROR, "原券可用库存不足");
} }
// 5.3 校验模板有效期(仅固定时间类型需要校验)
if (template.getValidityType() != null
&& template.getValidityType() == 1
&& template.getValidEndTime() != null
&& template.getValidEndTime().isBefore(now)) {
throw new BusinessCodeException(ErrorCodeEnum.COMMON_ERROR, "原券已过有效期");
}
// 7. 重新发放优惠券(调用现有的发放逻辑,会自动扣减库存) // 7. 重新发放优惠券(调用现有的发放逻辑,会自动扣减库存)
String newCouponId = dailySequenceIdGenerator.getCouponId(); String newCouponId = dailySequenceIdGenerator.getCouponId();
String newRecordId = dailySequenceIdGenerator.getCouponDistributionId(); String newRecordId = dailySequenceIdGenerator.getCouponDistributionId();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!