Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
7b8cfff9
Commit
7b8cfff9
authored
Aug 30, 2021
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.定时任务自动任务生成
parent
732c1fd7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
18 deletions
+33
-18
PlanTaskController.java
...s/maintenance/business/controller/PlanTaskController.java
+4
-17
PlanTaskServiceImpl.java
...aintenance/business/service/impl/PlanTaskServiceImpl.java
+2
-1
PlanTaskJob.java
...n/java/com/yeejoin/amos/maintenance/task/PlanTaskJob.java
+27
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/controller/PlanTaskController.java
View file @
7b8cfff9
...
...
@@ -23,6 +23,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
...
...
@@ -35,6 +36,9 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
/**
* @author DELL
*/
@RestController
@RequestMapping
(
value
=
"/api/planTask"
)
@Api
(
tags
=
"计划执行api"
)
...
...
@@ -155,23 +159,6 @@ public class PlanTaskController extends AbstractBaseController {
}
/**
* 定时查询任务状态
*
* @return
*/
@ApiOperation
(
value
=
"定时执行任务表生成"
,
notes
=
"定时执行任务表生成"
)
@RequestMapping
(
value
=
"/queryOmission"
,
method
=
RequestMethod
.
GET
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
pushCarData
()
{
try
{
planTaskService
.
taskExecution
(
null
);
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
();
}
}
/**
* 模拟定时任务调起服务
*
* @return
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/service/impl/PlanTaskServiceImpl.java
View file @
7b8cfff9
...
...
@@ -287,10 +287,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
}
//2.4.删除今天可能重做生成的数据(计划重做后进行了计划的编辑)
if
(
iplanTaskDao
.
findById
(
plan
.
getPlanTaskId
())
!=
null
&&
plan
.
getFirstFlag
()
==
XJConstant
.
PLAN_FIRST_STATUS_YES
)
if
(
iplanTaskDao
.
findById
(
plan
.
getPlanTaskId
())
.
isPresent
()
&&
plan
.
getFirstFlag
()
==
XJConstant
.
PLAN_FIRST_STATUS_YES
)
{
if
(
iplanTaskDao
.
existsById
(
plan
.
getPlanTaskId
()))
{
iplanTaskDao
.
deleteById
(
plan
.
getPlanTaskId
());
}
}
//2.5.插入planTask及planTaskDetail
insertPlanTaskAndDet
(
list
,
plan
,
XJConstant
.
SCHED_FLAG
,
now
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/task/PlanTaskJob.java
0 → 100644
View file @
7b8cfff9
package
com
.
yeejoin
.
amos
.
maintenance
.
task
;
import
com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
/**
* @author DELL
*/
@Component
@EnableScheduling
public
class
PlanTaskJob
{
@Autowired
private
IPlanTaskService
planTaskService
;
/**
* 定时查询任务状态
*/
@Scheduled
(
cron
=
"${jobs.cron}"
)
public
void
scheduleJob
()
{
planTaskService
.
taskExecution
(
null
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment