若依 4.2
This commit is contained in:
@ -9,15 +9,19 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.quartz.domain.SysJob;
|
||||
import com.ruoyi.quartz.domain.SysJobLog;
|
||||
import com.ruoyi.quartz.service.ISysJobLogService;
|
||||
import com.ruoyi.quartz.service.ISysJobService;
|
||||
|
||||
/**
|
||||
* 调度日志操作处理
|
||||
@ -30,13 +34,21 @@ public class SysJobLogController extends BaseController
|
||||
{
|
||||
private String prefix = "monitor/job";
|
||||
|
||||
@Autowired
|
||||
private ISysJobService jobService;
|
||||
|
||||
@Autowired
|
||||
private ISysJobLogService jobLogService;
|
||||
|
||||
@RequiresPermissions("monitor:job:view")
|
||||
@GetMapping()
|
||||
public String jobLog()
|
||||
public String jobLog(@RequestParam(value = "jobId", required = false) Long jobId, ModelMap mmap)
|
||||
{
|
||||
if (StringUtils.isNotNull(jobId))
|
||||
{
|
||||
SysJob job = jobService.selectJobById(jobId);
|
||||
mmap.put("job", job);
|
||||
}
|
||||
return prefix + "/jobLog";
|
||||
}
|
||||
|
||||
|
@ -34,15 +34,16 @@ public class SysJobServiceImpl implements ISysJobService
|
||||
|
||||
/**
|
||||
* 项目启动时,初始化定时器
|
||||
* 主要是防止手动修改数据库导致未同步到定时任务处理(注:不能手动修改数据库ID和任务组名,否则会导致脏数据)
|
||||
主要是防止手动修改数据库导致未同步到定时任务处理(注:不能手动修改数据库ID和任务组名,否则会导致脏数据)
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() throws SchedulerException, TaskException
|
||||
{
|
||||
scheduler.clear();
|
||||
List<SysJob> jobList = jobMapper.selectJobAll();
|
||||
for (SysJob job : jobList)
|
||||
{
|
||||
updateSchedulerJob(job, job.getJobGroup());
|
||||
ScheduleUtils.createScheduleJob(scheduler, job);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ public class JobInvokeUtil
|
||||
/**
|
||||
* 校验是否为为class包名
|
||||
*
|
||||
* @param str 名称
|
||||
* @param invokeTarget 名称
|
||||
* @return true是 false否
|
||||
*/
|
||||
public static boolean isValidClassName(String invokeTarget)
|
||||
|
Reference in New Issue
Block a user