wlzboy
6 天以前 09e6dc3fb7266620fafb5e341808a8eb36e080a1
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
package com.ruoyi.system.domain;
 
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
 
/**
 * 通知发送记录对象 sys_notify_send_log
 * 用于记录各类通知消息的发送记录,实现防重机制
 * 
 * @author ruoyi
 * @date 2025-12-07
 */
public class NotifySendLog extends BaseEntity {
 
    private static final long serialVersionUID = 1L;
 
    /** 主键ID */
    private Long id;
 
    /** 关联的通知任务ID */
    @Excel(name = "通知任务ID")
    private Long notifyTaskId;
 
    /** 任务ID */
    @Excel(name = "任务ID")
    private Long taskId;
 
    /** 接收用户ID */
    @Excel(name = "用户ID")
    private Long userId;
 
    /** 接收用户姓名 */
    @Excel(name = "用户姓名")
    private String userName;
 
    /** 通知类型:TASK_ASSIGN-任务分配, STATUS_CHANGE-状态变更, TASK_CREATE-任务创建 */
    @Excel(name = "通知类型")
    private String notifyType;
 
    /** 通知渠道:WECHAT-微信订阅消息, SMS-短信, APP_PUSH-APP推送, SITE_MSG-站内消息 */
    @Excel(name = "通知渠道")
    private String channel;
 
    /** 发送状态:0-待发送, 1-发送成功, 2-发送失败 */
    @Excel(name = "发送状态")
    private String sendStatus;
 
    /** 发送的内容 */
    private String sendContent;
 
    /** 发送时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "发送时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date sendTime;
 
    /** 发送结果/错误信息 */
    @Excel(name = "发送结果")
    private String sendResult;
 
    /** 响应消息 */
    private String responseMsg;
 
    /** 重试次数 */
    @Excel(name = "重试次数")
    private Integer retryCount;
 
    // ==================== 通知类型常量 ====================
    /** 任务分配通知 */
    public static final String NOTIFY_TYPE_TASK_ASSIGN = "TASK_ASSIGN";
    /** 状态变更通知 */
    public static final String NOTIFY_TYPE_STATUS_CHANGE = "STATUS_CHANGE";
    /** 任务创建通知 */
    public static final String NOTIFY_TYPE_TASK_CREATE = "TASK_CREATE";
 
    // ==================== 通知渠道常量 ====================
    /** 微信订阅消息 */
    public static final String CHANNEL_WECHAT = "WECHAT";
    /** 短信 */
    public static final String CHANNEL_SMS = "SMS";
    /** APP推送 */
    public static final String CHANNEL_APP_PUSH = "APP_PUSH";
    /** 站内消息 */
    public static final String CHANNEL_SITE_MSG = "SITE_MSG";
 
    // ==================== 发送状态常量 ====================
    /** 待发送 */
    public static final String SEND_STATUS_PENDING = "0";
    /** 发送成功 */
    public static final String SEND_STATUS_SUCCESS = "1";
    /** 发送失败 */
    public static final String SEND_STATUS_FAILED = "2";
 
    public Long getId() {
        return id;
    }
 
    public void setId(Long id) {
        this.id = id;
    }
 
    public Long getNotifyTaskId() {
        return notifyTaskId;
    }
 
    public void setNotifyTaskId(Long notifyTaskId) {
        this.notifyTaskId = notifyTaskId;
    }
 
    public Long getTaskId() {
        return taskId;
    }
 
    public void setTaskId(Long taskId) {
        this.taskId = taskId;
    }
 
    public Long getUserId() {
        return userId;
    }
 
    public void setUserId(Long userId) {
        this.userId = userId;
    }
 
    public String getUserName() {
        return userName;
    }
 
    public void setUserName(String userName) {
        this.userName = userName;
    }
 
    public String getNotifyType() {
        return notifyType;
    }
 
    public void setNotifyType(String notifyType) {
        this.notifyType = notifyType;
    }
 
    public String getChannel() {
        return channel;
    }
 
    public void setChannel(String channel) {
        this.channel = channel;
    }
 
    public String getSendStatus() {
        return sendStatus;
    }
 
    public void setSendStatus(String sendStatus) {
        this.sendStatus = sendStatus;
    }
 
    public Date getSendTime() {
        return sendTime;
    }
 
    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }
 
    public String getSendResult() {
        return sendResult;
    }
 
    public void setSendResult(String sendResult) {
        this.sendResult = sendResult;
    }
 
    public String getSendContent() {
        return sendContent;
    }
 
    public void setSendContent(String sendContent) {
        this.sendContent = sendContent;
    }
 
    public String getResponseMsg() {
        return responseMsg;
    }
 
    public void setResponseMsg(String responseMsg) {
        this.responseMsg = responseMsg;
    }
 
    public Integer getRetryCount() {
        return retryCount;
    }
 
    public void setRetryCount(Integer retryCount) {
        this.retryCount = retryCount;
    }
 
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("taskId", getTaskId())
                .append("userId", getUserId())
                .append("userName", getUserName())
                .append("notifyType", getNotifyType())
                .append("channel", getChannel())
                .append("sendStatus", getSendStatus())
                .append("sendTime", getSendTime())
                .append("sendResult", getSendResult())
                .append("sendContent", getSendContent())
                .append("retryCount", getRetryCount())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .append("remark", getRemark())
                .toString();
    }
}