SysJobLogController.java 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package com.ruoyi.quartz.controller;
  2. import com.ruoyi.common.annotation.Log;
  3. import com.ruoyi.common.core.controller.BaseController;
  4. import com.ruoyi.common.core.domain.AjaxResult;
  5. import com.ruoyi.common.core.page.TableDataInfo;
  6. import com.ruoyi.common.enums.BusinessType;
  7. import com.ruoyi.common.utils.poi.ExcelUtil;
  8. import com.ruoyi.quartz.domain.SysJobLog;
  9. import com.ruoyi.quartz.service.ISysJobLogService;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.security.access.prepost.PreAuthorize;
  12. import org.springframework.web.bind.annotation.*;
  13. import javax.servlet.http.HttpServletResponse;
  14. import java.util.List;
  15. /**
  16. * 调度日志操作处理
  17. *
  18. * @deprecated 3.4.0删除 迁移至xxl-job
  19. * @author ruoyi
  20. */
  21. @RestController
  22. @RequestMapping("/monitor/jobLog")
  23. public class SysJobLogController extends BaseController
  24. {
  25. @Autowired
  26. private ISysJobLogService jobLogService;
  27. /**
  28. * 查询定时任务调度日志列表
  29. */
  30. @PreAuthorize("@ss.hasPermi('monitor:job:list')")
  31. @GetMapping("/list")
  32. public TableDataInfo list(SysJobLog sysJobLog)
  33. {
  34. return jobLogService.selectPageJobLogList(sysJobLog);
  35. }
  36. /**
  37. * 导出定时任务调度日志列表
  38. */
  39. @PreAuthorize("@ss.hasPermi('monitor:job:export')")
  40. @Log(title = "任务调度日志", businessType = BusinessType.EXPORT)
  41. @GetMapping("/export")
  42. public void export(SysJobLog sysJobLog, HttpServletResponse response)
  43. {
  44. List<SysJobLog> list = jobLogService.selectJobLogList(sysJobLog);
  45. ExcelUtil.exportExcel(list, "调度日志", SysJobLog.class, response);
  46. }
  47. /**
  48. * 根据调度编号获取详细信息
  49. */
  50. @PreAuthorize("@ss.hasPermi('monitor:job:query')")
  51. @GetMapping(value = "/{configId}")
  52. public AjaxResult getInfo(@PathVariable Long jobLogId)
  53. {
  54. return AjaxResult.success(jobLogService.selectJobLogById(jobLogId));
  55. }
  56. /**
  57. * 删除定时任务调度日志
  58. */
  59. @PreAuthorize("@ss.hasPermi('monitor:job:remove')")
  60. @Log(title = "定时任务调度日志", businessType = BusinessType.DELETE)
  61. @DeleteMapping("/{jobLogIds}")
  62. public AjaxResult remove(@PathVariable Long[] jobLogIds)
  63. {
  64. return toAjax(jobLogService.deleteJobLogByIds(jobLogIds));
  65. }
  66. /**
  67. * 清空定时任务调度日志
  68. */
  69. @PreAuthorize("@ss.hasPermi('monitor:job:remove')")
  70. @Log(title = "调度日志", businessType = BusinessType.CLEAN)
  71. @DeleteMapping("/clean")
  72. public AjaxResult clean()
  73. {
  74. jobLogService.cleanJobLog();
  75. return AjaxResult.success();
  76. }
  77. }