生日提醒重置

This commit is contained in:
2025-10-17 10:48:37 +08:00
parent a86a2fbdac
commit b67969e032
5 changed files with 21 additions and 5 deletions

View File

@@ -12,11 +12,16 @@ public class AAMarketTasks {
//生日有礼奖励发放
@Resource
private BirthdayGiftTask birthdayGiftTask;
//每天12时0分 0秒 执行
@Scheduled(cron = "0 0 12 * * ?")
//每天0时0分0秒 执行
@Scheduled(cron = "0 0 0 * * ?")
public void birthdayGiftTask() {
birthdayGiftTask.deliver();
}
//会员生日弹窗提醒重置 每年1月1日
@Scheduled(cron = "0 0 0 1 1 ?")
public void birthdayGiftRemindTask() {
birthdayGiftTask.remind();
}
//优惠券 过期

View File

@@ -27,13 +27,20 @@ import java.util.List;
public class BirthdayGiftTask {
@Resource
private MkBirthdayGiftService birthdayGiftService;
@DubboReference
private ShopUserService shopUserService;
/**
* 生日有礼奖励发放
* AAMarketTasks 统一调用位置
*/
@Scheduled(cron = "0 0 0 * * ?")
// @Scheduled(cron = "0 0 0 * * ?")
public void deliver() {
birthdayGiftService.deliver();
}
public void remind() {
shopUserService.update(new ShopUser().setBirthDayRemind(0), new QueryWrapper()
.isNotNull(ShopUser::getBirthDay).eq(ShopUser::getBirthDayRemind, 1));
}
}