diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 702349c1..239e5a2d 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1461,6 +1461,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 8、升级xxl-rpc至较新版本,并清理冗余POM; - 9、注册表索引优化,缓解锁表问题; - 10、新增Jboot执行器Sample示例项目; +- 11、任务列表支持根据状态筛选; ### TODO LIST diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java index c6cb7e8f..a296922b 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java @@ -142,7 +142,7 @@ public class JobGroupController { public ReturnT remove(int id){ // valid - int count = xxlJobInfoDao.pageListCount(0, 10, id, null, null); + int count = xxlJobInfoDao.pageListCount(0, 10, id, -1, null, null); if (count > 0) { return new ReturnT(500, I18nUtil.getString("jobgroup_del_limit_0") ); } diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java index 30047cf5..f798286f 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java @@ -94,9 +94,9 @@ public class JobInfoController { @ResponseBody public Map pageList(@RequestParam(required = false, defaultValue = "0") int start, @RequestParam(required = false, defaultValue = "10") int length, - int jobGroup, String jobDesc, String executorHandler, String filterTime) { + int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String filterTime) { - return xxlJobService.pageList(start, length, jobGroup, jobDesc, executorHandler, filterTime); + return xxlJobService.pageList(start, length, jobGroup, triggerStatus, jobDesc, executorHandler, filterTime); } @RequestMapping("/add") diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobInfoDao.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobInfoDao.java index 3cb89ad2..bf4c2bc2 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobInfoDao.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobInfoDao.java @@ -17,11 +17,13 @@ public interface XxlJobInfoDao { public List pageList(@Param("offset") int offset, @Param("pagesize") int pagesize, @Param("jobGroup") int jobGroup, + @Param("triggerStatus") int triggerStatus, @Param("jobDesc") String jobDesc, @Param("executorHandler") String executorHandler); public int pageListCount(@Param("offset") int offset, @Param("pagesize") int pagesize, @Param("jobGroup") int jobGroup, + @Param("triggerStatus") int triggerStatus, @Param("jobDesc") String jobDesc, @Param("executorHandler") String executorHandler); diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java index e8ef4329..f4c44937 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java @@ -25,7 +25,7 @@ public interface XxlJobService { * @param filterTime * @return */ - public Map pageList(int start, int length, int jobGroup, String jobDesc, String executorHandler, String filterTime); + public Map pageList(int start, int length, int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String filterTime); /** * add job diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java index d80ac566..469583cb 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java @@ -41,11 +41,11 @@ public class XxlJobServiceImpl implements XxlJobService { private XxlJobLogGlueDao xxlJobLogGlueDao; @Override - public Map pageList(int start, int length, int jobGroup, String jobDesc, String executorHandler, String filterTime) { + public Map pageList(int start, int length, int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String filterTime) { // page list - List list = xxlJobInfoDao.pageList(start, length, jobGroup, jobDesc, executorHandler); - int list_count = xxlJobInfoDao.pageListCount(start, length, jobGroup, jobDesc, executorHandler); + List list = xxlJobInfoDao.pageList(start, length, jobGroup, triggerStatus, jobDesc, executorHandler); + int list_count = xxlJobInfoDao.pageListCount(start, length, jobGroup, triggerStatus, jobDesc, executorHandler); // package result Map maps = new HashMap(); diff --git a/xxl-job-admin/src/main/resources/i18n/message.properties b/xxl-job-admin/src/main/resources/i18n/message.properties index 12200909..29768e71 100644 --- a/xxl-job-admin/src/main/resources/i18n/message.properties +++ b/xxl-job-admin/src/main/resources/i18n/message.properties @@ -101,7 +101,7 @@ job_dashboard_rate_report=成功比例图 ## job info jobinfo_name=任务管理 jobinfo_job=任务 -jobinfo_field_add=新增任务 +jobinfo_field_add=新增 jobinfo_field_update=更新任务 jobinfo_field_id=任务ID jobinfo_field_jobgroup=执行器 diff --git a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml index 3380b251..765440e2 100644 --- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml +++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml @@ -67,6 +67,9 @@ AND t.job_group = #{jobGroup} + + AND t.trigger_status = #{triggerStatus} + AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%') @@ -85,6 +88,9 @@ AND t.job_group = #{jobGroup} + + AND t.trigger_status = #{triggerStatus} + AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%') diff --git a/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js b/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js index 1a2b4e5e..0a70c88c 100644 --- a/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js +++ b/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js @@ -11,6 +11,7 @@ $(function() { data : function ( d ) { var obj = {}; obj.jobGroup = $('#jobGroup').val(); + obj.triggerStatus = $('#triggerStatus').val(); obj.jobDesc = $('#jobDesc').val(); obj.executorHandler = $('#executorHandler').val(); obj.start = d.start; diff --git a/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl b/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl index 161aeff5..7dcfde0f 100644 --- a/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl +++ b/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl @@ -35,6 +35,15 @@ +
+
+ +
+
${I18n.jobinfo_field_jobdesc} @@ -50,7 +59,7 @@
-
+
diff --git a/xxl-job-admin/src/test/java/com/xxl/job/admin/dao/XxlJobInfoDaoTest.java b/xxl-job-admin/src/test/java/com/xxl/job/admin/dao/XxlJobInfoDaoTest.java index 741f6cb1..b43a430e 100644 --- a/xxl-job-admin/src/test/java/com/xxl/job/admin/dao/XxlJobInfoDaoTest.java +++ b/xxl-job-admin/src/test/java/com/xxl/job/admin/dao/XxlJobInfoDaoTest.java @@ -19,8 +19,8 @@ public class XxlJobInfoDaoTest { @Test public void pageList(){ - List list = xxlJobInfoDao.pageList(0, 20, 0, null, null); - int list_count = xxlJobInfoDao.pageListCount(0, 20, 0, null, null); + List list = xxlJobInfoDao.pageList(0, 20, 0, -1, null, null); + int list_count = xxlJobInfoDao.pageListCount(0, 20, 0, -1, null, null); System.out.println(list); System.out.println(list_count);