From f727a93931f801bbcd3b5eb0275169cf55a87d5e Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期日, 22 九月 2024 22:40:56 +0800
Subject: [PATCH] 1.优惠券-使用条件-根据满减还是无门槛控制 2.商品限购-根据payment_time来控制
---
src/main/java/com/mzl/flower/schedule/ScheduleService.java | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/mzl/flower/schedule/ScheduleService.java b/src/main/java/com/mzl/flower/schedule/ScheduleService.java
index 6130515..109e14c 100644
--- a/src/main/java/com/mzl/flower/schedule/ScheduleService.java
+++ b/src/main/java/com/mzl/flower/schedule/ScheduleService.java
@@ -12,6 +12,7 @@
import com.mzl.flower.mapper.partner.PartnerMapper;
import com.mzl.flower.mapper.payment.OrderMapper;
import com.mzl.flower.service.coupon.CouponRecordService;
+import com.mzl.flower.service.coupon.CouponTemplateService2;
import com.mzl.flower.service.flower.FlowerCategoryService;
import com.mzl.flower.service.flower.FlowerService;
import com.mzl.flower.service.menber.impl.GrowthValueDealService;
@@ -70,6 +71,9 @@
@Autowired
private MemberGrowthRecordMapper memberGrowthRecordMapper;
+
+ @Autowired
+ private CouponTemplateService2 couponTemplateService2;
@Scheduled(cron = "1 0/30 * * * ?")
public void calculateAvePrice() {
@@ -240,4 +244,26 @@
}
+ @Scheduled(cron = "0 0/5 * * * ?")
+ public void expireActivityCouponTemplateAll() {
+ log.info("优惠券模版过期下架开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
+
+ // 下架有所的过期的优惠券
+ couponTemplateService2.expireActivityCouponTemplateAll();
+
+ log.info("优惠券模版过期下架开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
+ }
+
+ @Scheduled(cron = "0 0/5 * * * ?")
+ public void expireCouponRecordAll() {
+ log.info("优惠券记录过期开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
+
+ // 下架有所的过期的优惠券
+ couponRecordService.expireCouponRecordAll();
+
+ log.info("优惠券记录过期开始:" + DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
+ }
+
+
+
}
--
Gitblit v1.9.3