未发送的 任务 要 删除
发送的任务 券 发送时间执行 发放
This commit is contained in:
@@ -5,6 +5,7 @@ import com.czg.market.service.SmsPushEventService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -45,6 +46,16 @@ public class SmsPushEventController {
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
@PutMapping
|
||||
public CzgResult<Void> upPushEvent(@RequestBody @Validated(UpdateGroup.class) SmsPushEventDTO param) {
|
||||
param.setShopId(StpKit.USER.getShopId());
|
||||
pushEventService.upPushEvent(param);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user