未发送的 任务 要 删除

发送的任务 券 发送时间执行 发放
This commit is contained in:
2025-10-17 16:09:19 +08:00
parent fc6aaf8b35
commit 8d41b4c2a9
7 changed files with 118 additions and 30 deletions

View File

@@ -3,6 +3,7 @@ package com.czg.config;
import com.czg.account.service.ShopTableService;
import com.czg.market.entity.MkShopCouponRecord;
import com.czg.market.service.MkShopCouponRecordService;
import com.czg.market.service.SmsPushEventService;
import com.czg.order.service.OrderInfoService;
import com.mybatisflex.core.query.QueryWrapper;
import jakarta.annotation.Resource;
@@ -34,6 +35,8 @@ public class RedisKeyExpirationListener implements MessageListener {
private ShopTableService tableService;
@Resource
private MkShopCouponRecordService mkShopCouponRecordService;
@Resource
private SmsPushEventService smsPushEventService;
//redis key失效监听
@@ -66,6 +69,10 @@ public class RedisKeyExpirationListener implements MessageListener {
.eq(MkShopCouponRecord::getStatus, 0)
.eq(MkShopCouponRecord::getId, Long.parseLong(couponId))
);
} else if (expiredKey.startsWith(RedisCst.classKeyExpired.EXPIRED_SMS)) {
log.info("监听到短信定时发放优惠券,sms_push_event任务Id: {}", expiredKey);
String eventId = expiredKey.substring(RedisCst.classKeyExpired.EXPIRED_SMS.length());
smsPushEventService.sendPushEventCoupon(eventId);
}
}
}