diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java index 85e3dd61c..15ba52a35 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/CouponExpiringSchedule.java @@ -52,8 +52,8 @@ public class CouponExpiringSchedule { List malls = getMalls(); for (WxMall mall : malls) { try { - wxCouponMapper.offExpiriedCouponByValidDate(); - wxCouponMapper.offExpiriedCouponByMerchantStatus(); + wxCouponMapper.offExpiriedCouponByValidDate(mall.getTenantId()); + wxCouponMapper.offExpiriedCouponByMerchantStatus(mall.getTenantId()); wxCouponSendMapper.offExpiriedCouponSendByCouponStatus(); wxCouponChannelMapper.offExpiriedCouponChannelByCouponStatus(mall.getTenantId()); diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java index 0e9ace2bf..bcb026545 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java @@ -28,9 +28,9 @@ public interface WxCouponMapper extends CommonMapper { Integer backInventory(@Param("id")Long id,@Param("tenantId")String tenantId, @Param("number")Integer number,@Param("remainInventory")Integer remainInventory); - void offExpiriedCouponByValidDate(); + void offExpiriedCouponByValidDate(@Param("tenantId")String tenantId); - void offExpiriedCouponByMerchantStatus(); + void offExpiriedCouponByMerchantStatus(@Param("tenantId")String tenantId); /** * 查询时间段内销售金额 diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 269728cad..853cddeb2 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -684,15 +684,15 @@ update wx_coupon SET remain_inventory = remain_inventory + #{number} where id = #{id} and tenant_id =#{tenantId} and remain_inventory + #{number} <= inventory - + update wx_coupon SET status = 1, update_date = now() - where status = 0 and valid_type = 1 and valid_end_date < now() + where status = 0 and tenant_id =#{tenantId} and valid_type = 1 and valid_end_date < now() - + update wx_coupon c SET c.status = 1, c.update_date = now() - where c.status = 0 and + where c.status = 0 and c.tenant_id =#{tenantId} and (select count(*) from wx_coupon_merchant cm, wx_merchant m where m.id = cm.merchant_id and c.id = cm.product_id