params = new LinkedHashMap<>();
params.put("beanName", beanName);
params.put("jobStatus", jobStatus);
@@ -65,25 +86,39 @@ public class QuartzJobController extends BaseController{
}
@ApiOperation(value = "新增")
- @PostMapping
+ @PostMapping("add")
@ResponseBody
- public ResultMsg add(@RequestBody QuartzJob body){
+ public ResultMsg add(@RequestBody QuartzJob body, Authentication authentication) {
+ Object principal = authentication.getPrincipal();
+ UserEntity userEntity = null;
+ if (principal instanceof UserEntity) {
+ userEntity = (UserEntity) principal;
+ }
+ body.setCreateDate(new Date());
+ body.setCreateBy(userEntity.getId());
quartzJobService.insertSelective(body);
return ResultMsg.success();
}
@ApiOperation(value = "修改")
- @PatchMapping
+ @PatchMapping("edit")
@ResponseBody
- public ResultMsg update(@RequestBody QuartzJob body){
+ public ResultMsg update(@RequestBody QuartzJob body, Authentication authentication) {
+ Object principal = authentication.getPrincipal();
+ UserEntity userEntity = null;
+ if (principal instanceof UserEntity) {
+ userEntity = (UserEntity) principal;
+ }
+ body.setUpdateDate(new Date());
+ body.setUpdateBy(userEntity.getId());
quartzJobService.updateByPrimaryKeySelective(body);
return ResultMsg.success();
}
@ApiOperation(value = "删除")
- @DeleteMapping("/id/{ids}")
+ @DeleteMapping("/ids/{ids}")
@ResponseBody
- public ResultMsg delete(@PathVariable String ids){
+ public ResultMsg delete(@PathVariable String ids) {
quartzJobService.deleteByIds(ids);
return ResultMsg.success();
}
@@ -96,19 +131,25 @@ public class QuartzJobController extends BaseController{
public ResultMsg operation(
Authentication authentication,
@PathVariable Long id,
- @ApiParam(value = "job状态[0:off, 1:on]", required = true)@PathVariable int jobStatus) throws ClassNotFoundException, InstantiationException, SchedulerException, IllegalAccessException {
+ @ApiParam(value = "job状态[0:off, 1:on]", required = true) @PathVariable int jobStatus) throws ClassNotFoundException, InstantiationException, SchedulerException, IllegalAccessException {
Object principal = authentication.getPrincipal();
UserEntity userEntity = null;
- if(principal instanceof UserEntity){
- userEntity = (UserEntity)principal;
+ if (principal instanceof UserEntity) {
+ userEntity = (UserEntity) principal;
}
QuartzJob quartzJob = quartzJobService.findById(id);
- if(0 == jobStatus){
- quartzManage.pauseJob(quartzJob);
- }else{
- quartzManage.resumeJob(quartzJob);
+ if (quartzManage.isRun(quartzJob.getJobName())) {
+ if (0 == jobStatus) {
+ quartzManage.pauseJob(quartzJob);
+ } else {
+ quartzManage.resumeJob(quartzJob);
+ }
+ } else {
+ if (1 == jobStatus) {
+ quartzManage.addJob(quartzJob);
+ }
}
quartzJob.setJobStatus(jobStatus);
diff --git a/web/src/main/resources/logback.xml b/web/src/main/resources/logback.xml
index a66c4b7e3654fa8c4e708b3ab1411ffb5bb4f918..68378ba0703dbf3f467fc2c671651a91eede9a3a 100644
--- a/web/src/main/resources/logback.xml
+++ b/web/src/main/resources/logback.xml
@@ -73,7 +73,7 @@
-
+
diff --git a/web/src/main/resources/templates/code/list.ftl b/web/src/main/resources/templates/code/list.ftl
index 0bfbfc5a6a2ac729d6e95a61ae9d0fb26c049478..f94cf145bfbcbaabaa88852f744247510b968db6 100644
--- a/web/src/main/resources/templates/code/list.ftl
+++ b/web/src/main/resources/templates/code/list.ftl
@@ -50,16 +50,16 @@
<#list columns as column>
<#switch column.easyuiType>
<#case "rich_text">
- | ${(column.comment)} |
+ ${(column.comment)} |
<#break>
<#case "image">
- ${(column.comment)} |
+ ${(column.comment)} |
<#break>
<#case "t:dict">
- ${(column.comment)} |
+ ${(column.comment)} |
<#break>
<#default>
- ${(column.comment)} |
+ ${(column.comment)} |
#switch>
#list>
diff --git a/web/src/main/resources/templates/easyui/quartzJob/add.html b/web/src/main/resources/templates/easyui/quartzJob/add.html
new file mode 100644
index 0000000000000000000000000000000000000000..6fb37eac35329e0441b31b8ef0eda3fb56c2886f
--- /dev/null
+++ b/web/src/main/resources/templates/easyui/quartzJob/add.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/src/main/resources/templates/easyui/quartzJob/edit.html b/web/src/main/resources/templates/easyui/quartzJob/edit.html
new file mode 100644
index 0000000000000000000000000000000000000000..375f977f4c492ead54b97ac09bd39f8a347d0a77
--- /dev/null
+++ b/web/src/main/resources/templates/easyui/quartzJob/edit.html
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/src/main/resources/templates/easyui/quartzJob/list.html b/web/src/main/resources/templates/easyui/quartzJob/list.html
new file mode 100644
index 0000000000000000000000000000000000000000..61f2398cfa0bd9d9c0879b1b0f14b05318a3c924
--- /dev/null
+++ b/web/src/main/resources/templates/easyui/quartzJob/list.html
@@ -0,0 +1,163 @@
+
+
+
+
+
+
+
+
+ |
+ id |
+ 创建人id |
+ 创建时间 |
+ 更新人id |
+ 更新时间 |
+ cron表达式 |
+ 任务调用的方法名 |
+ 任务是否有状态 |
+ 描述 |
+ 任务执行时调用哪个类的方法 包名+类名,完全限定名 |
+ 触发器名称 |
+ 任务状态 |
+ spring_bean |
+ 任务名 |
+ 操作 |
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/src/main/resources/templates/easyui/roleAuthority/auth_config.html b/web/src/main/resources/templates/easyui/roleAuthority/auth_config.html
index 0a479dc3e127e072e0e2d5b03ac43beedfc1d5f0..fc14af0b29830102488cb70aa2f5286e6ba14ae2 100644
--- a/web/src/main/resources/templates/easyui/roleAuthority/auth_config.html
+++ b/web/src/main/resources/templates/easyui/roleAuthority/auth_config.html
@@ -19,7 +19,7 @@
Tree nodes with check boxes.
-->
-
-
+
-
+
- | id |
- 创建人id |
- 创建时间 |
- 更新人id |
- 更新时间 |
- 字典编码 |
- 字典编码名称 |
- 字典组id |
- 字典组编码 |
- 排序 |
- 操作 |
+ id |
+ 创建人id |
+ 创建时间 |
+ 更新人id |
+ 更新时间 |
+ 字典编码 |
+ 字典编码名称 |
+ 字典组id |
+ 字典组编码 |
+ 排序 |
+ 操作 |
diff --git a/web/src/main/resources/templates/index_v1.html b/web/src/main/resources/templates/index_v1.html
index 35ca734ca7c5518bf97c375a2f3984799c008c48..c511a41e40cbcd33c6c4048018bc9cec52b82ae5 100644
--- a/web/src/main/resources/templates/index_v1.html
+++ b/web/src/main/resources/templates/index_v1.html
@@ -66,7 +66,7 @@
-
+
- -
0通知
@@ -162,7 +162,7 @@
-
+ -->
个人