任务列表支持根据状态筛选

pull/10/head
xuxueli 6 years ago
parent bea79cde84
commit ac5897a8e2

@ -1461,6 +1461,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
- 8、升级xxl-rpc至较新版本并清理冗余POM
- 9、注册表索引优化缓解锁表问题
- 10、新增Jboot执行器Sample示例项目
- 11、任务列表支持根据状态筛选
### TODO LIST

@ -142,7 +142,7 @@ public class JobGroupController {
public ReturnT<String> 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<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, 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")

@ -17,11 +17,13 @@ public interface XxlJobInfoDao {
public List<XxlJobInfo> 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);

@ -25,7 +25,7 @@ public interface XxlJobService {
* @param filterTime
* @return
*/
public Map<String, Object> pageList(int start, int length, int jobGroup, String jobDesc, String executorHandler, String filterTime);
public Map<String, Object> pageList(int start, int length, int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String filterTime);
/**
* 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, String jobDesc, String executorHandler, String filterTime) {
public Map<String, Object> pageList(int start, int length, int jobGroup, int triggerStatus, String jobDesc, String executorHandler, String filterTime) {
// page list
List<XxlJobInfo> list = xxlJobInfoDao.pageList(start, length, jobGroup, jobDesc, executorHandler);
int list_count = xxlJobInfoDao.pageListCount(start, length, jobGroup, jobDesc, executorHandler);
List<XxlJobInfo> list = xxlJobInfoDao.pageList(start, length, jobGroup, triggerStatus, jobDesc, executorHandler);
int list_count = xxlJobInfoDao.pageListCount(start, length, jobGroup, triggerStatus, jobDesc, executorHandler);
// package result
Map<String, Object> maps = new HashMap<String, Object>();

@ -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=执行器

@ -67,6 +67,9 @@
<if test="jobGroup gt 0">
AND t.job_group = #{jobGroup}
</if>
<if test="triggerStatus gte 0">
AND t.trigger_status = #{triggerStatus}
</if>
<if test="jobDesc != null and jobDesc != ''">
AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%')
</if>
@ -85,6 +88,9 @@
<if test="jobGroup gt 0">
AND t.job_group = #{jobGroup}
</if>
<if test="triggerStatus gte 0">
AND t.trigger_status = #{triggerStatus}
</if>
<if test="jobDesc != null and jobDesc != ''">
AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%')
</if>

@ -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;

@ -35,6 +35,15 @@
</select>
</div>
</div>
<div class="col-xs-1">
<div class="input-group">
<select class="form-control" id="triggerStatus" >
<option value="-1" >${I18n.system_all}</option>
<option value="0" >${I18n.jobinfo_opt_stop}</option>
<option value="1" >${I18n.jobinfo_opt_start}</option>
</select>
</div>
</div>
<div class="col-xs-3">
<div class="input-group">
<span class="input-group-addon">${I18n.jobinfo_field_jobdesc}</span>
@ -50,7 +59,7 @@
<div class="col-xs-1">
<button class="btn btn-block btn-info" id="searchBtn">${I18n.system_search}</button>
</div>
<div class="col-xs-2">
<div class="col-xs-1">
<button class="btn btn-block btn-success add" type="button">${I18n.jobinfo_field_add}</button>
</div>
</div>

@ -19,8 +19,8 @@ public class XxlJobInfoDaoTest {
@Test
public void pageList(){
List<XxlJobInfo> list = xxlJobInfoDao.pageList(0, 20, 0, null, null);
int list_count = xxlJobInfoDao.pageListCount(0, 20, 0, null, null);
List<XxlJobInfo> 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);

Loading…
Cancel
Save