【fix sonar】 QuartzJobServiceImpl.java 文件

This commit is contained in:
tianwenbo
2023-03-07 17:10:21 +08:00
parent d6fe8c9a1d
commit e64cf04292
@@ -48,12 +48,10 @@ public class QuartzJobServiceImpl extends ServiceImpl<QuartzJobMapper, QuartzJob
// DB设置修改
quartzJob.setDelFlag(CommonConstant.DEL_FLAG_0);
boolean success = this.save(quartzJob);
if (success) {
if (CommonConstant.STATUS_NORMAL.equals(quartzJob.getStatus())) {
if (success && CommonConstant.STATUS_NORMAL.equals(quartzJob.getStatus())) {
// 定时器添加
this.schedulerAdd(quartzJob.getId(), quartzJob.getJobClassName().trim(), quartzJob.getCronExpression().trim(), quartzJob.getParameter());
}
}
return success;
}
@@ -71,6 +69,7 @@ public class QuartzJobServiceImpl extends ServiceImpl<QuartzJobMapper, QuartzJob
/**
* 编辑&启停定时任务
*
* @throws SchedulerException
*/
@Override
@@ -92,8 +91,8 @@ public class QuartzJobServiceImpl extends ServiceImpl<QuartzJobMapper, QuartzJob
@Transactional(rollbackFor = JeroBootException.class)
public boolean deleteAndStopJob(QuartzJob job) {
schedulerDelete(job.getId());
boolean ok = this.removeById(job.getId());
return ok;
// boolean ok = this.removeById(job.getId());
return this.removeById(job.getId());
}
@Override