【fix sonar】 QuartzJobServiceImpl.java 文件
This commit is contained in:
+4
-5
@@ -48,12 +48,10 @@ public class QuartzJobServiceImpl extends ServiceImpl<QuartzJobMapper, QuartzJob
|
|||||||
// DB设置修改
|
// DB设置修改
|
||||||
quartzJob.setDelFlag(CommonConstant.DEL_FLAG_0);
|
quartzJob.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||||
boolean success = this.save(quartzJob);
|
boolean success = this.save(quartzJob);
|
||||||
if (success) {
|
if (success && CommonConstant.STATUS_NORMAL.equals(quartzJob.getStatus())) {
|
||||||
if (CommonConstant.STATUS_NORMAL.equals(quartzJob.getStatus())) {
|
|
||||||
// 定时器添加
|
// 定时器添加
|
||||||
this.schedulerAdd(quartzJob.getId(), quartzJob.getJobClassName().trim(), quartzJob.getCronExpression().trim(), quartzJob.getParameter());
|
this.schedulerAdd(quartzJob.getId(), quartzJob.getJobClassName().trim(), quartzJob.getCronExpression().trim(), quartzJob.getParameter());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,6 +69,7 @@ public class QuartzJobServiceImpl extends ServiceImpl<QuartzJobMapper, QuartzJob
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑&启停定时任务
|
* 编辑&启停定时任务
|
||||||
|
*
|
||||||
* @throws SchedulerException
|
* @throws SchedulerException
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -92,8 +91,8 @@ public class QuartzJobServiceImpl extends ServiceImpl<QuartzJobMapper, QuartzJob
|
|||||||
@Transactional(rollbackFor = JeroBootException.class)
|
@Transactional(rollbackFor = JeroBootException.class)
|
||||||
public boolean deleteAndStopJob(QuartzJob job) {
|
public boolean deleteAndStopJob(QuartzJob job) {
|
||||||
schedulerDelete(job.getId());
|
schedulerDelete(job.getId());
|
||||||
boolean ok = this.removeById(job.getId());
|
// boolean ok = this.removeById(job.getId());
|
||||||
return ok;
|
return this.removeById(job.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user