From d46bc28a04d0c9127d52d020253c8a34b2c5af1e Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Fri, 14 Jul 2017 21:03:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=97=A5=E5=BF=97=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=A0=B9=E6=8D=AE=E8=BF=90=E8=A1=8C=20"?= =?UTF-8?q?=E7=8A=B6=E6=80=81"=20=E7=AD=9B=E9=80=89=E6=97=A5=E5=BF=97?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/tables_xxl_job.sql | 4 ++-- .../admin/controller/JobLogController.java | 6 ++--- .../com/xxl/job/admin/dao/IXxlJobLogDao.java | 4 ++-- .../job/admin/dao/impl/XxlJobLogDaoImpl.java | 6 +++-- .../mybatis-mapper/XxlJobLogMapper.xml | 24 +++++++++++++++++++ .../WEB-INF/template/joblog/joblog.index.ftl | 17 +++++++++++-- .../main/webapp/static/js/joblog.index.1.js | 1 + 7 files changed, 51 insertions(+), 11 deletions(-) diff --git a/db/tables_xxl_job.sql b/db/tables_xxl_job.sql index 0bafc29c..585467c5 100644 --- a/db/tables_xxl_job.sql +++ b/db/tables_xxl_job.sql @@ -176,10 +176,10 @@ CREATE TABLE `XXL_JOB_QRTZ_TRIGGER_LOG` ( `executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler', `executor_param` varchar(255) DEFAULT NULL COMMENT 'executor_param', `trigger_time` datetime DEFAULT NULL COMMENT '调度-时间', - `trigger_code` varchar(255) DEFAULT NULL COMMENT '调度-结果', + `trigger_code` varchar(255) NOT NULL DEFAULT '0' COMMENT '调度-结果', `trigger_msg` varchar(2048) DEFAULT NULL COMMENT '调度-日志', `handle_time` datetime DEFAULT NULL COMMENT '执行-时间', - `handle_code` varchar(255) DEFAULT NULL COMMENT '执行-状态', + `handle_code` varchar(255) NOT NULL DEFAULT '0' COMMENT '执行-状态', `handle_msg` varchar(2048) DEFAULT NULL COMMENT '执行-日志', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java index 5604604d..2ea20ae4 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java @@ -67,7 +67,7 @@ public class JobLogController { @ResponseBody public Map pageList(@RequestParam(required = false, defaultValue = "0") int start, @RequestParam(required = false, defaultValue = "10") int length, - int jobGroup, int jobId, String filterTime) { + int jobGroup, int jobId, int logStatus, String filterTime) { // parse param Date triggerTimeStart = null; @@ -83,8 +83,8 @@ public class JobLogController { } // page query - List list = xxlJobLogDao.pageList(start, length, jobGroup, jobId, triggerTimeStart, triggerTimeEnd); - int list_count = xxlJobLogDao.pageListCount(start, length, jobGroup, jobId, triggerTimeStart, triggerTimeEnd); + List list = xxlJobLogDao.pageList(start, length, jobGroup, jobId, triggerTimeStart, triggerTimeEnd, logStatus); + int list_count = xxlJobLogDao.pageListCount(start, length, jobGroup, jobId, triggerTimeStart, triggerTimeEnd, logStatus); // package result Map maps = new HashMap(); diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/IXxlJobLogDao.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/IXxlJobLogDao.java index a8cb8142..62044ef5 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/IXxlJobLogDao.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/IXxlJobLogDao.java @@ -12,8 +12,8 @@ import java.util.Map; */ public interface IXxlJobLogDao { - public List pageList(int offset, int pagesize, int jobGroup, int jobId, Date triggerTimeStart, Date triggerTimeEnd); - public int pageListCount(int offset, int pagesize, int jobGroup, int jobId, Date triggerTimeStart, Date triggerTimeEnd); + public List pageList(int offset, int pagesize, int jobGroup, int jobId, Date triggerTimeStart, Date triggerTimeEnd, int logStatus); + public int pageListCount(int offset, int pagesize, int jobGroup, int jobId, Date triggerTimeStart, Date triggerTimeEnd, int logStatus); public XxlJobLog load(int id); diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/impl/XxlJobLogDaoImpl.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/impl/XxlJobLogDaoImpl.java index 3e184cb0..328f285b 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/impl/XxlJobLogDaoImpl.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/impl/XxlJobLogDaoImpl.java @@ -22,7 +22,7 @@ public class XxlJobLogDaoImpl implements IXxlJobLogDao { public SqlSessionTemplate sqlSessionTemplate; @Override - public List pageList(int offset, int pagesize, int jobGroup, int jobId, Date triggerTimeStart, Date triggerTimeEnd) { + public List pageList(int offset, int pagesize, int jobGroup, int jobId, Date triggerTimeStart, Date triggerTimeEnd, int logStatus) { HashMap params = new HashMap(); params.put("offset", offset); params.put("pagesize", pagesize); @@ -30,12 +30,13 @@ public class XxlJobLogDaoImpl implements IXxlJobLogDao { params.put("jobId", jobId); params.put("triggerTimeStart", triggerTimeStart); params.put("triggerTimeEnd", triggerTimeEnd); + params.put("logStatus", logStatus); return sqlSessionTemplate.selectList("XxlJobLogMapper.pageList", params); } @Override - public int pageListCount(int offset, int pagesize, int jobGroup, int jobId, Date triggerTimeStart, Date triggerTimeEnd) { + public int pageListCount(int offset, int pagesize, int jobGroup, int jobId, Date triggerTimeStart, Date triggerTimeEnd, int logStatus) { HashMap params = new HashMap(); params.put("offset", offset); params.put("pagesize", pagesize); @@ -43,6 +44,7 @@ public class XxlJobLogDaoImpl implements IXxlJobLogDao { params.put("jobId", jobId); params.put("triggerTimeStart", triggerTimeStart); params.put("triggerTimeEnd", triggerTimeEnd); + params.put("logStatus", logStatus); return sqlSessionTemplate.selectOne("XxlJobLogMapper.pageListCount", params); } diff --git a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml index 5a473ed8..c5ae9e78 100644 --- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml +++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml @@ -57,6 +57,18 @@ AND t.trigger_time #{triggerTimeEnd} + + AND t.handle_code = 200 + + + AND ( + (t.trigger_code ]]> 0 AND t.trigger_code!=200) || + (t.handle_code ]]> 0 AND t.handle_code!=200) + ) + + + AND (t.trigger_code = 200 AND t.handle_code=0) + ORDER BY id DESC LIMIT #{offset}, #{pagesize} @@ -78,6 +90,18 @@ AND t.trigger_time #{triggerTimeEnd} + + AND t.handle_code = 200 + + + AND ( + (t.trigger_code ]]> 0 AND t.trigger_code!=200) || + (t.handle_code ]]> 0 AND t.handle_code!=200) + ) + + + AND (t.trigger_code = 200 AND t.handle_code=0) + diff --git a/xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl b/xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl index a7500da2..f653e7a8 100644 --- a/xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl +++ b/xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl @@ -32,7 +32,7 @@
-
+
执行器
-
+
任务
+ +
+
+ 状态 + +
+
+
diff --git a/xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js b/xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js index 237dfb8a..973fe2c7 100644 --- a/xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js +++ b/xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js @@ -78,6 +78,7 @@ $(function() { var obj = {}; obj.jobGroup = $('#jobGroup').val(); obj.jobId = $('#jobId').val(); + obj.logStatus = $('#logStatus').val(); obj.filterTime = $('#filterTime').val(); obj.start = d.start; obj.length = d.length;