fix user cannot start job again after a job in finished state
This commit is contained in:
parent
3b82b08fd0
commit
8687f06c18
@ -136,8 +136,8 @@ public class JmJobController {
|
|||||||
JmJobDTO job = jobService.selectDetail(id);
|
JmJobDTO job = jobService.selectDetail(id);
|
||||||
if (job == null) {
|
if (job == null) {
|
||||||
throw ServiceException.noLog("找不到任务,id=" + id);
|
throw ServiceException.noLog("找不到任务,id=" + id);
|
||||||
} else if (EnumUtil.parseEx(ExecStatusEnum.class, job.getStatus()) != ExecStatusEnum.NOT) {
|
} else if (EnumUtil.parseEx(ExecStatusEnum.class, job.getStatus()) == ExecStatusEnum.PROCESSING) {
|
||||||
throw ServiceException.noLog("任务状态不是未执行,无法起飞");
|
throw ServiceException.noLog("任务状态为执行中,无法起飞");
|
||||||
}
|
}
|
||||||
jobService.start(job);
|
jobService.start(job);
|
||||||
return "开始执行";
|
return "开始执行";
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public enum ExecStatusEnum implements CodeEnum<Integer> {
|
|||||||
|
|
||||||
OVER(2, "已完成"),
|
OVER(2, "已完成"),
|
||||||
|
|
||||||
READY(3, "就绪"),
|
//READY(3, "就绪"),
|
||||||
;
|
;
|
||||||
|
|
||||||
/** 值 */
|
/** 值 */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user