任务列表优化,支持根据 "任务状态"、"负责人" 属性筛选任务;

master
xuxueli 6 years ago
parent ac01d85644
commit d156c51f0d
  1. 3
      doc/XXL-JOB官方文档.md
  2. 2
      xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java
  3. 4
      xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java
  4. 6
      xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobInfoDao.java
  5. 4
      xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java
  6. 6
      xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
  7. 6
      xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml
  8. 1
      xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js
  9. 15
      xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl
  10. 4
      xxl-job-admin/src/test/java/com/xxl/job/admin/dao/XxlJobInfoDaoTest.java

@ -1472,11 +1472,12 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
- 6、调度线程池参数调优;
- 7、注册表索引优化,缓解锁表问题;
- 8、新增Jboot执行器Sample示例项目;
- 9、任务列表支持根据状态筛选;
- 9、任务列表优化,支持根据 "任务状态"、"负责人" 属性筛选任务
- 10、项目依赖升级至较新稳定版本,如spring、springboot、groovy、xxl-rpc等等;并清理冗余POM;
- 11、升级xxl-rpc至较新版本,修复代理服务初始化时远程服务不可用导致长连冗余创建的问题;
- 12、首页调度报表的日期排序在TIDB下乱序问题修复;
### 6.26 版本 v2.1.1 Release Notes[规划中]
- 1、[ING]调度日志优化:支持设置日志保留天数,过期日志天维度记录报表,并清理;调度报表汇总实时数据和报表;
- 2、[ING]父子任务参数传递;

@ -142,7 +142,7 @@ public class JobGroupController {
public ReturnT<String> remove(int id){
// valid
int count = xxlJobInfoDao.pageListCount(0, 10, id, -1, null, null);
int count = xxlJobInfoDao.pageListCount(0, 10, id, -1, null, null, null);
if (count > 0) {
return new ReturnT<String>(500, I18nUtil.getString("jobgroup_del_limit_0") );
}

@ -94,9 +94,9 @@ public class JobInfoController {
@ResponseBody
public Map<String, Object> pageList(@RequestParam(required = false, defaultValue = "0") int start,
@RequestParam(required = false, defaultValue = "10") int length,
int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String filterTime) {
int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String author) {
return xxlJobService.pageList(start, length, jobGroup, triggerStatus, jobDesc, executorHandler, filterTime);
return xxlJobService.pageList(start, length, jobGroup, triggerStatus, jobDesc, executorHandler, author);
}
@RequestMapping("/add")

@ -19,13 +19,15 @@ public interface XxlJobInfoDao {
@Param("jobGroup") int jobGroup,
@Param("triggerStatus") int triggerStatus,
@Param("jobDesc") String jobDesc,
@Param("executorHandler") String executorHandler);
@Param("executorHandler") String executorHandler,
@Param("author") String author);
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);
@Param("executorHandler") String executorHandler,
@Param("author") String author);
public int save(XxlJobInfo info);

@ -22,10 +22,10 @@ public interface XxlJobService {
* @param jobGroup
* @param jobDesc
* @param executorHandler
* @param filterTime
* @param author
* @return
*/
public Map<String, Object> pageList(int start, int length, int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String filterTime);
public Map<String, Object> pageList(int start, int length, int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String author);
/**
* add job

@ -41,11 +41,11 @@ public class XxlJobServiceImpl implements XxlJobService {
private XxlJobLogGlueDao xxlJobLogGlueDao;
@Override
public Map<String, Object> pageList(int start, int length, int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String filterTime) {
public Map<String, Object> pageList(int start, int length, int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String author) {
// page list
List<XxlJobInfo> list = xxlJobInfoDao.pageList(start, length, jobGroup, triggerStatus, jobDesc, executorHandler);
int list_count = xxlJobInfoDao.pageListCount(start, length, jobGroup, triggerStatus, jobDesc, executorHandler);
List<XxlJobInfo> list = xxlJobInfoDao.pageList(start, length, jobGroup, triggerStatus, jobDesc, executorHandler, author);
int list_count = xxlJobInfoDao.pageListCount(start, length, jobGroup, triggerStatus, jobDesc, executorHandler, author);
// package result
Map<String, Object> maps = new HashMap<String, Object>();

@ -76,6 +76,9 @@
<if test="executorHandler != null and executorHandler != ''">
AND t.executor_handler like CONCAT(CONCAT('%', #{executorHandler}), '%')
</if>
<if test="author != null and author != ''">
AND t.author like CONCAT(CONCAT('%', #{author}), '%')
</if>
</trim>
ORDER BY id DESC
LIMIT #{offset}, #{pagesize}
@ -97,6 +100,9 @@
<if test="executorHandler != null and executorHandler != ''">
AND t.executor_handler like CONCAT(CONCAT('%', #{executorHandler}), '%')
</if>
<if test="author != null and author != ''">
AND t.author like CONCAT(CONCAT('%', #{author}), '%')
</if>
</trim>
</select>

@ -14,6 +14,7 @@ $(function() {
obj.triggerStatus = $('#triggerStatus').val();
obj.jobDesc = $('#jobDesc').val();
obj.executorHandler = $('#executorHandler').val();
obj.author = $('#author').val();
obj.start = d.start;
obj.length = d.length;
return obj;

@ -44,16 +44,19 @@
</select>
</div>
</div>
<div class="col-xs-3">
<div class="col-xs-2">
<div class="input-group">
<span class="input-group-addon">${I18n.jobinfo_field_jobdesc}</span>
<input type="text" class="form-control" id="jobDesc" autocomplete="on" >
<input type="text" class="form-control" id="jobDesc" autocomplete="on" placeholder="${I18n.system_please_input}${I18n.jobinfo_field_jobdesc}" >
</div>
</div>
<div class="col-xs-3">
<div class="col-xs-2">
<div class="input-group">
<span class="input-group-addon">JobHandler</span>
<input type="text" class="form-control" id="executorHandler" autocomplete="on" >
<input type="text" class="form-control" id="executorHandler" autocomplete="on" placeholder="${I18n.system_please_input}JobHandler" >
</div>
</div>
<div class="col-xs-2">
<div class="input-group">
<input type="text" class="form-control" id="author" autocomplete="on" placeholder="${I18n.system_please_input}${I18n.jobinfo_field_author}" >
</div>
</div>
<div class="col-xs-1">

@ -19,8 +19,8 @@ public class XxlJobInfoDaoTest {
@Test
public void pageList(){
List<XxlJobInfo> list = xxlJobInfoDao.pageList(0, 20, 0, -1, null, null);
int list_count = xxlJobInfoDao.pageListCount(0, 20, 0, -1, null, null);
List<XxlJobInfo> list = xxlJobInfoDao.pageList(0, 20, 0, -1, null, null, null);
int list_count = xxlJobInfoDao.pageListCount(0, 20, 0, -1, null, null, null);
System.out.println(list);
System.out.println(list_count);

Loading…
Cancel
Save