wlzboy
8 小时以前 5f2ee03958a1a16dc27195c76ea7cffb422c95d1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package com.ruoyi.system.service;
 
import com.ruoyi.system.domain.NotifyTask;
import java.util.List;
 
/**
 * 通知任务服务接口
 * 
 * @author ruoyi
 * @date 2025-12-07
 */
public interface INotifyTaskService {
 
    /**
     * 查询通知任务
     * 
     * @param id 主键ID
     * @return 通知任务
     */
    NotifyTask selectNotifyTaskById(Long id);
 
    /**
     * 查询通知任务列表
     * 
     * @param notifyTask 查询条件
     * @return 通知任务列表
     */
    List<NotifyTask> selectNotifyTaskList(NotifyTask notifyTask);
 
    /**
     * 查询待处理的通知任务
     * 
     * @param limit 查询数量限制
     * @return 待处理的通知任务列表
     */
    List<NotifyTask> selectPendingNotifyTasks(int limit);
 
    /**
     * 检查通知任务是否已存在(防重)
     * 
     * @param taskId 业务任务ID
     * @param userId 用户ID
     * @param notifyType 通知类型
     * @return true=已存在, false=不存在
     */
    boolean existsNotifyTask(Long taskId, Long userId, String notifyType);
 
    /**
     * 创建通知任务(带防重)
     * 如果已存在则返回null,否则创建并返回
     * 
     * @param notifyTask 通知任务
     * @return 创建的通知任务,如果已存在返回null
     */
    NotifyTask createNotifyTask(NotifyTask notifyTask);
 
    /**
     * 批量创建通知任务
     * 
     * @param notifyTasks 通知任务列表
     * @return 成功创建的数量
     */
    int createNotifyTasks(List<NotifyTask> notifyTasks);
 
    /**
     * 修改通知任务
     * 
     * @param notifyTask 通知任务
     * @return 影响行数
     */
    int updateNotifyTask(NotifyTask notifyTask);
 
    /**
     * 更新通知任务状态为处理中
     * 
     * @param id 主键ID
     * @return 影响行数
     */
    int markProcessing(Long id);
 
    /**
     * 更新通知任务状态为完成
     * 
     * @param id 主键ID
     * @return 影响行数
     */
    int markCompleted(Long id);
 
    /**
     * 更新通知任务状态为失败
     * 
     * @param id 主键ID
     * @param errorMsg 错误信息
     * @return 影响行数
     */
    int markFailed(Long id, String errorMsg);
 
    /**
     * 增加重试次数
     * 
     * @param id 主键ID
     * @return 影响行数
     */
    int incrementRetryCount(Long id);
 
    /**
     * 删除通知任务
     * 
     * @param id 主键ID
     * @return 影响行数
     */
    int deleteNotifyTaskById(Long id);
 
    /**
     * 批量删除通知任务
     * 
     * @param ids 主键ID数组
     * @return 影响行数
     */
    int deleteNotifyTaskByIds(Long[] ids);
}