From fcbc16f4f92c2743e4727582874404459e243176 Mon Sep 17 00:00:00 2001 From: hupeng Date: Wed, 17 Oct 2018 17:52:24 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=8D=A1=E5=88=B8][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E4=BD=9C=E5=BA=9F=E5=B7=B2=E7=BB=8F=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=95=86=E6=88=B7=E7=9A=84=E5=8D=A1=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/iformall/schedule/CouponExpiringSchedule.java | 4 +++- .../src/main/java/com/iformall/mapper/WxCouponMapper.java | 1 + mallinkService/src/main/resources/mapper/WxCouponMapper.xml | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java b/mallinkAdmin/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java index 1a17957e1..3d514b742 100644 --- a/mallinkAdmin/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java +++ b/mallinkAdmin/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java @@ -25,10 +25,12 @@ public class CouponExpiringSchedule { @Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05 //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 public void couponExpiringSchedule() { + wxCouponMapper.offExpiriedCouponByValidDate(); + wxCouponMapper.offExpiriedCouponByMerchantStatus(); } - @Scheduled(cron = "0 5 0 * * ?") // 每天凌晨00:05 + @Scheduled(cron = "0 3 0 * * ?") // 每天凌晨00:03 //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 public void couponChannelExpiringSchedule() { diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java index 3cf600b33..06e2f2d55 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java @@ -16,4 +16,5 @@ public interface WxCouponMapper extends CommonMapper { void reduceInventory(@Param("id")Long id,@Param("number")Integer number); void offExpiriedCouponByValidDate(); + void offExpiriedCouponByMerchantStatus(); } diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 4ba7818c6..e22c91f01 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -252,4 +252,9 @@ where status = 0 and valid_type = 1 and valid_end_date < now() + + update wx_coupon c, wx_merchant m SET c.status = 1, c.update_date = now() + where c.status = 0 and m.status = 0 and m.id = c.merchant_id + +