From 6c305f4cd1629a7fb14af749910540cc164db820 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Tue, 20 Jan 2026 20:26:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(task):=20=E4=BC=98=E5=8C=96=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E9=80=9A=E7=9F=A5=E4=BB=BB=E5=8A=A1=E7=9A=84=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E9=A2=91=E7=8E=87=E5=92=8C=E6=97=B6=E9=97=B4=E8=8C=83?= =?UTF-8?q?=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除未使用的ZtMessageProducerService和NotificationAuthUtils依赖注入 - 将定时任务执行时间从每天21点调整为每天9点和21点 - 将查询时间范围从24小时缩短为12小时,提高查询效率 - 保持用户去重逻辑以避免重复发送通知 --- .../com/ycwl/basic/task/DownloadNotificationTasker.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ycwl/basic/task/DownloadNotificationTasker.java b/src/main/java/com/ycwl/basic/task/DownloadNotificationTasker.java index 127e7520..07a62fc5 100644 --- a/src/main/java/com/ycwl/basic/task/DownloadNotificationTasker.java +++ b/src/main/java/com/ycwl/basic/task/DownloadNotificationTasker.java @@ -46,18 +46,14 @@ public class DownloadNotificationTasker { @Autowired private WechatSubscribeNotifyTriggerService notifyTriggerService; @Autowired - private ZtMessageProducerService ztMessageProducerService; - @Autowired - private NotificationAuthUtils notificationAuthUtils; - @Autowired private VideoTaskRepository videoTaskRepository; - @Scheduled(cron = "0 0 21 * * *") + @Scheduled(cron = "0 0 9,21 * * *") public void sendDownloadNotification() { log.info("开始执行定时任务"); // 用于记录已发送通知的用户ID,避免重复发送 Set sentMemberIds = ConcurrentHashMap.newKeySet(); - videoMapper.listRelationByCreateTime(new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000), new Date()) + videoMapper.listRelationByCreateTime(new Date(System.currentTimeMillis() - 12 * 60 * 60 * 1000), new Date()) .forEach(item -> { // 检查该用户是否已经发送过通知,避免重复发送 if (sentMemberIds.contains(item.getMemberId())) {