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
b7118dce
Commit
b7118dce
authored
Oct 16, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改预警问题
parent
e17e8ecc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
24 deletions
+34
-24
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+11
-0
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+23
-24
No files found.
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 @
b7118dce
...
@@ -132,6 +132,9 @@ public class CommonServiceImpl {
...
@@ -132,6 +132,9 @@ public class CommonServiceImpl {
@Autowired
@Autowired
IdxBizPvPointVarCentralValueMapper
idxBizPvPointVarCentralValueMapper
;
IdxBizPvPointVarCentralValueMapper
idxBizPvPointVarCentralValueMapper
;
@Autowired
HealthStatusIndicatorServiceImpl
healthStatusIndicatorService
;
/**
/**
* @return
* @return
* @deprecated 获取工况变量列表风机
* @deprecated 获取工况变量列表风机
...
@@ -1462,6 +1465,7 @@ public class CommonServiceImpl {
...
@@ -1462,6 +1465,7 @@ public class CommonServiceImpl {
@Async
(
"async"
)
@Async
(
"async"
)
public
void
healthWarningMinuteByFan
()
{
public
void
healthWarningMinuteByFan
()
{
Date
time
=
new
Date
();
Date
time
=
new
Date
();
Calendar
calendar
=
Calendar
.
getInstance
();
List
<
IdxBizFanPointProcessVariableClassificationDto
>
data
=
idxBizFanPointProcessVariableClassificationMapper
.
getInfluxDBData
();
List
<
IdxBizFanPointProcessVariableClassificationDto
>
data
=
idxBizFanPointProcessVariableClassificationMapper
.
getInfluxDBData
();
Map
<
String
,
List
<
IdxBizFanPointProcessVariableClassificationDto
>>
maps
=
data
.
stream
().
collect
(
Collectors
.
groupingBy
(
IdxBizFanPointProcessVariableClassificationDto:
:
getGatewayId
));
Map
<
String
,
List
<
IdxBizFanPointProcessVariableClassificationDto
>>
maps
=
data
.
stream
().
collect
(
Collectors
.
groupingBy
(
IdxBizFanPointProcessVariableClassificationDto:
:
getGatewayId
));
BoolQueryBuilder
boolMustAll
=
QueryBuilders
.
boolQuery
();
BoolQueryBuilder
boolMustAll
=
QueryBuilders
.
boolQuery
();
...
@@ -1603,6 +1607,10 @@ public class CommonServiceImpl {
...
@@ -1603,6 +1607,10 @@ public class CommonServiceImpl {
try
{
try
{
logger
.
info
(
"--------------------response: "
+
response
);
logger
.
info
(
"--------------------response: "
+
response
);
logger
.
info
(
"------------------------------------------调用健康指数计算算法结束----------------------------------------"
);
logger
.
info
(
"------------------------------------------调用健康指数计算算法结束----------------------------------------"
);
logger
.
info
(
"------------------------------------------开始计算预警----------------------------------------"
);
healthStatusIndicatorService
.
healthWarningMinute
(
calendar
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
...
@@ -1613,6 +1621,7 @@ public class CommonServiceImpl {
...
@@ -1613,6 +1621,7 @@ public class CommonServiceImpl {
@Scheduled
(
cron
=
"0 0/10 * * * ?"
)
@Scheduled
(
cron
=
"0 0/10 * * * ?"
)
@Async
(
"async"
)
@Async
(
"async"
)
public
void
healthWarningMinuteByPv
()
{
public
void
healthWarningMinuteByPv
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
Date
time
=
new
Date
();
Date
time
=
new
Date
();
List
<
IdxBizPvPointProcessVariableClassificationDto
>
data
=
idxBizPvPointProcessVariableClassificationMapper
.
getInfluxDBData
();
List
<
IdxBizPvPointProcessVariableClassificationDto
>
data
=
idxBizPvPointProcessVariableClassificationMapper
.
getInfluxDBData
();
Map
<
String
,
List
<
IdxBizPvPointProcessVariableClassificationDto
>>
maps
=
data
.
stream
().
collect
(
Collectors
.
groupingBy
(
IdxBizPvPointProcessVariableClassificationDto:
:
getGatewayId
));
Map
<
String
,
List
<
IdxBizPvPointProcessVariableClassificationDto
>>
maps
=
data
.
stream
().
collect
(
Collectors
.
groupingBy
(
IdxBizPvPointProcessVariableClassificationDto:
:
getGatewayId
));
...
@@ -1744,6 +1753,8 @@ public class CommonServiceImpl {
...
@@ -1744,6 +1753,8 @@ public class CommonServiceImpl {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
healthStatusIndicatorService
.
healthWarningMinuteGF
(
calendar
);
}
}
...
...
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 @
b7118dce
...
@@ -67,10 +67,10 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -67,10 +67,10 @@ public class HealthStatusIndicatorServiceImpl {
*
*
*/
*/
@Scheduled
(
cron
=
"0 0 */1 * * ?"
)
//
@Scheduled(cron = "0 0 */1 * * ?")
@Async
(
"async"
)
@Async
(
"async"
)
public
void
healthWarningMinuteGF
()
{
public
void
healthWarningMinuteGF
(
Calendar
calendar
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
//
Calendar calendar = Calendar.getInstance();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
1
);
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
1
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
...
@@ -183,7 +183,7 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -183,7 +183,7 @@ public class HealthStatusIndicatorServiceImpl {
*
*
*/
*/
@Scheduled
(
cron
=
"0 0
*/5
* * ?"
)
@Scheduled
(
cron
=
"0 0
0/1
* * ?"
)
@Async
(
"async"
)
@Async
(
"async"
)
public
void
healthWarningHourGF
()
{
public
void
healthWarningHourGF
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
...
@@ -230,15 +230,15 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -230,15 +230,15 @@ public class HealthStatusIndicatorServiceImpl {
for
(
IdxBizPvWarningRuleSet
e
:
idxBizPvWarningRuleSets
)
{
for
(
IdxBizPvWarningRuleSet
e
:
idxBizPvWarningRuleSets
)
{
switch
(
e
.
getWarningName
()){
switch
(
e
.
getWarningName
()){
case
"警告"
:
case
"警告"
:
healthValueWarn
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
e
.
getWarningIf
().
length
()-
2
));
healthValueWarn
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
2
));
healthValueHourCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
healthValueHourCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
break
;
break
;
case
"危险"
:
case
"危险"
:
healthValueRisk
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
e
.
getWarningIf
().
length
()-
2
));
healthValueRisk
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
2
));
healthValueHourCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
healthValueHourCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
break
;
break
;
case
"注意"
:
case
"注意"
:
healthValueNotice
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
e
.
getWarningIf
().
length
()-
2
));
healthValueNotice
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
2
));
healthValueHourCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
healthValueHourCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
break
;
break
;
}
}
...
@@ -304,7 +304,7 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -304,7 +304,7 @@ public class HealthStatusIndicatorServiceImpl {
*
*
*/
*/
@Scheduled
(
cron
=
"0 0 0
*/3
* ? "
)
@Scheduled
(
cron
=
"0 0 0
0/1
* ? "
)
@Async
(
"async"
)
@Async
(
"async"
)
public
void
healthWarningDayGF
()
{
public
void
healthWarningDayGF
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
...
@@ -352,15 +352,15 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -352,15 +352,15 @@ public class HealthStatusIndicatorServiceImpl {
for
(
IdxBizPvWarningRuleSet
e
:
idxBizPvWarningRuleSets
)
{
for
(
IdxBizPvWarningRuleSet
e
:
idxBizPvWarningRuleSets
)
{
switch
(
e
.
getWarningName
()){
switch
(
e
.
getWarningName
()){
case
"警告"
:
case
"警告"
:
healthValueWarn
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
e
.
getWarningIf
().
length
()-
2
));
healthValueWarn
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
2
));
healthValueDayCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
healthValueDayCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
break
;
break
;
case
"危险"
:
case
"危险"
:
healthValueRisk
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
e
.
getWarningIf
().
length
()-
2
));
healthValueRisk
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
2
));
healthValueDayCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
healthValueDayCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
break
;
break
;
case
"注意"
:
case
"注意"
:
healthValueNotice
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
e
.
getWarningIf
().
length
()-
2
));
healthValueNotice
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
2
));
healthValueDayCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
healthValueDayCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
break
;
break
;
}
}
...
@@ -419,10 +419,10 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -419,10 +419,10 @@ public class HealthStatusIndicatorServiceImpl {
}
}
@Scheduled
(
cron
=
"0 0 */1 * * ?"
)
//
@Scheduled(cron = "0 0 */1 * * ?")
@Async
(
"async"
)
@Async
(
"async"
)
public
void
healthWarningMinute
()
{
public
void
healthWarningMinute
(
Calendar
calendar
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
//
Calendar calendar = Calendar.getInstance();
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
1
);
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
)-
1
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
);
...
@@ -540,7 +540,7 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -540,7 +540,7 @@ public class HealthStatusIndicatorServiceImpl {
*
*
*/
*/
@Scheduled
(
cron
=
"0 0
*/5
* * ?"
)
@Scheduled
(
cron
=
"0 0
0/1
* * ?"
)
@Async
(
"async"
)
@Async
(
"async"
)
public
void
healthWarningHour
()
{
public
void
healthWarningHour
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
...
@@ -583,15 +583,15 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -583,15 +583,15 @@ public class HealthStatusIndicatorServiceImpl {
for
(
IdxBizFanWarningRuleSet
e
:
idxBizPvWarningRuleSets
)
{
for
(
IdxBizFanWarningRuleSet
e
:
idxBizPvWarningRuleSets
)
{
switch
(
e
.
getWarningName
()){
switch
(
e
.
getWarningName
()){
case
"警告"
:
case
"警告"
:
healthValueWarn
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
e
.
getWarningIf
().
length
()-
2
));
healthValueWarn
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
2
));
healthValueHourCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
healthValueHourCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
break
;
break
;
case
"危险"
:
case
"危险"
:
healthValueRisk
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
e
.
getWarningIf
().
length
()-
2
));
healthValueRisk
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
2
));
healthValueHourCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
healthValueHourCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
break
;
break
;
case
"注意"
:
case
"注意"
:
healthValueNotice
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
e
.
getWarningIf
().
length
()-
2
));
healthValueNotice
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
2
));
healthValueHourCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
healthValueHourCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
break
;
break
;
}
}
...
@@ -658,7 +658,7 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -658,7 +658,7 @@ public class HealthStatusIndicatorServiceImpl {
*
*
*/
*/
@Scheduled
(
cron
=
"0 0 0
*/3
* ? "
)
@Scheduled
(
cron
=
"0 0 0
0/1
* ? "
)
@Async
(
"async"
)
@Async
(
"async"
)
public
void
healthWarningDay
()
{
public
void
healthWarningDay
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
...
@@ -693,22 +693,21 @@ public class HealthStatusIndicatorServiceImpl {
...
@@ -693,22 +693,21 @@ public class HealthStatusIndicatorServiceImpl {
Double
healthValueNotice
=
0.0
;
Double
healthValueNotice
=
0.0
;
long
healthValueDayCount
=
0
;
long
healthValueDayCount
=
0
;
long
healthValueHourCount
=
0
;
long
healthValueMinCount
=
0
;
for
(
IdxBizFanWarningRuleSet
e
:
idxBizPvWarningRuleSets
)
{
for
(
IdxBizFanWarningRuleSet
e
:
idxBizPvWarningRuleSets
)
{
switch
(
e
.
getWarningName
()){
switch
(
e
.
getWarningName
()){
case
"警告"
:
case
"警告"
:
healthValueWarn
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
e
.
getWarningIf
().
length
()-
2
));
healthValueWarn
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
2
));
healthValueDayCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
healthValueDayCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
break
;
break
;
case
"危险"
:
case
"危险"
:
healthValueRisk
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
e
.
getWarningIf
().
length
()-
2
));
healthValueRisk
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
2
));
healthValueDayCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
healthValueDayCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
break
;
break
;
case
"注意"
:
case
"注意"
:
healthValueNotice
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
e
.
getWarningIf
().
length
()-
2
));
healthValueNotice
=
Double
.
parseDouble
(
e
.
getWarningIf
().
substring
(
2
));
healthValueDayCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
healthValueDayCount
=
Long
.
parseLong
(
e
.
getWarningCycle
());
break
;
break
;
}
}
...
...
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