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
dc72176e
Commit
dc72176e
authored
Oct 13, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
cf5aeeae
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
10 deletions
+48
-10
AsyncScheduledTaskConfig.java
...oot/module/jxiop/biz/config/AsyncScheduledTaskConfig.java
+29
-0
IdxBizFanWarningRuleSet.java
...boot/module/jxiop/biz/entity/IdxBizFanWarningRuleSet.java
+3
-2
IdxBizPvWarningRuleSet.java
.../boot/module/jxiop/biz/entity/IdxBizPvWarningRuleSet.java
+3
-2
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+0
-0
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+13
-6
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/config/AsyncScheduledTaskConfig.java
0 → 100644
View file @
dc72176e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.stereotype.Component
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.ThreadPoolExecutor
;
@Component
public
class
AsyncScheduledTaskConfig
{
@Bean
(
"async"
)
public
Executor
asyncScheduledTask
(){
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
executor
.
setMaxPoolSize
(
50
);
executor
.
setCorePoolSize
(
20
);
executor
.
setQueueCapacity
(
50
);
executor
.
setThreadNamePrefix
(
"async-thread-"
);
executor
.
setKeepAliveSeconds
(
60
);
executor
.
setRejectedExecutionHandler
(
new
ThreadPoolExecutor
.
AbortPolicy
(){});
executor
.
initialize
();
return
executor
;
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizFanWarningRuleSet.java
View file @
dc72176e
...
...
@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import
lombok.experimental.Accessors
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
/**
*
...
...
@@ -39,7 +40,7 @@ public class IdxBizFanWarningRuleSet{
*
*/
@TableField
(
"REC_DATE"
)
private
LocalDateTim
e
recDate
;
private
Dat
e
recDate
;
/**
*
...
...
@@ -81,7 +82,7 @@ public class IdxBizFanWarningRuleSet{
*
*/
@TableField
(
"ANALYSIS_POINT_ID"
)
private
Integer
analysisPointId
;
private
String
analysisPointId
;
/**
* 分析周期((按天、10min、小时)
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizPvWarningRuleSet.java
View file @
dc72176e
...
...
@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
import
lombok.experimental.Accessors
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
/**
*
...
...
@@ -39,7 +40,7 @@ public class IdxBizPvWarningRuleSet{
*
*/
@TableField
(
"REC_DATE"
)
private
LocalDateTim
e
recDate
;
private
Dat
e
recDate
;
/**
*
...
...
@@ -81,7 +82,7 @@ public class IdxBizPvWarningRuleSet{
* 分析变量测点ID
*/
@TableField
(
"ANALYSIS_POINT_ID"
)
private
Integer
analysisPointId
;
private
String
analysisPointId
;
/**
* 分析周期((按天、10min、小时)
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
dc72176e
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HealthStatusIndicatorServiceImpl.java
View file @
dc72176e
...
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.*;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
...
...
@@ -66,7 +67,8 @@ public class HealthStatusIndicatorServiceImpl {
*/
@Scheduled
(
cron
=
"0 0 */1 * * ?"
)
private
void
healthWarningMinuteGF
()
{
@Async
(
"async"
)
public
void
healthWarningMinuteGF
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
1
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
...
...
@@ -169,7 +171,8 @@ public class HealthStatusIndicatorServiceImpl {
*/
@Scheduled
(
cron
=
"0 0 */5 * * ?"
)
private
void
healthWarningHourGF
()
{
@Async
(
"async"
)
public
void
healthWarningHourGF
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
5
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
...
...
@@ -276,7 +279,8 @@ public class HealthStatusIndicatorServiceImpl {
*/
@Scheduled
(
cron
=
"0 0 0 */3 * ? "
)
private
void
healthWarningDayGF
()
{
@Async
(
"async"
)
public
void
healthWarningDayGF
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
)-
3
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
...
...
@@ -375,7 +379,8 @@ public class HealthStatusIndicatorServiceImpl {
@Scheduled
(
cron
=
"0 0/5 * * * ?"
)
private
void
healthWarningMinute
()
{
@Async
(
"async"
)
public
void
healthWarningMinute
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
1
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
...
...
@@ -482,7 +487,8 @@ public class HealthStatusIndicatorServiceImpl {
*/
@Scheduled
(
cron
=
"0 0 */5 * * ?"
)
private
void
healthWarningHour
()
{
@Async
(
"async"
)
public
void
healthWarningHour
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
5
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
...
...
@@ -589,7 +595,8 @@ public class HealthStatusIndicatorServiceImpl {
*/
@Scheduled
(
cron
=
"0 0 0 */3 * ? "
)
private
void
healthWarningDay
()
{
@Async
(
"async"
)
public
void
healthWarningDay
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
)-
3
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
...
...
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