From b3aa981fa8547b096dd7f31a161688c546c20e35 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Fri, 29 Dec 2017 11:37:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6=20"=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=8F=8F=E8=BF=B0"=EF=BC=8C=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E4=BB=BB=E5=8A=A1=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 1 + .../xxl/job/admin/controller/JobGroupController.java | 2 +- .../xxl/job/admin/controller/JobInfoController.java | 4 ++-- .../java/com/xxl/job/admin/dao/XxlJobInfoDao.java | 12 ++++++++++-- .../com/xxl/job/admin/service/XxlJobService.java | 2 +- .../job/admin/service/impl/XxlJobServiceImpl.java | 6 +++--- .../resources/mybatis-mapper/XxlJobInfoMapper.xml | 6 ++++++ .../WEB-INF/template/jobinfo/jobinfo.index.ftl | 12 +++++++++--- .../src/main/webapp/static/js/jobinfo.index.1.js | 1 + .../com/xxl/job/admin/dao/XxlJobInfoDaoTest.java | 4 ++-- 10 files changed, 36 insertions(+), 14 deletions(-) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 57bf9abd..76a00641 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1111,6 +1111,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 27、系统安全性优化,登陆Token写Cookie时进行MD5加密,同时Cookie启用HttpOnly; - 28、新增"任务ID"属性,移除"JobKey"属性,前者承担所有功能,方便后续增强任务依赖功能。 - 29、任务循环依赖问题修复,避免子任务与父任务重复导致的调度死循环; +- 30、任务列表新增筛选条件 "任务描述",快速检索任务; ### TODO LIST - 1、任务权限管理:执行器为粒度分配权限,核心操作校验权限; 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 6211f3c7..66864075 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 @@ -100,7 +100,7 @@ public class JobGroupController { public ReturnT remove(int id){ // valid - int count = xxlJobInfoDao.pageListCount(0, 10, id, null); + int count = xxlJobInfoDao.pageListCount(0, 10, id, null, null); if (count > 0) { return new ReturnT(500, "该分组使用中, 不可删除"); } 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 0962d397..e1dfabbc 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 @@ -53,9 +53,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 executorHandler, String filterTime) { + int jobGroup, String jobDesc, String executorHandler, String filterTime) { - return xxlJobService.pageList(start, length, jobGroup, executorHandler, filterTime); + return xxlJobService.pageList(start, length, jobGroup, 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 69b556c3..92fbba4e 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 @@ -12,8 +12,16 @@ import java.util.List; */ public interface XxlJobInfoDao { - public List pageList(@Param("offset") int offset, @Param("pagesize") int pagesize, @Param("jobGroup") int jobGroup, @Param("executorHandler") String executorHandler); - public int pageListCount(@Param("offset") int offset, @Param("pagesize") int pagesize, @Param("jobGroup") int jobGroup, @Param("executorHandler") String executorHandler); + public List pageList(@Param("offset") int offset, + @Param("pagesize") int pagesize, + @Param("jobGroup") int jobGroup, + @Param("jobDesc") String jobDesc, + @Param("executorHandler") String executorHandler); + public int pageListCount(@Param("offset") int offset, + @Param("pagesize") int pagesize, + @Param("jobGroup") int jobGroup, + @Param("jobDesc") String jobDesc, + @Param("executorHandler") String executorHandler); public int save(XxlJobInfo info); 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 7a0c1607..cdea2859 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 @@ -14,7 +14,7 @@ import java.util.Map; */ public interface XxlJobService { - public Map pageList(int start, int length, int jobGroup, String executorHandler, String filterTime); + public Map pageList(int start, int length, int jobGroup, String jobDesc, String executorHandler, String filterTime); public ReturnT add(XxlJobInfo jobInfo); 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 eecef342..5b2ac09c 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 @@ -45,11 +45,11 @@ public class XxlJobServiceImpl implements XxlJobService { private XxlJobLogGlueDao xxlJobLogGlueDao; @Override - public Map pageList(int start, int length, int jobGroup, String executorHandler, String filterTime) { + public Map pageList(int start, int length, int jobGroup, String jobDesc, String executorHandler, String filterTime) { // page list - List list = xxlJobInfoDao.pageList(start, length, jobGroup, executorHandler); - int list_count = xxlJobInfoDao.pageListCount(start, length, jobGroup, executorHandler); + List list = xxlJobInfoDao.pageList(start, length, jobGroup, jobDesc, executorHandler); + int list_count = xxlJobInfoDao.pageListCount(start, length, jobGroup, jobDesc, executorHandler); // fill job info if (list!=null && list.size()>0) { 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 a5c3abd0..b1fc6302 100644 --- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml +++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml @@ -58,6 +58,9 @@ AND t.job_group = #{jobGroup} + + AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%') + AND t.executor_handler like CONCAT(CONCAT('%', #{executorHandler}), '%') @@ -73,6 +76,9 @@ AND t.job_group = #{jobGroup} + + AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%') + AND t.executor_handler like CONCAT(CONCAT('%', #{executorHandler}), '%') diff --git a/xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl b/xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl index 30de5c93..47c32b44 100644 --- a/xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl +++ b/xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl @@ -32,7 +32,7 @@
-
+
执行器
-
+
+
+ 任务描述 + +
+
+
JobHandler
-
+
diff --git a/xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js b/xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js index 74d88fc2..49fca799 100644 --- a/xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js +++ b/xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js @@ -10,6 +10,7 @@ $(function() { data : function ( d ) { var obj = {}; obj.jobGroup = $('#jobGroup').val(); + obj.jobDesc = $('#jobDesc').val(); obj.executorHandler = $('#executorHandler').val(); obj.start = d.start; obj.length = d.length; 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 87c4de9e..ca320d22 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 @@ -20,8 +20,8 @@ public class XxlJobInfoDaoTest { @Test public void pageList(){ - List list = xxlJobInfoDao.pageList(0, 20, 0, null); - int list_count = xxlJobInfoDao.pageListCount(0, 20, 0, null); + List list = xxlJobInfoDao.pageList(0, 20, 0, null, null); + int list_count = xxlJobInfoDao.pageListCount(0, 20, 0, null, null); System.out.println(list); System.out.println(list_count);