Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
tool
/
xxl-job
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ac5897a8
authored
May 23, 2019
by
xuxueli
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
任务列表支持根据状态筛选
1 parent
bea79cde
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
30 additions
and
11 deletions
doc/XXL-JOB官方文档.md
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java
xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobInfoDao.java
xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
xxl-job-admin/src/main/resources/i18n/message.properties
xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml
xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js
xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl
xxl-job-admin/src/test/java/com/xxl/job/admin/dao/XxlJobInfoDaoTest.java
doc/XXL-JOB官方文档.md
View file @
ac5897a
...
@@ -1461,6 +1461,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
...
@@ -1461,6 +1461,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
-
8、升级xxl-rpc至较新版本,并清理冗余POM;
-
8、升级xxl-rpc至较新版本,并清理冗余POM;
-
9、注册表索引优化,缓解锁表问题;
-
9、注册表索引优化,缓解锁表问题;
-
10、新增Jboot执行器Sample示例项目;
-
10、新增Jboot执行器Sample示例项目;
-
11、任务列表支持根据状态筛选;
### TODO LIST
### TODO LIST
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobGroupController.java
View file @
ac5897a
...
@@ -142,7 +142,7 @@ public class JobGroupController {
...
@@ -142,7 +142,7 @@ public class JobGroupController {
public
ReturnT
<
String
>
remove
(
int
id
){
public
ReturnT
<
String
>
remove
(
int
id
){
// valid
// valid
int
count
=
xxlJobInfoDao
.
pageListCount
(
0
,
10
,
id
,
null
,
null
);
int
count
=
xxlJobInfoDao
.
pageListCount
(
0
,
10
,
id
,
-
1
,
null
,
null
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
new
ReturnT
<
String
>(
500
,
I18nUtil
.
getString
(
"jobgroup_del_limit_0"
)
);
return
new
ReturnT
<
String
>(
500
,
I18nUtil
.
getString
(
"jobgroup_del_limit_0"
)
);
}
}
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java
View file @
ac5897a
...
@@ -94,9 +94,9 @@ public class JobInfoController {
...
@@ -94,9 +94,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
,
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"
)
@RequestMapping
(
"/add"
)
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobInfoDao.java
View file @
ac5897a
...
@@ -17,11 +17,13 @@ public interface XxlJobInfoDao {
...
@@ -17,11 +17,13 @@ public interface XxlJobInfoDao {
public
List
<
XxlJobInfo
>
pageList
(
@Param
(
"offset"
)
int
offset
,
public
List
<
XxlJobInfo
>
pageList
(
@Param
(
"offset"
)
int
offset
,
@Param
(
"pagesize"
)
int
pagesize
,
@Param
(
"pagesize"
)
int
pagesize
,
@Param
(
"jobGroup"
)
int
jobGroup
,
@Param
(
"jobGroup"
)
int
jobGroup
,
@Param
(
"triggerStatus"
)
int
triggerStatus
,
@Param
(
"jobDesc"
)
String
jobDesc
,
@Param
(
"jobDesc"
)
String
jobDesc
,
@Param
(
"executorHandler"
)
String
executorHandler
);
@Param
(
"executorHandler"
)
String
executorHandler
);
public
int
pageListCount
(
@Param
(
"offset"
)
int
offset
,
public
int
pageListCount
(
@Param
(
"offset"
)
int
offset
,
@Param
(
"pagesize"
)
int
pagesize
,
@Param
(
"pagesize"
)
int
pagesize
,
@Param
(
"jobGroup"
)
int
jobGroup
,
@Param
(
"jobGroup"
)
int
jobGroup
,
@Param
(
"triggerStatus"
)
int
triggerStatus
,
@Param
(
"jobDesc"
)
String
jobDesc
,
@Param
(
"jobDesc"
)
String
jobDesc
,
@Param
(
"executorHandler"
)
String
executorHandler
);
@Param
(
"executorHandler"
)
String
executorHandler
);
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java
View file @
ac5897a
...
@@ -25,7 +25,7 @@ public interface XxlJobService {
...
@@ -25,7 +25,7 @@ public interface XxlJobService {
* @param filterTime
* @param filterTime
* @return
* @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
* add job
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
View file @
ac5897a
...
@@ -41,11 +41,11 @@ public class XxlJobServiceImpl implements XxlJobService {
...
@@ -41,11 +41,11 @@ public class XxlJobServiceImpl implements XxlJobService {
private
XxlJobLogGlueDao
xxlJobLogGlueDao
;
private
XxlJobLogGlueDao
xxlJobLogGlueDao
;
@Override
@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
// page list
List
<
XxlJobInfo
>
list
=
xxlJobInfoDao
.
pageList
(
start
,
length
,
jobGroup
,
jobDesc
,
executorHandler
);
List
<
XxlJobInfo
>
list
=
xxlJobInfoDao
.
pageList
(
start
,
length
,
jobGroup
,
triggerStatus
,
jobDesc
,
executorHandler
);
int
list_count
=
xxlJobInfoDao
.
pageListCount
(
start
,
length
,
jobGroup
,
jobDesc
,
executorHandler
);
int
list_count
=
xxlJobInfoDao
.
pageListCount
(
start
,
length
,
jobGroup
,
triggerStatus
,
jobDesc
,
executorHandler
);
// package result
// package result
Map
<
String
,
Object
>
maps
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
maps
=
new
HashMap
<
String
,
Object
>();
...
...
xxl-job-admin/src/main/resources/i18n/message.properties
View file @
ac5897a
...
@@ -101,7 +101,7 @@ job_dashboard_rate_report=成功比例图
...
@@ -101,7 +101,7 @@ job_dashboard_rate_report=成功比例图
## job info
## job info
jobinfo_name
=
任务管理
jobinfo_name
=
任务管理
jobinfo_job
=
任务
jobinfo_job
=
任务
jobinfo_field_add
=
新增
任务
jobinfo_field_add
=
新增
jobinfo_field_update
=
更新任务
jobinfo_field_update
=
更新任务
jobinfo_field_id
=
任务ID
jobinfo_field_id
=
任务ID
jobinfo_field_jobgroup
=
执行器
jobinfo_field_jobgroup
=
执行器
...
...
xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml
View file @
ac5897a
...
@@ -67,6 +67,9 @@
...
@@ -67,6 +67,9 @@
<if
test=
"jobGroup gt 0"
>
<if
test=
"jobGroup gt 0"
>
AND t.job_group = #{jobGroup}
AND t.job_group = #{jobGroup}
</if>
</if>
<if
test=
"triggerStatus gte 0"
>
AND t.trigger_status = #{triggerStatus}
</if>
<if
test=
"jobDesc != null and jobDesc != ''"
>
<if
test=
"jobDesc != null and jobDesc != ''"
>
AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%')
AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%')
</if>
</if>
...
@@ -85,6 +88,9 @@
...
@@ -85,6 +88,9 @@
<if
test=
"jobGroup gt 0"
>
<if
test=
"jobGroup gt 0"
>
AND t.job_group = #{jobGroup}
AND t.job_group = #{jobGroup}
</if>
</if>
<if
test=
"triggerStatus gte 0"
>
AND t.trigger_status = #{triggerStatus}
</if>
<if
test=
"jobDesc != null and jobDesc != ''"
>
<if
test=
"jobDesc != null and jobDesc != ''"
>
AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%')
AND t.job_desc like CONCAT(CONCAT('%', #{jobDesc}), '%')
</if>
</if>
...
...
xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js
View file @
ac5897a
...
@@ -11,6 +11,7 @@ $(function() {
...
@@ -11,6 +11,7 @@ $(function() {
data
:
function
(
d
)
{
data
:
function
(
d
)
{
var
obj
=
{};
var
obj
=
{};
obj
.
jobGroup
=
$
(
'#jobGroup'
).
val
();
obj
.
jobGroup
=
$
(
'#jobGroup'
).
val
();
obj
.
triggerStatus
=
$
(
'#triggerStatus'
).
val
();
obj
.
jobDesc
=
$
(
'#jobDesc'
).
val
();
obj
.
jobDesc
=
$
(
'#jobDesc'
).
val
();
obj
.
executorHandler
=
$
(
'#executorHandler'
).
val
();
obj
.
executorHandler
=
$
(
'#executorHandler'
).
val
();
obj
.
start
=
d
.
start
;
obj
.
start
=
d
.
start
;
...
...
xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl
View file @
ac5897a
...
@@ -35,6 +35,15 @@
...
@@ -35,6 +35,15 @@
</select>
</select>
</div>
</div>
</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=
"col-xs-3"
>
<div
class=
"input-group"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
>
${I18n.jobinfo_field_jobdesc}
</span>
<span
class=
"input-group-addon"
>
${I18n.jobinfo_field_jobdesc}
</span>
...
@@ -50,7 +59,7 @@
...
@@ -50,7 +59,7 @@
<div
class=
"col-xs-1"
>
<div
class=
"col-xs-1"
>
<button
class=
"btn btn-block btn-info"
id=
"searchBtn"
>
${I18n.system_search}
</button>
<button
class=
"btn btn-block btn-info"
id=
"searchBtn"
>
${I18n.system_search}
</button>
</div>
</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>
<button
class=
"btn btn-block btn-success add"
type=
"button"
>
${I18n.jobinfo_field_add}
</button>
</div>
</div>
</div>
</div>
...
...
xxl-job-admin/src/test/java/com/xxl/job/admin/dao/XxlJobInfoDaoTest.java
View file @
ac5897a
...
@@ -19,8 +19,8 @@ public class XxlJobInfoDaoTest {
...
@@ -19,8 +19,8 @@ public class XxlJobInfoDaoTest {
@Test
@Test
public
void
pageList
(){
public
void
pageList
(){
List
<
XxlJobInfo
>
list
=
xxlJobInfoDao
.
pageList
(
0
,
20
,
0
,
null
,
null
);
List
<
XxlJobInfo
>
list
=
xxlJobInfoDao
.
pageList
(
0
,
20
,
0
,
-
1
,
null
,
null
);
int
list_count
=
xxlJobInfoDao
.
pageListCount
(
0
,
20
,
0
,
null
,
null
);
int
list_count
=
xxlJobInfoDao
.
pageListCount
(
0
,
20
,
0
,
-
1
,
null
,
null
);
System
.
out
.
println
(
list
);
System
.
out
.
println
(
list
);
System
.
out
.
println
(
list_count
);
System
.
out
.
println
(
list_count
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment