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
e682d724
Commit
e682d724
authored
Apr 25, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
巡检添加中心级/站端标识 -> 是否跑定时任务
parent
576fbc9b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
PlanTaskController.java
...n/amos/patrol/business/controller/PlanTaskController.java
+9
-0
application-dev.properties
...stem-patrol/src/main/resources/application-dev.properties
+4
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/PlanTaskController.java
View file @
e682d724
...
@@ -28,6 +28,7 @@ import io.swagger.annotations.ApiParam;
...
@@ -28,6 +28,7 @@ import io.swagger.annotations.ApiParam;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
...
@@ -58,6 +59,9 @@ public class PlanTaskController extends AbstractBaseController {
...
@@ -58,6 +59,9 @@ public class PlanTaskController extends AbstractBaseController {
@Autowired
@Autowired
private
IRouteService
routeService
;
private
IRouteService
routeService
;
@Value
(
"${params.isPush:false}"
)
private
Boolean
isZxj
;
@Autowired
@Autowired
private
RemoteSecurityService
remoteSecurityService
;
private
RemoteSecurityService
remoteSecurityService
;
...
@@ -386,6 +390,7 @@ public class PlanTaskController extends AbstractBaseController {
...
@@ -386,6 +390,7 @@ public class PlanTaskController extends AbstractBaseController {
@ApiOperation
(
value
=
"定时执行任务表生成(<font color='blue'>release</font>)"
,
notes
=
"定时执行任务表生成"
)
@ApiOperation
(
value
=
"定时执行任务表生成(<font color='blue'>release</font>)"
,
notes
=
"定时执行任务表生成"
)
@RequestMapping
(
value
=
"/queryOmission"
,
method
=
RequestMethod
.
GET
,
produces
=
"application/json;charset=UTF-8"
)
@RequestMapping
(
value
=
"/queryOmission"
,
method
=
RequestMethod
.
GET
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResponse
pushCarData
()
{
public
CommonResponse
pushCarData
()
{
if
(
Boolean
.
TRUE
.
equals
(!
isZxj
))
{
try
{
try
{
RequestAttributes
reqs
=
RequestContextHolder
.
getRequestAttributes
();
RequestAttributes
reqs
=
RequestContextHolder
.
getRequestAttributes
();
RequestContextHolder
.
setRequestAttributes
(
reqs
,
true
);
RequestContextHolder
.
setRequestAttributes
(
reqs
,
true
);
...
@@ -397,16 +402,20 @@ public class PlanTaskController extends AbstractBaseController {
...
@@ -397,16 +402,20 @@ public class PlanTaskController extends AbstractBaseController {
return
CommonResponseUtil
.
failure
();
return
CommonResponseUtil
.
failure
();
}
}
}
}
return
CommonResponseUtil
.
success
();
}
/**
/**
* 定时任务推送巡检待办任务消息
* 定时任务推送巡检待办任务消息
*/
*/
@Scheduled
(
cron
=
"${jobs.cron}"
)
@Scheduled
(
cron
=
"${jobs.cron}"
)
public
void
taskMessage
()
{
public
void
taskMessage
()
{
if
(
Boolean
.
TRUE
.
equals
(!
isZxj
))
{
RequestAttributes
reqs
=
RequestContextHolder
.
getRequestAttributes
();
RequestAttributes
reqs
=
RequestContextHolder
.
getRequestAttributes
();
RequestContextHolder
.
setRequestAttributes
(
reqs
,
true
);
RequestContextHolder
.
setRequestAttributes
(
reqs
,
true
);
planTaskService
.
taskMessage
(
null
);
planTaskService
.
taskMessage
(
null
);
}
}
}
/**
/**
* 模拟发送巡检待办任务消息定时任务
* 模拟发送巡检待办任务消息定时任务
...
...
amos-boot-system-patrol/src/main/resources/application-dev.properties
View file @
e682d724
...
@@ -96,3 +96,6 @@ file.url=http://172.16.11.201:9000/
...
@@ -96,3 +96,6 @@ file.url=http://172.16.11.201:9000/
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic
=
false
logic
=
false
#是否为中心级系统 true-中心级系统 false-站端系统
is.zxj
=
true
\ No newline at end of file
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