提交 | 用户 | 时间
|
fd2207
|
1 |
package com.jcdm.quartz.domain; |
懒 |
2 |
|
|
3 |
import java.util.Date; |
|
4 |
import javax.validation.constraints.NotBlank; |
|
5 |
import javax.validation.constraints.Size; |
|
6 |
import org.apache.commons.lang3.builder.ToStringBuilder; |
|
7 |
import org.apache.commons.lang3.builder.ToStringStyle; |
|
8 |
import com.fasterxml.jackson.annotation.JsonFormat; |
|
9 |
import com.jcdm.common.annotation.Excel; |
|
10 |
import com.jcdm.common.annotation.Excel.ColumnType; |
|
11 |
import com.jcdm.common.constant.ScheduleConstants; |
|
12 |
import com.jcdm.common.core.domain.BaseEntity; |
|
13 |
import com.jcdm.common.utils.StringUtils; |
|
14 |
import com.jcdm.quartz.util.CronUtils; |
|
15 |
|
|
16 |
/** |
|
17 |
* 定时任务调度表 sys_job |
|
18 |
* |
|
19 |
* @author jc |
|
20 |
*/ |
|
21 |
public class SysJob extends BaseEntity |
|
22 |
{ |
|
23 |
private static final long serialVersionUID = 1L; |
|
24 |
|
|
25 |
/** 任务ID */ |
|
26 |
@Excel(name = "任务序号", cellType = ColumnType.NUMERIC) |
|
27 |
private Long jobId; |
|
28 |
|
|
29 |
/** 任务名称 */ |
|
30 |
@Excel(name = "任务名称") |
|
31 |
private String jobName; |
|
32 |
|
|
33 |
/** 任务组名 */ |
|
34 |
@Excel(name = "任务组名") |
|
35 |
private String jobGroup; |
|
36 |
|
|
37 |
/** 调用目标字符串 */ |
|
38 |
@Excel(name = "调用目标字符串") |
|
39 |
private String invokeTarget; |
|
40 |
|
|
41 |
/** cron执行表达式 */ |
|
42 |
@Excel(name = "执行表达式 ") |
|
43 |
private String cronExpression; |
|
44 |
|
|
45 |
/** cron计划策略 */ |
|
46 |
@Excel(name = "计划策略 ", readConverterExp = "0=默认,1=立即触发执行,2=触发一次执行,3=不触发立即执行") |
|
47 |
private String misfirePolicy = ScheduleConstants.MISFIRE_DEFAULT; |
|
48 |
|
|
49 |
/** 是否并发执行(0允许 1禁止) */ |
|
50 |
@Excel(name = "并发执行", readConverterExp = "0=允许,1=禁止") |
|
51 |
private String concurrent; |
|
52 |
|
|
53 |
/** 任务状态(0正常 1暂停) */ |
|
54 |
@Excel(name = "任务状态", readConverterExp = "0=正常,1=暂停") |
|
55 |
private String status; |
|
56 |
|
|
57 |
public Long getJobId() |
|
58 |
{ |
|
59 |
return jobId; |
|
60 |
} |
|
61 |
|
|
62 |
public void setJobId(Long jobId) |
|
63 |
{ |
|
64 |
this.jobId = jobId; |
|
65 |
} |
|
66 |
|
|
67 |
@NotBlank(message = "任务名称不能为空") |
|
68 |
@Size(min = 0, max = 64, message = "任务名称不能超过64个字符") |
|
69 |
public String getJobName() |
|
70 |
{ |
|
71 |
return jobName; |
|
72 |
} |
|
73 |
|
|
74 |
public void setJobName(String jobName) |
|
75 |
{ |
|
76 |
this.jobName = jobName; |
|
77 |
} |
|
78 |
|
|
79 |
public String getJobGroup() |
|
80 |
{ |
|
81 |
return jobGroup; |
|
82 |
} |
|
83 |
|
|
84 |
public void setJobGroup(String jobGroup) |
|
85 |
{ |
|
86 |
this.jobGroup = jobGroup; |
|
87 |
} |
|
88 |
|
|
89 |
@NotBlank(message = "调用目标字符串不能为空") |
|
90 |
@Size(min = 0, max = 500, message = "调用目标字符串长度不能超过500个字符") |
|
91 |
public String getInvokeTarget() |
|
92 |
{ |
|
93 |
return invokeTarget; |
|
94 |
} |
|
95 |
|
|
96 |
public void setInvokeTarget(String invokeTarget) |
|
97 |
{ |
|
98 |
this.invokeTarget = invokeTarget; |
|
99 |
} |
|
100 |
|
|
101 |
@NotBlank(message = "Cron执行表达式不能为空") |
|
102 |
@Size(min = 0, max = 255, message = "Cron执行表达式不能超过255个字符") |
|
103 |
public String getCronExpression() |
|
104 |
{ |
|
105 |
return cronExpression; |
|
106 |
} |
|
107 |
|
|
108 |
public void setCronExpression(String cronExpression) |
|
109 |
{ |
|
110 |
this.cronExpression = cronExpression; |
|
111 |
} |
|
112 |
|
|
113 |
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|
114 |
public Date getNextValidTime() |
|
115 |
{ |
|
116 |
if (StringUtils.isNotEmpty(cronExpression)) |
|
117 |
{ |
|
118 |
return CronUtils.getNextExecution(cronExpression); |
|
119 |
} |
|
120 |
return null; |
|
121 |
} |
|
122 |
|
|
123 |
public String getMisfirePolicy() |
|
124 |
{ |
|
125 |
return misfirePolicy; |
|
126 |
} |
|
127 |
|
|
128 |
public void setMisfirePolicy(String misfirePolicy) |
|
129 |
{ |
|
130 |
this.misfirePolicy = misfirePolicy; |
|
131 |
} |
|
132 |
|
|
133 |
public String getConcurrent() |
|
134 |
{ |
|
135 |
return concurrent; |
|
136 |
} |
|
137 |
|
|
138 |
public void setConcurrent(String concurrent) |
|
139 |
{ |
|
140 |
this.concurrent = concurrent; |
|
141 |
} |
|
142 |
|
|
143 |
public String getStatus() |
|
144 |
{ |
|
145 |
return status; |
|
146 |
} |
|
147 |
|
|
148 |
public void setStatus(String status) |
|
149 |
{ |
|
150 |
this.status = status; |
|
151 |
} |
|
152 |
|
|
153 |
@Override |
|
154 |
public String toString() { |
|
155 |
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|
156 |
.append("jobId", getJobId()) |
|
157 |
.append("jobName", getJobName()) |
|
158 |
.append("jobGroup", getJobGroup()) |
|
159 |
.append("cronExpression", getCronExpression()) |
|
160 |
.append("nextValidTime", getNextValidTime()) |
|
161 |
.append("misfirePolicy", getMisfirePolicy()) |
|
162 |
.append("concurrent", getConcurrent()) |
|
163 |
.append("status", getStatus()) |
|
164 |
.append("createBy", getCreateBy()) |
|
165 |
.append("createTime", getCreateTime()) |
|
166 |
.append("updateBy", getUpdateBy()) |
|
167 |
.append("updateTime", getUpdateTime()) |
|
168 |
.append("remark", getRemark()) |
|
169 |
.toString(); |
|
170 |
} |
|
171 |
} |