coding snapshot

v1.4
xueli.xue 9 years ago
parent 20ab6b1460
commit 8a8d7a5caf

@ -251,11 +251,21 @@ XXL-JOB会为每次调度请求生成一个单独的日志文件通过重写L
- 2、执行器异步回调执行日志 - 2、执行器异步回调执行日志
- 3、【重要】在 “调度中心” 支持HA的基础上扩展执行器的Failover支持支持配置多执行期地址 - 3、【重要】在 “调度中心” 支持HA的基础上扩展执行器的Failover支持支持配置多执行期地址
#### 4.6 版本 V1.4.0 新特性
- 1、任务依赖: 通过事件触发方式实现, 任务执行成功并回调SUCCESS时, 会主动触发一次依赖任务的调度;
- 2、调度中心任务属性调整: jobName改为系统生成, 新增任务时不需要指定;
- 3、问题修复:
- 1.1、执行器jetty关闭优化,解决一处可能导致jetty无法关闭的问题;
- 1.2、执行器任务终止时,执行队列回调优化,解决一处导致任务无法回调的问题;
- 1.3、调度中心中列表分页参数优化,解决一处因服务器限制post长度而引起的问题;
- 1.4、执行器Jobhandler注解优化,解决一处因事务代理导致的容器无法加载JobHandler的问题;
- 1.5、远程调度优化,禁用retry策略,解决一处可能导致重复调用的问题;
#### 规划中 #### 规划中
- 1、任务终止时任务队列中调度回调通过被终止的接口
- 2、任务执行规则自定义假如前一个任务正在执行后续调度执行规则支持自定义 - 2、任务执行规则自定义假如前一个任务正在执行后续调度执行规则支持自定义
串行(默认,当前逻辑):后续调度入调度队列; 串行(默认,当前逻辑):后续调度入调度队列;
并行:后续调度并行执行; 并行:后续调度并行执行;
Pass后续调度被Pass Pass后续调度被Pass
- 3、兼容oracle - 3、兼容oracle
- 4、任务依赖

@ -143,7 +143,9 @@ CREATE TABLE XXL_JOB_QRTZ_LOCKS
PRIMARY KEY (SCHED_NAME,LOCK_NAME) PRIMARY KEY (SCHED_NAME,LOCK_NAME)
); );
CREATE TABLE `xxl_job_qrtz_trigger_info` (
CREATE TABLE XXL_JOB_QRTZ_TRIGGER_INFO (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`job_group` varchar(255) NOT NULL COMMENT '任务组', `job_group` varchar(255) NOT NULL COMMENT '任务组',
`job_name` varchar(255) NOT NULL COMMENT '任务名', `job_name` varchar(255) NOT NULL COMMENT '任务名',
@ -162,9 +164,9 @@ CREATE TABLE `xxl_job_qrtz_trigger_info` (
`glue_source` text COMMENT 'GLUE源代码', `glue_source` text COMMENT 'GLUE源代码',
`glue_remark` varchar(128) DEFAULT NULL COMMENT 'GLUE备注', `glue_remark` varchar(128) DEFAULT NULL COMMENT 'GLUE备注',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `xxl_job_qrtz_trigger_log` ( CREATE TABLE XXL_JOB_QRTZ_TRIGGER_LOG (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`job_group` varchar(255) NOT NULL COMMENT '任务组', `job_group` varchar(255) NOT NULL COMMENT '任务组',
`job_name` varchar(255) NOT NULL COMMENT '任务名', `job_name` varchar(255) NOT NULL COMMENT '任务名',
@ -181,9 +183,9 @@ CREATE TABLE `xxl_job_qrtz_trigger_log` (
`handle_status` varchar(255) DEFAULT NULL COMMENT '执行-状态', `handle_status` varchar(255) DEFAULT NULL COMMENT '执行-状态',
`handle_msg` varchar(2048) DEFAULT NULL COMMENT '执行-日志', `handle_msg` varchar(2048) DEFAULT NULL COMMENT '执行-日志',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `xxl_job_qrtz_trigger_logglue` ( CREATE TABLE XXL_JOB_QRTZ_TRIGGER_LOGGLUE (
`id` int(11) NOT NULL AUTO_INCREMENT, `id` int(11) NOT NULL AUTO_INCREMENT,
`job_group` varchar(255) NOT NULL, `job_group` varchar(255) NOT NULL,
`job_name` varchar(255) NOT NULL, `job_name` varchar(255) NOT NULL,
@ -192,7 +194,7 @@ CREATE TABLE `xxl_job_qrtz_trigger_logglue` (
`add_time` timestamp NULL DEFAULT NULL, `add_time` timestamp NULL DEFAULT NULL,
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

@ -35,9 +35,9 @@ public class JobInfoController {
@ResponseBody @ResponseBody
public Map<String, Object> pageList(@RequestParam(required = false, defaultValue = "0") int start, public Map<String, Object> pageList(@RequestParam(required = false, defaultValue = "0") int start,
@RequestParam(required = false, defaultValue = "10") int length, @RequestParam(required = false, defaultValue = "10") int length,
String jobGroup, String jobName, String filterTime) { String jobGroup, String jobDesc, String filterTime) {
return xxlJobService.pageList(start, length, jobGroup, jobName, filterTime); return xxlJobService.pageList(start, length, jobGroup, jobDesc, filterTime);
} }
@RequestMapping("/add") @RequestMapping("/add")
@ -47,7 +47,7 @@ public class JobInfoController {
String author, String alarmEmail, int alarmThreshold, String author, String alarmEmail, int alarmThreshold,
int glueSwitch, String glueSource, String glueRemark) { int glueSwitch, String glueSource, String glueRemark) {
return xxlJobService.add(jobGroup, jobName, jobCron, jobDesc, executorAddress, executorHandler, executorParam, return xxlJobService.add(jobGroup, jobCron, jobDesc, executorAddress, executorHandler, executorParam,
author, alarmEmail, alarmThreshold, glueSwitch, glueSource, glueRemark); author, alarmEmail, alarmThreshold, glueSwitch, glueSource, glueRemark);
} }

@ -48,6 +48,13 @@ public class JobLogController {
return "joblog/joblog.index"; return "joblog/joblog.index";
} }
@RequestMapping("/getJobsByGroup")
@ResponseBody
public ReturnT<List<XxlJobLog>> listJobByGroup(String jobGroup){
List<XxlJobLog> list = xxlJobInfoDao.getJobsByGroup(jobGroup);
return new ReturnT<List<XxlJobLog>>(list);
}
@RequestMapping("/pageList") @RequestMapping("/pageList")
@ResponseBody @ResponseBody
public Map<String, Object> pageList(@RequestParam(required = false, defaultValue = "0") int start, public Map<String, Object> pageList(@RequestParam(required = false, defaultValue = "0") int start,

@ -7,9 +7,9 @@ package com.xxl.job.admin.core.constant;
public class Constants { public class Constants {
public enum JobGroupEnum{ public enum JobGroupEnum{
DEFAULT("默认"), defaults("默认"),
WAIMAI("外卖"), waimai("外卖"),
MOVIE("电影"); movie("电影");
private String desc; private String desc;
private JobGroupEnum(String desc){ private JobGroupEnum(String desc){
this.desc = desc; this.desc = desc;

@ -3,6 +3,7 @@ package com.xxl.job.admin.dao;
import java.util.List; import java.util.List;
import com.xxl.job.admin.core.model.XxlJobInfo; import com.xxl.job.admin.core.model.XxlJobInfo;
import com.xxl.job.admin.core.model.XxlJobLog;
/** /**
@ -11,8 +12,8 @@ import com.xxl.job.admin.core.model.XxlJobInfo;
*/ */
public interface IXxlJobInfoDao { public interface IXxlJobInfoDao {
public List<XxlJobInfo> pageList(int offset, int pagesize, String jobGroup, String jobName); public List<XxlJobInfo> pageList(int offset, int pagesize, String jobGroup, String jobDesc);
public int pageListCount(int offset, int pagesize, String jobGroup, String jobName); public int pageListCount(int offset, int pagesize, String jobGroup, String jobDesc);
public int save(XxlJobInfo info); public int save(XxlJobInfo info);
@ -22,4 +23,5 @@ public interface IXxlJobInfoDao {
public int delete(String jobGroup, String jobName); public int delete(String jobGroup, String jobName);
public List<XxlJobLog> getJobsByGroup(String jobGroup);
} }

@ -5,6 +5,7 @@ import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.xxl.job.admin.core.model.XxlJobLog;
import org.mybatis.spring.SqlSessionTemplate; import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -22,23 +23,23 @@ public class XxlJobInfoDaoImpl implements IXxlJobInfoDao {
public SqlSessionTemplate sqlSessionTemplate; public SqlSessionTemplate sqlSessionTemplate;
@Override @Override
public List<XxlJobInfo> pageList(int offset, int pagesize, String jobGroup, String jobName) { public List<XxlJobInfo> pageList(int offset, int pagesize, String jobGroup, String jobDesc) {
HashMap<String, Object> params = new HashMap<String, Object>(); HashMap<String, Object> params = new HashMap<String, Object>();
params.put("offset", offset); params.put("offset", offset);
params.put("pagesize", pagesize); params.put("pagesize", pagesize);
params.put("jobGroup", jobGroup); params.put("jobGroup", jobGroup);
params.put("jobName", jobName); params.put("jobDesc", jobDesc);
return sqlSessionTemplate.selectList("XxlJobInfoMapper.pageList", params); return sqlSessionTemplate.selectList("XxlJobInfoMapper.pageList", params);
} }
@Override @Override
public int pageListCount(int offset, int pagesize, String jobGroup, String jobName) { public int pageListCount(int offset, int pagesize, String jobGroup, String jobDesc) {
HashMap<String, Object> params = new HashMap<String, Object>(); HashMap<String, Object> params = new HashMap<String, Object>();
params.put("offset", offset); params.put("offset", offset);
params.put("pagesize", pagesize); params.put("pagesize", pagesize);
params.put("jobGroup", jobGroup); params.put("jobGroup", jobGroup);
params.put("jobName", jobName); params.put("jobDesc", jobDesc);
return sqlSessionTemplate.selectOne("XxlJobInfoMapper.pageListCount", params); return sqlSessionTemplate.selectOne("XxlJobInfoMapper.pageListCount", params);
} }
@ -71,4 +72,9 @@ public class XxlJobInfoDaoImpl implements IXxlJobInfoDao {
return sqlSessionTemplate.update("XxlJobInfoMapper.delete", params); return sqlSessionTemplate.update("XxlJobInfoMapper.delete", params);
} }
@Override
public List<XxlJobLog> getJobsByGroup(String jobGroup) {
return sqlSessionTemplate.selectList("XxlJobInfoMapper.getJobsByGroup", jobGroup);
}
} }

@ -11,9 +11,9 @@ import com.xxl.job.admin.core.model.ReturnT;
*/ */
public interface IXxlJobService { public interface IXxlJobService {
public Map<String, Object> pageList(int start, int length, String jobGroup, String jobName, String filterTime); public Map<String, Object> pageList(int start, int length, String jobGroup, String jobDesc, String filterTime);
public ReturnT<String> add(String jobGroup, String jobName, String jobCron, String jobDesc, public ReturnT<String> add(String jobGroup, String jobCron, String jobDesc,
String executorAddress, String executorHandler, String executorParam, String executorAddress, String executorHandler, String executorParam,
String author, String alarmEmail, int alarmThreshold, String author, String alarmEmail, int alarmThreshold,
int glueSwitch, String glueSource, String glueRemark); int glueSwitch, String glueSource, String glueRemark);

@ -3,6 +3,7 @@ package com.xxl.job.admin.service.impl;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -36,11 +37,11 @@ public class XxlJobServiceImpl implements IXxlJobService {
private IXxlJobLogGlueDao xxlJobLogGlueDao; private IXxlJobLogGlueDao xxlJobLogGlueDao;
@Override @Override
public Map<String, Object> pageList(int start, int length, String jobGroup, String jobName, String filterTime) { public Map<String, Object> pageList(int start, int length, String jobGroup, String jobDesc, String filterTime) {
// page list // page list
List<XxlJobInfo> list = xxlJobInfoDao.pageList(start, length, jobGroup, jobName); List<XxlJobInfo> list = xxlJobInfoDao.pageList(start, length, jobGroup, jobDesc);
int list_count = xxlJobInfoDao.pageListCount(start, length, jobGroup, jobName); int list_count = xxlJobInfoDao.pageListCount(start, length, jobGroup, jobDesc);
// fill job info // fill job info
if (list!=null && list.size()>0) { if (list!=null && list.size()>0) {
@ -58,7 +59,7 @@ public class XxlJobServiceImpl implements IXxlJobService {
} }
@Override @Override
public ReturnT<String> add(String jobGroup, String jobName, String jobCron, String jobDesc, public ReturnT<String> add(String jobGroup, String jobCron, String jobDesc,
String executorAddress, String executorHandler, String executorParam, String executorAddress, String executorHandler, String executorParam,
String author, String alarmEmail, int alarmThreshold, String author, String alarmEmail, int alarmThreshold,
int glueSwitch, String glueSource, String glueRemark) { int glueSwitch, String glueSource, String glueRemark) {
@ -66,9 +67,6 @@ public class XxlJobServiceImpl implements IXxlJobService {
if (JobGroupEnum.match(jobGroup) == null) { if (JobGroupEnum.match(jobGroup) == null) {
return new ReturnT<String>(500, "请选择“任务组”"); return new ReturnT<String>(500, "请选择“任务组”");
} }
if (StringUtils.isBlank(jobName)) {
return new ReturnT<String>(500, "请输入“任务名”");
}
if (!CronExpression.isValidExpression(jobCron)) { if (!CronExpression.isValidExpression(jobCron)) {
return new ReturnT<String>(500, "请输入格式正确的“Cron”"); return new ReturnT<String>(500, "请输入格式正确的“Cron”");
} }
@ -91,6 +89,8 @@ public class XxlJobServiceImpl implements IXxlJobService {
alarmThreshold = 0; alarmThreshold = 0;
} }
// generate jobName
String jobName = UUID.randomUUID().toString();
try { try {
if (DynamicSchedulerUtil.checkExists(jobName, jobGroup)) { if (DynamicSchedulerUtil.checkExists(jobName, jobGroup)) {
return new ReturnT<String>(500, "此任务已存在,请更换任务组或任务名"); return new ReturnT<String>(500, "此任务已存在,请更换任务组或任务名");
@ -168,8 +168,8 @@ public class XxlJobServiceImpl implements IXxlJobService {
} }
XxlJobInfo jobInfo = xxlJobInfoDao.load(jobGroup, jobName); XxlJobInfo jobInfo = xxlJobInfoDao.load(jobGroup, jobName);
jobInfo.setJobCron(jobCron);
jobInfo.setJobDesc(jobDesc); jobInfo.setJobDesc(jobDesc);
jobInfo.setJobCron(jobCron);
jobInfo.setAuthor(author); jobInfo.setAuthor(author);
jobInfo.setAlarmEmail(alarmEmail); jobInfo.setAlarmEmail(alarmEmail);
jobInfo.setAlarmThreshold(alarmThreshold); jobInfo.setAlarmThreshold(alarmThreshold);

@ -5,6 +5,6 @@ log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d - xxl-job-admin - %p [%c] - <%m>%n log4j.appender.console.layout.ConversionPattern=%d - xxl-job-admin - %p [%c] - <%m>%n
log4j.appender.logFile=org.apache.log4j.DailyRollingFileAppender log4j.appender.logFile=org.apache.log4j.DailyRollingFileAppender
log4j.appender.logFile.File=${catalina.base}/logs/xxl-job-admin.log log4j.appender.logFile.File=/data/applogs/xxl-job/xxl-job-admin.log
log4j.appender.logFile.layout=org.apache.log4j.PatternLayout log4j.appender.logFile.layout=org.apache.log4j.PatternLayout
log4j.appender.logFile.layout.ConversionPattern=%d - xxl-job-admin - %p [%c] - <%m>%n log4j.appender.logFile.layout.ConversionPattern=%d - xxl-job-admin - %p [%c] - <%m>%n

@ -50,13 +50,13 @@
<select id="pageList" parameterType="java.util.HashMap" resultMap="XxlJobInfo"> <select id="pageList" parameterType="java.util.HashMap" resultMap="XxlJobInfo">
SELECT <include refid="Base_Column_List" /> SELECT <include refid="Base_Column_List" />
FROM xxl_job_qrtz_trigger_info AS t FROM XXL_JOB_QRTZ_TRIGGER_INFO AS t
<trim prefix="WHERE" prefixOverrides="AND | OR" > <trim prefix="WHERE" prefixOverrides="AND | OR" >
<if test="jobGroup != null and jobGroup != ''"> <if test="jobGroup != null and jobGroup != ''">
AND t.job_group = #{jobGroup} AND t.job_group = #{jobGroup}
</if> </if>
<if test="jobName != null and jobName != ''"> <if test="jobDesc != null and jobDesc != ''">
AND t.job_name like CONCAT(CONCAT('%', #{jobName}), '%') AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%')
</if> </if>
</trim> </trim>
ORDER BY id DESC ORDER BY id DESC
@ -65,19 +65,19 @@
<select id="pageListCount" parameterType="java.util.HashMap" resultType="int"> <select id="pageListCount" parameterType="java.util.HashMap" resultType="int">
SELECT count(1) SELECT count(1)
FROM xxl_job_qrtz_trigger_info AS t FROM XXL_JOB_QRTZ_TRIGGER_INFO AS t
<trim prefix="WHERE" prefixOverrides="AND | OR" > <trim prefix="WHERE" prefixOverrides="AND | OR" >
<if test="jobGroup != null and jobGroup != ''"> <if test="jobGroup != null and jobGroup != ''">
AND t.job_group = #{jobGroup} AND t.job_group = #{jobGroup}
</if> </if>
<if test="jobName != null and jobName != ''"> <if test="jobDesc != null and jobDesc != ''">
AND t.job_name like CONCAT(CONCAT('%', #{jobName}), '%') AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%')
</if> </if>
</trim> </trim>
</select> </select>
<insert id="save" parameterType="com.xxl.job.admin.core.model.XxlJobInfo" useGeneratedKeys="true" keyProperty="id" > <insert id="save" parameterType="com.xxl.job.admin.core.model.XxlJobInfo" useGeneratedKeys="true" keyProperty="id" >
INSERT INTO `xxl_job_qrtz_trigger_info` ( INSERT INTO XXL_JOB_QRTZ_TRIGGER_INFO (
job_group, job_group,
job_name, job_name,
job_cron, job_cron,
@ -119,13 +119,13 @@
<select id="load" parameterType="java.util.HashMap" resultMap="XxlJobInfo"> <select id="load" parameterType="java.util.HashMap" resultMap="XxlJobInfo">
SELECT <include refid="Base_Column_List" /> SELECT <include refid="Base_Column_List" />
FROM xxl_job_qrtz_trigger_info AS t FROM XXL_JOB_QRTZ_TRIGGER_INFO AS t
WHERE t.job_group = #{jobGroup} WHERE t.job_group = #{jobGroup}
AND t.job_name = #{jobName} AND t.job_name = #{jobName}
</select> </select>
<update id="update" parameterType="com.xxl.job.admin.core.model.XxlJobInfo" > <update id="update" parameterType="com.xxl.job.admin.core.model.XxlJobInfo" >
UPDATE `xxl_job_qrtz_trigger_info` UPDATE XXL_JOB_QRTZ_TRIGGER_INFO
SET SET
job_cron = #{jobCron}, job_cron = #{jobCron},
job_desc = #{jobDesc}, job_desc = #{jobDesc},
@ -146,10 +146,16 @@
<delete id="delete" parameterType="java.lang.String"> <delete id="delete" parameterType="java.lang.String">
DELETE DELETE
FROM FROM
xxl_job_qrtz_trigger_info XXL_JOB_QRTZ_TRIGGER_INFO
WHERE WHERE
job_group = #{jobGroup} job_group = #{jobGroup}
AND job_name = #{jobName} AND job_name = #{jobName}
</delete> </delete>
<select id="getJobsByGroup" parameterType="java.util.HashMap" resultMap="XxlJobInfo">
SELECT <include refid="Base_Column_List" />
FROM XXL_JOB_QRTZ_TRIGGER_INFO AS t
WHERE t.job_group = #{jobGroup}
</select>
</mapper> </mapper>

@ -46,7 +46,7 @@
<select id="selectList" parameterType="java.util.HashMap" resultMap="XxlJobLogGlue"> <select id="selectList" parameterType="java.util.HashMap" resultMap="XxlJobLogGlue">
SELECT <include refid="Base_Column_List" /> SELECT <include refid="Base_Column_List" />
FROM xxl_job_qrtz_trigger_logglue AS t FROM XXL_JOB_QRTZ_TRIGGER_LOGGLUE AS t
<trim prefix="WHERE" prefixOverrides="AND | OR" > <trim prefix="WHERE" prefixOverrides="AND | OR" >
<if test="jobGroup != null and jobGroup != ''"> <if test="jobGroup != null and jobGroup != ''">
AND t.job_group = #{jobGroup} AND t.job_group = #{jobGroup}
@ -59,10 +59,10 @@
</select> </select>
<delete id="removeOld" parameterType="java.util.HashMap" > <delete id="removeOld" parameterType="java.util.HashMap" >
DELETE FROM xxl_job_qrtz_trigger_logglue DELETE FROM XXL_JOB_QRTZ_TRIGGER_LOGGLUE
WHERE id NOT in( WHERE id NOT in(
SELECT id FROM( SELECT id FROM(
SELECT id FROM xxl_job_qrtz_trigger_logglue SELECT id FROM XXL_JOB_QRTZ_TRIGGER_LOGGLUE
WHERE `job_group` = #{jobGroup} and `job_name` = #{jobName} WHERE `job_group` = #{jobGroup} and `job_name` = #{jobName}
ORDER BY update_time desc ORDER BY update_time desc
LIMIT 0, #{limit} LIMIT 0, #{limit}
@ -71,7 +71,7 @@
</delete> </delete>
<delete id="delete" parameterType="java.util.HashMap" > <delete id="delete" parameterType="java.util.HashMap" >
DELETE FROM xxl_job_qrtz_trigger_logglue DELETE FROM XXL_JOB_QRTZ_TRIGGER_LOGGLUE
WHERE job_group = #{jobGroup} and job_name = #{jobName} WHERE job_group = #{jobGroup} and job_name = #{jobName}
</delete> </delete>

@ -67,7 +67,7 @@
<select id="pageListCount" parameterType="java.util.HashMap" resultType="int"> <select id="pageListCount" parameterType="java.util.HashMap" resultType="int">
SELECT count(1) SELECT count(1)
FROM xxl_job_qrtz_trigger_log AS t FROM XXL_JOB_QRTZ_TRIGGER_LOG AS t
<trim prefix="WHERE" prefixOverrides="AND | OR" > <trim prefix="WHERE" prefixOverrides="AND | OR" >
<if test="jobGroup != null and jobGroup != ''"> <if test="jobGroup != null and jobGroup != ''">
AND t.job_group = #{jobGroup} AND t.job_group = #{jobGroup}
@ -86,19 +86,19 @@
<select id="load" parameterType="java.lang.Integer" resultMap="XxlJobLog"> <select id="load" parameterType="java.lang.Integer" resultMap="XxlJobLog">
SELECT <include refid="Base_Column_List" /> SELECT <include refid="Base_Column_List" />
FROM xxl_job_qrtz_trigger_log AS t FROM XXL_JOB_QRTZ_TRIGGER_LOG AS t
WHERE t.id = #{id} WHERE t.id = #{id}
</select> </select>
<select id="loadByGroupAndName" parameterType="java.util.HashMap" resultMap="XxlJobLog"> <select id="loadByGroupAndName" parameterType="java.util.HashMap" resultMap="XxlJobLog">
SELECT <include refid="Base_Column_List" /> SELECT <include refid="Base_Column_List" />
FROM xxl_job_qrtz_trigger_log AS t FROM XXL_JOB_QRTZ_TRIGGER_LOG AS t
WHERE t.job_group = #{jobGroup} WHERE t.job_group = #{jobGroup}
AND t.job_name = #{jobName} AND t.job_name = #{jobName}
</select> </select>
<insert id="save" parameterType="com.xxl.job.admin.core.model.XxlJobLog" useGeneratedKeys="true" keyProperty="id" > <insert id="save" parameterType="com.xxl.job.admin.core.model.XxlJobLog" useGeneratedKeys="true" keyProperty="id" >
INSERT INTO `xxl_job_qrtz_trigger_log` ( INSERT INTO XXL_JOB_QRTZ_TRIGGER_LOG (
`job_group`, `job_group`,
`job_name`, `job_name`,
`job_cron`, `job_cron`,
@ -123,7 +123,7 @@
</insert> </insert>
<update id="updateTriggerInfo"> <update id="updateTriggerInfo">
UPDATE `xxl_job_qrtz_trigger_log` UPDATE XXL_JOB_QRTZ_TRIGGER_LOG
SET SET
`trigger_time`= #{triggerTime}, `trigger_time`= #{triggerTime},
`trigger_status`= #{triggerStatus}, `trigger_status`= #{triggerStatus},
@ -135,7 +135,7 @@
</update> </update>
<update id="updateHandleInfo"> <update id="updateHandleInfo">
UPDATE `xxl_job_qrtz_trigger_log` UPDATE XXL_JOB_QRTZ_TRIGGER_LOG
SET SET
`handle_time`= #{handleTime}, `handle_time`= #{handleTime},
`handle_status`= #{handleStatus}, `handle_status`= #{handleStatus},
@ -144,7 +144,7 @@
</update> </update>
<delete id="delete"> <delete id="delete">
delete from `xxl_job_qrtz_trigger_log` delete from XXL_JOB_QRTZ_TRIGGER_LOG
WHERE job_group = #{jobGroup} WHERE job_group = #{jobGroup}
AND job_name = #{jobName} AND job_name = #{jobName}
</delete> </delete>

@ -34,7 +34,7 @@
<div class="row"> <div class="row">
<div class="col-xs-4"> <div class="col-xs-4">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon">任务组</span> <span class="input-group-addon">组</span>
<select class="form-control" id="jobGroup" > <select class="form-control" id="jobGroup" >
<#list JobGroupList as group> <#list JobGroupList as group>
<option value="${group}" >${group.desc}</option> <option value="${group}" >${group.desc}</option>
@ -44,8 +44,8 @@
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon">任务名</span> <span class="input-group-addon">名</span>
<input type="text" class="form-control" id="jobName" value="${jobName}" autocomplete="on" > <input type="text" class="form-control" id="jobDesc" value="${jobName}" autocomplete="on" >
</div> </div>
</div> </div>
<div class="col-xs-2"> <div class="col-xs-2">
@ -67,9 +67,9 @@
<thead> <thead>
<tr> <tr>
<th name="id" >id</th> <th name="id" >id</th>
<th name="jobGroup" >任务组</th> <th name="jobGroup" >jobGroup</th>
<th name="jobName" >任务名</th> <th name="jobName" >jobName</th>
<th name="jobDesc" >描述</th> <th name="jobDesc" >名称</th>
<th name="jobCron" >Cron</th> <th name="jobCron" >Cron</th>
<th name="jobClass" >JobBean</th> <th name="jobClass" >JobBean</th>
<th name="executorAddress" >执行器地址</th> <th name="executorAddress" >执行器地址</th>
@ -104,12 +104,12 @@
<div class="modal-dialog modal-lg"> <div class="modal-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" >新增任务调度信息</h4> <h4 class="modal-title" >新增任务</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form class="form-horizontal form" role="form" > <form class="form-horizontal form" role="form" >
<div class="form-group"> <div class="form-group">
<label for="firstname" class="col-sm-2 control-label">任务组<font color="red">*</font></label> <label for="firstname" class="col-sm-2 control-label">组<font color="red">*</font></label>
<div class="col-sm-4"> <div class="col-sm-4">
<select class="form-control" name="jobGroup" > <select class="form-control" name="jobGroup" >
<#list JobGroupList as group> <#list JobGroupList as group>
@ -117,32 +117,30 @@
</#list> </#list>
</select> </select>
</div> </div>
<label for="firstname" class="col-sm-2 control-label">任务名<font color="red">*</font></label> <label for="lastname" class="col-sm-2 control-label">名<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="jobName" placeholder="请输入“任务名”" minlength="4" maxlength="100" ></div> <div class="col-sm-4"><input type="text" class="form-control" name="jobDesc" placeholder="请输入“描述”" maxlength="50" ></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="lastname" class="col-sm-2 control-label">Cron<font color="red">*</font></label> <label for="lastname" class="col-sm-2 control-label">Cron<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="jobCron" placeholder="请输入“Cron”" maxlength="100" ></div> <div class="col-sm-4"><input type="text" class="form-control" name="jobCron" placeholder="请输入“Cron”" maxlength="20" ></div>
<label for="lastname" class="col-sm-2 control-label">描述<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="jobDesc" placeholder="请输入“描述”" maxlength="200" ></div>
</div>
<div class="form-group">
<label for="lastname" class="col-sm-2 control-label">执行器地址<font color="red">*</font></label> <label for="lastname" class="col-sm-2 control-label">执行器地址<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="executorAddress" placeholder="请输入“执行器地址”,多个地址逗号分隔" maxlength="200" ></div> <div class="col-sm-4"><input type="text" class="form-control" name="executorAddress" placeholder="请输入“执行器地址”,多个地址逗号分隔" maxlength="50" ></div>
<label for="lastname" class="col-sm-2 control-label">jobHandler<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="executorHandler" placeholder="请输入“jobHandler”" maxlength="200" ></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="lastname" class="col-sm-2 control-label">JobHandler<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="executorHandler" placeholder="请输入“jobHandler”" maxlength="50" ></div>
<label for="firstname" class="col-sm-2 control-label">执行参数<font color="black">*</font></label> <label for="firstname" class="col-sm-2 control-label">执行参数<font color="black">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="executorParam" placeholder="请输入“执行参数”" maxlength="100" ></div> <div class="col-sm-4"><input type="text" class="form-control" name="executorParam" placeholder="请输入“执行参数”" maxlength="100" ></div>
<label for="lastname" class="col-sm-2 control-label">负责人<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="请输入“负责人”" maxlength="200" ></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="lastname" class="col-sm-2 control-label">报警邮件<font color="red">*</font></label> <label for="lastname" class="col-sm-2 control-label">报警邮件<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="alarmEmail" placeholder="请输入“报警邮件”,多个邮件地址逗号分隔" maxlength="200" ></div> <div class="col-sm-4"><input type="text" class="form-control" name="alarmEmail" placeholder="请输入“报警邮件”,多个邮件地址逗号分隔" maxlength="100" ></div>
<label for="lastname" class="col-sm-2 control-label">报警阈值<font color="red">*</font></label> <label for="lastname" class="col-sm-2 control-label">报警阈值<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="alarmThreshold" placeholder="请输入“报警阈值”" maxlength="200" ></div> <div class="col-sm-4"><input type="text" class="form-control" name="alarmThreshold" placeholder="请输入“报警阈值”" maxlength="5" ></div>
</div>
<div class="form-group">
<label for="lastname" class="col-sm-2 control-label">负责人<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="请输入“负责人”" maxlength="50" ></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-3 col-sm-6"> <div class="col-sm-offset-3 col-sm-6">
@ -190,40 +188,46 @@ public class DemoJobHandler extends IJobHandler {
<div class="modal-dialog modal-lg"> <div class="modal-dialog modal-lg">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" >更新任务调度信息</h4> <h4 class="modal-title" >更新任务</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form class="form-horizontal form" role="form" > <form class="form-horizontal form" role="form" >
<div class="form-group"> <div class="form-group">
<label for="firstname" class="col-sm-2 control-label">任务组<font color="red">*</font></label> <label for="firstname" class="col-sm-2 control-label">分组<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="jobGroup" placeholder="请输入“任务组”" minlength="4" maxlength="100" readonly ></div> <div class="col-sm-4">
<label for="firstname" class="col-sm-2 control-label">任务名<font color="red">*</font></label> <select class="form-control" name="jobGroupTitle" disabled>
<div class="col-sm-4"><input type="text" class="form-control" name="jobName" placeholder="请输入“任务名”" minlength="4" maxlength="100" readonly ></div> <#list JobGroupList as group>
<option value="${group}" >${group.desc}</option>
</#list>
</select>
<input type="hidden" name="jobGroup" >
<input type="hidden" name="jobName" >
</div> </div>
<div class="form-group"> <label for="lastname" class="col-sm-2 control-label">名称<font color="red">*</font></label>
<label for="lastname" class="col-sm-2 control-label">Cron<font color="red">*</font></label> <div class="col-sm-4"><input type="text" class="form-control" name="jobDesc" placeholder="请输入“描述”" maxlength="50" ></div>
<div class="col-sm-4"><input type="text" class="form-control" name="jobCron" placeholder="请输入“Cron”" maxlength="100" ></div>
<label for="lastname" class="col-sm-2 control-label">描述<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="jobDesc" placeholder="请输入“描述”" maxlength="200" ></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="lastname" class="col-sm-2 control-label">Cron<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="jobCron" placeholder="请输入“Cron”" maxlength="20" ></div>
<label for="lastname" class="col-sm-2 control-label">执行器地址<font color="red">*</font></label> <label for="lastname" class="col-sm-2 control-label">执行器地址<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="executorAddress" placeholder="请输入“执行器地址”,多个地址逗号分隔" maxlength="200" ></div> <div class="col-sm-4"><input type="text" class="form-control" name="executorAddress" placeholder="请输入“执行器地址”,多个地址逗号分隔" maxlength="50" ></div>
<label for="lastname" class="col-sm-2 control-label">jobHandler<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="executorHandler" placeholder="请输入“jobHandler”" maxlength="200" ></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="lastname" class="col-sm-2 control-label">JobHandler<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="executorHandler" placeholder="请输入“jobHandler”" maxlength="50" ></div>
<label for="firstname" class="col-sm-2 control-label">执行参数<font color="black">*</font></label> <label for="firstname" class="col-sm-2 control-label">执行参数<font color="black">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="executorParam" placeholder="请输入“执行参数”" maxlength="100" ></div> <div class="col-sm-4"><input type="text" class="form-control" name="executorParam" placeholder="请输入“执行参数”" maxlength="100" ></div>
<label for="lastname" class="col-sm-2 control-label">负责人<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="请输入“负责人”" maxlength="200" ></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="lastname" class="col-sm-2 control-label">报警邮件<font color="red">*</font></label> <label for="lastname" class="col-sm-2 control-label">报警邮件<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="alarmEmail" placeholder="请输入“报警邮件”,多个邮件地址逗号分隔" maxlength="200" ></div> <div class="col-sm-4"><input type="text" class="form-control" name="alarmEmail" placeholder="请输入“报警邮件”,多个邮件地址逗号分隔" maxlength="100" ></div>
<label for="lastname" class="col-sm-2 control-label">报警阈值<font color="red">*</font></label> <label for="lastname" class="col-sm-2 control-label">报警阈值<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="alarmThreshold" placeholder="请输入“报警阈值”" maxlength="200" ></div> <div class="col-sm-4"><input type="text" class="form-control" name="alarmThreshold" placeholder="请输入“报警阈值”" maxlength="5" ></div>
</div>
<div class="form-group">
<label for="lastname" class="col-sm-2 control-label">负责人<font color="red">*</font></label>
<div class="col-sm-4"><input type="text" class="form-control" name="author" placeholder="请输入“负责人”" maxlength="50" ></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-3 col-sm-6"> <div class="col-sm-offset-3 col-sm-6">

@ -34,18 +34,21 @@
<div class="row"> <div class="row">
<div class="col-xs-3"> <div class="col-xs-3">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon">任务组</span> <span class="input-group-addon">分组</span>
<select class="form-control" id="jobGroup" > <select class="form-control" id="jobGroup" paramVal="${jobGroup}" >
<option value="" selected>请选择</option>
<#list JobGroupList as group> <#list JobGroupList as group>
<option value="${group}" <#if jobGroup == group>selected</#if> >${group.desc}</option> <option value="${group}" <#if jobGroup == group && false>selected</#if> >${group.desc}</option>
</#list> </#list>
</select> </select>
</div> </div>
</div> </div>
<div class="col-xs-3"> <div class="col-xs-3">
<div class="input-group"> <div class="input-group">
<span class="input-group-addon">任务名</span> <span class="input-group-addon">名称</span>
<input type="text" class="form-control" id="jobName" value="${jobName}" autocomplete="on" > <select class="form-control" id="jobName" paramVal="${jobName}" >
<option value="" >请选择</option>
</select>
</div> </div>
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">

@ -6,10 +6,11 @@ $(function() {
"serverSide": true, "serverSide": true,
"ajax": { "ajax": {
url: base_url + "/jobinfo/pageList", url: base_url + "/jobinfo/pageList",
type:"post",
data : function ( d ) { data : function ( d ) {
var obj = {}; var obj = {};
obj.jobGroup = $('#jobGroup').val(); obj.jobGroup = $('#jobGroup').val();
obj.jobName = $('#jobName').val(); obj.jobDesc = $('#jobDesc').val();
obj.start = d.start; obj.start = d.start;
obj.length = d.length; obj.length = d.length;
return obj; return obj;
@ -33,7 +34,7 @@ $(function() {
return data; return data;
} }
}, },
{ "data": 'jobName'}, { "data": 'jobName', "visible" : false},
{ "data": 'jobDesc', "visible" : true}, { "data": 'jobDesc', "visible" : true},
{ "data": 'jobCron', "visible" : true}, { "data": 'jobCron', "visible" : true},
{ "data": 'jobClass', "visible" : false}, { "data": 'jobClass', "visible" : false},
@ -98,7 +99,6 @@ $(function() {
' jobCron="'+ row.jobCron +'" '+ ' jobCron="'+ row.jobCron +'" '+
' jobDesc="'+ row.jobDesc +'" '+ ' jobDesc="'+ row.jobDesc +'" '+
' jobClass="'+ row.jobClass +'" '+ ' jobClass="'+ row.jobClass +'" '+
' jobData="'+ row.jobData +'" '+
' executorAddress="'+row.executorAddress +'" '+ ' executorAddress="'+row.executorAddress +'" '+
' executorHandler="'+ row.executorHandler +'" '+ ' executorHandler="'+ row.executorHandler +'" '+
' executorParam="'+ row.executorParam +'" '+ ' executorParam="'+ row.executorParam +'" '+
@ -215,74 +215,52 @@ $(function() {
errorClass : 'help-block', errorClass : 'help-block',
focusInvalid : true, focusInvalid : true,
rules : { rules : {
jobName : { jobDesc : {
required : true , required : true,
minlength: 4, maxlength: 50
maxlength: 100,
myValid01:true
}, },
jobCron : { jobCron : {
required : true , required : true
maxlength: 100
},
jobDesc : {
required : true ,
maxlength: 200
}, },
executorAddress : { executorAddress : {
required : true , required : true
maxlength: 200
}, },
executorHandler : { executorHandler : {
required : true , required : true
maxlength: 200
},
author : {
required : true ,
maxlength: 200
}, },
alarmEmail : { alarmEmail : {
required : true , required : true
maxlength: 200
}, },
alarmThreshold : { alarmThreshold : {
required : true , required : true ,
digits:true digits:true
},
author : {
required : true
} }
}, },
messages : { messages : {
jobName : { jobDesc : {
required :"请输入“任务名”" , required :"请输入“名称”."
minlength:"“任务名”长度不应低于4位",
maxlength:"“任务名”长度不应超过100位"
}, },
jobCron : { jobCron : {
required :"请输入“Cron”." , required :"请输入“Cron”."
maxlength:"“Cron”长度不应超过100位"
},
jobDesc : {
required :"请输入“任务描述”." ,
maxlength:"“任务描述”长度不应超过200位"
}, },
executorAddress : { executorAddress : {
required :"请输入“执行器地址”." , required :"请输入“执行器地址”."
maxlength:"“执行器地址”长度不应超过200位"
}, },
executorHandler : { executorHandler : {
required : "请输入“jobHandler”." , required : "请输入“JobHandler”."
maxlength: "“jobHandler”长度不应超过200位"
},
author : {
required : "请输入“负责人”." ,
maxlength: "“负责人”长度不应超过50位"
}, },
alarmEmail : { alarmEmail : {
required : "请输入“报警邮件”." , required : "请输入“报警邮件”."
maxlength: "“报警邮件”长度不应超过200位"
}, },
alarmThreshold : { alarmThreshold : {
required : "请输入“报警阈值”." , required : "请输入“报警阈值”." ,
digits:"阀值应该为整数." digits:"阀值应该为整数."
},
author : {
required : "请输入“负责人”."
} }
}, },
highlight : function(element) { highlight : function(element) {
@ -348,10 +326,13 @@ $(function() {
// 更新 // 更新
$("#job_list").on('click', '.update',function() { $("#job_list").on('click', '.update',function() {
// base data
$("#updateModal .form input[name='jobGroupTitle']").find("option[value='" + $(this).parent('p').attr("jobGroup") + "']").attr("selected",true);
$("#updateModal .form input[name='jobGroup']").val($(this).parent('p').attr("jobGroup")); $("#updateModal .form input[name='jobGroup']").val($(this).parent('p').attr("jobGroup"));
$("#updateModal .form input[name='jobName']").val($(this).parent('p').attr("jobName")); $("#updateModal .form input[name='jobName']").val($(this).parent('p').attr("jobName"));
$("#updateModal .form input[name='jobCron']").val($(this).parent('p').attr("jobCron"));
$("#updateModal .form input[name='jobDesc']").val($(this).parent('p').attr("jobDesc")); $("#updateModal .form input[name='jobDesc']").val($(this).parent('p').attr("jobDesc"));
$("#updateModal .form input[name='jobCron']").val($(this).parent('p').attr("jobCron"));
$("#updateModal .form input[name='executorAddress']").val($(this).parent('p').attr("executorAddress")); $("#updateModal .form input[name='executorAddress']").val($(this).parent('p').attr("executorAddress"));
$("#updateModal .form input[name='executorHandler']").val($(this).parent('p').attr("executorHandler")); $("#updateModal .form input[name='executorHandler']").val($(this).parent('p').attr("executorHandler"));
$("#updateModal .form input[name='executorParam']").val($(this).parent('p').attr("executorParam")); $("#updateModal .form input[name='executorParam']").val($(this).parent('p').attr("executorParam"));
@ -377,64 +358,54 @@ $(function() {
errorElement : 'span', errorElement : 'span',
errorClass : 'help-block', errorClass : 'help-block',
focusInvalid : true, focusInvalid : true,
rules : { rules : {
jobCron : {
required : true ,
maxlength: 100
},
jobDesc : { jobDesc : {
required : true , required : true,
maxlength: 200 maxlength: 50
},
jobCron : {
required : true
}, },
executorAddress : { executorAddress : {
required : true , required : true
maxlength: 200
}, },
executorHandler : { executorHandler : {
required : true , required : true
maxlength: 200
},
author : {
required : true ,
maxlength: 200
}, },
alarmEmail : { alarmEmail : {
required : true , required : true
maxlength: 200
}, },
alarmThreshold : { alarmThreshold : {
required : true , required : true ,
digits:true digits:true
},
author : {
required : true
} }
}, },
messages : { messages : {
jobCron : {
required :"请输入“Cron”." ,
maxlength:"“Cron”长度不应超过100位"
},
jobDesc : { jobDesc : {
required :"请输入“任务描述”." , required :"请输入“名称”."
maxlength:"“任务描述”长度不应超过200位" },
jobCron : {
required :"请输入“Cron”."
}, },
executorAddress : { executorAddress : {
required :"请输入“执行器地址”." , required :"请输入“执行器地址”."
maxlength:"“执行器地址”长度不应超过200位"
}, },
executorHandler : { executorHandler : {
required : "请输入“jobHandler”." , required : "请输入“JobHandler”."
maxlength: "“jobHandler”长度不应超过200位"
},
author : {
required : "请输入“负责人”." ,
maxlength: "“负责人”长度不应超过50位"
}, },
alarmEmail : { alarmEmail : {
required : "请输入“报警邮件”." , required : "请输入“报警邮件”."
maxlength: "“报警邮件”长度不应超过200位"
}, },
alarmThreshold : { alarmThreshold : {
required : "请输入“报警阈值”." , required : "请输入“报警阈值”." ,
digits:"阀值应该为整数." digits:"阀值应该为整数."
},
author : {
required : "请输入“负责人”."
} }
}, },
highlight : function(element) { highlight : function(element) {

@ -1,5 +1,37 @@
$(function() { $(function() {
// 分组列表选中, 任务列表初始化和选中
var ifParam = true;
$("#jobGroup").on("change", function () {
var jobGroup = $(this).children('option:selected').val();
$.ajax({
type : 'POST',
async: false, // async, avoid js invoke pagelist before jobName data init
url : base_url + '/joblog/getJobsByGroup',
data : {"jobGroup":jobGroup},
dataType : "json",
success : function(data){
if (data.code == 200) {
$("#jobName").html('<option value="" >请选择</option>');
$.each(data.content, function (n, value) {
$("#jobName").append('<option value="' + value.jobName + '" >' + value.jobDesc + '</option>');
});
if ($("#jobName").attr("paramVal")){
$("#jobName").find("option[value='" + $("#jobName").attr("paramVal") + "']").attr("selected",true);
$("#jobName").attr("paramVal")
}
} else {
ComAlertTec.show(data.msg);
}
},
});
});
if ($("#jobGroup").attr("paramVal")){
$("#jobGroup").find("option[value='" + $("#jobGroup").attr("paramVal") + "']").attr("selected",true);
$("#jobGroup").change();
$("#jobGroup").attr("")
}
// 过滤时间 // 过滤时间
$('#filterTime').daterangepicker({ $('#filterTime').daterangepicker({
timePicker: true, //是否显示小时和分钟 timePicker: true, //是否显示小时和分钟

@ -10,7 +10,7 @@
</appender> </appender>
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender"> <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="/logs/xxl-job-client-demo.log"/> <param name="file" value="/data/applogs/xxl-job/xxl-job-executor-example.log"/>
<param name="append" value="true"/> <param name="append" value="true"/>
<param name="encoding" value="UTF-8"/> <param name="encoding" value="UTF-8"/>
<layout class="org.apache.log4j.PatternLayout"> <layout class="org.apache.log4j.PatternLayout">
@ -19,7 +19,7 @@
</appender> </appender>
<appender name="xxl-job" class="com.xxl.job.core.log.XxlJobFileAppender"> <appender name="xxl-job" class="com.xxl.job.core.log.XxlJobFileAppender">
<param name="filePath" value="/logs/xxl-job/"/> <param name="filePath" value="/data/applogs/xxl-job/jobhandler/"/>
<param name="append" value="true"/> <param name="append" value="true"/>
<param name="encoding" value="UTF-8"/> <param name="encoding" value="UTF-8"/>
<layout class="org.apache.log4j.PatternLayout"> <layout class="org.apache.log4j.PatternLayout">

@ -17,7 +17,7 @@
<select id="load" parameterType="java.util.HashMap" resultMap="XxlJobInfo"> <select id="load" parameterType="java.util.HashMap" resultMap="XxlJobInfo">
SELECT <include refid="Base_Column_List" /> SELECT <include refid="Base_Column_List" />
FROM xxl_job_qrtz_trigger_info AS t FROM XXL_JOB_QRTZ_TRIGGER_INFO AS t
WHERE t.job_group = #{jobGroup} WHERE t.job_group = #{jobGroup}
AND t.job_name = #{jobName} AND t.job_name = #{jobName}
</select> </select>

Loading…
Cancel
Save