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
959f022c
Commit
959f022c
authored
Nov 03, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.根据预警周期动态返回数据
parent
5567c659
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
29 deletions
+18
-29
AlarmInfoDetailServiceImpl.java
...le/jxiop/biz/service/impl/AlarmInfoDetailServiceImpl.java
+18
-29
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/AlarmInfoDetailServiceImpl.java
View file @
959f022c
...
@@ -168,6 +168,9 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
...
@@ -168,6 +168,9 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
HashMap
<
String
,
Object
>
result
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
result
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
alarmTrendMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
alarmTrendMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
maxValueAndWaringCycle
=
getWaringCycleAndMaxValueByWaring
(
idxBizFanWarningRecord
.
getWarningPeriod
(),
idxBizFanWarningRecord
.
getCONTENT
(),
idxBizFanWarningRecord
.
getPointName
());
HashMap
<
String
,
Object
>
maxValueAndWaringCycle
=
getWaringCycleAndMaxValueByWaring
(
idxBizFanWarningRecord
.
getWarningPeriod
(),
idxBizFanWarningRecord
.
getCONTENT
(),
idxBizFanWarningRecord
.
getPointName
());
Integer
warningCycle
=
Integer
.
valueOf
(
maxValueAndWaringCycle
.
get
(
"warningCycle"
).
toString
());
alarmTrendMap
.
put
(
"maxValue"
,
maxValueAndWaringCycle
.
get
(
"maxValue"
));
alarmTrendMap
.
put
(
"warningCycle"
,
warningCycle
);
List
<
HashMap
<
String
,
String
>>
alarmAbnormalityList
=
new
ArrayList
<>();
List
<
HashMap
<
String
,
String
>>
alarmAbnormalityList
=
new
ArrayList
<>();
List
<
IdxBizFanHealthIndex
>
idxBizFanHealthIndexList
=
idxBizFanHealthIndexMapper
.
selectList
(
new
QueryWrapper
<
IdxBizFanHealthIndex
>()
List
<
IdxBizFanHealthIndex
>
idxBizFanHealthIndexList
=
idxBizFanHealthIndexMapper
.
selectList
(
new
QueryWrapper
<
IdxBizFanHealthIndex
>()
.
eq
(
"GATEWAY_ID"
,
idxBizFanWarningRecord
.
getGatewayId
())
.
eq
(
"GATEWAY_ID"
,
idxBizFanWarningRecord
.
getGatewayId
())
...
@@ -190,39 +193,19 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
...
@@ -190,39 +193,19 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
alarmAbnormalityItem
.
put
(
"time"
,
idxBizFanHealthIndex
.
getANALYSISTIME
());
alarmAbnormalityItem
.
put
(
"time"
,
idxBizFanHealthIndex
.
getANALYSISTIME
());
alarmAbnormalityItem
.
put
(
"abnormal"
,
String
.
valueOf
(
idxBizFanHealthIndex
.
getANOMALY
()).
replace
(
"null"
,
"0.0"
));
alarmAbnormalityItem
.
put
(
"abnormal"
,
String
.
valueOf
(
idxBizFanHealthIndex
.
getANOMALY
()).
replace
(
"null"
,
"0.0"
));
alarmAbnormalityItem
.
put
(
"healthValue"
,
String
.
valueOf
(
idxBizFanHealthIndex
.
getHealthIndex
()));
alarmAbnormalityItem
.
put
(
"healthValue"
,
String
.
valueOf
(
idxBizFanHealthIndex
.
getHealthIndex
()));
if
(
idxBizFanHealthIndexListSize
>=
3
)
{
if
(
i
==
0
)
{
endTime
=
handlerDateStr
(
idxBizFanHealthIndex
.
getANALYSISTIME
(),
-
8
,
5
);
}
if
(
i
==
2
)
{
startTime
=
handlerDateStr
(
idxBizFanHealthIndex
.
getANALYSISTIME
(),
-
8
,
-
5
);
}
}
if
(
idxBizFanHealthIndexListSize
==
2
)
{
if
(
i
==
0
)
{
endTime
=
handlerDateStr
(
idxBizFanHealthIndex
.
getANALYSISTIME
(),
-
8
,
5
);
}
if
(
i
==
1
)
{
startTime
=
handlerDateStr
(
idxBizFanHealthIndex
.
getANALYSISTIME
(),
-
8
,
-
5
);
}
}
if
(
idxBizFanHealthIndexListSize
==
1
)
{
if
(
i
==
0
)
{
endTime
=
handlerDateStr
(
idxBizFanHealthIndex
.
getANALYSISTIME
(),
-
8
,
5
);
startTime
=
handlerDateStr
(
idxBizFanHealthIndex
.
getANALYSISTIME
(),
-
8
,
-
5
);
}
}
alarmAbnormalityList
.
add
(
alarmAbnormalityItem
);
alarmAbnormalityList
.
add
(
alarmAbnormalityItem
);
}
}
alarmTrendMap
.
put
(
"xDatas"
,
xDatas
);
alarmTrendMap
.
put
(
"xDatas"
,
xDatas
);
alarmTrendMap
.
put
(
"yDatas"
,
yDatas
);
alarmTrendMap
.
put
(
"yDatas"
,
yDatas
);
alarmTrendMap
.
put
(
"maxValue"
,
maxValueAndWaringCycle
.
get
(
"maxValue"
));
alarmTrendMap
.
put
(
"warningCycle"
,
maxValueAndWaringCycle
.
get
(
"warningCycle"
));
result
.
put
(
"alarmTrend"
,
alarmTrendMap
);
result
.
put
(
"alarmTrend"
,
alarmTrendMap
);
// 异常度 alarmAbnormality
// 异常度 alarmAbnormality
int
alarmAbnormalitySize
=
idxBizFanHealthIndexListSize
>=
3
?
3
:
idxBizFanHealthIndexListSize
;
alarmAbnormalityList
=
alarmAbnormalityList
.
subList
(
alarmAbnormalityList
.
size
()
-
warningCycle
,
alarmAbnormalityList
.
size
());
alarmAbnormalityList
=
alarmAbnormalityList
.
subList
(
alarmAbnormalityList
.
size
()
-
alarmAbnormalitySize
,
alarmAbnormalityList
.
size
());
alarmAbnormalityList
.
sort
(
Comparator
.
comparingInt
(
o
->
Integer
.
parseInt
(
o
.
get
(
"sort"
))));
alarmAbnormalityList
.
sort
(
Comparator
.
comparingInt
(
o
->
Integer
.
parseInt
(
o
.
get
(
"sort"
))));
if
(
alarmAbnormalityList
.
size
()>
0
){
endTime
=
handlerDateStr
(
alarmAbnormalityList
.
get
(
0
).
get
(
"time"
),-
8
,
5
);
startTime
=
handlerDateStr
(
alarmAbnormalityList
.
get
(
alarmAbnormalityList
.
size
()-
1
).
get
(
"time"
),-
8
,-
5
);
}
result
.
put
(
"alarmAbnormalityList"
,
alarmAbnormalityList
);
result
.
put
(
"alarmAbnormalityList"
,
alarmAbnormalityList
);
result
.
put
(
"startTime"
,
startTime
);
result
.
put
(
"startTime"
,
startTime
);
result
.
put
(
"endTime"
,
endTime
);
result
.
put
(
"endTime"
,
endTime
);
...
@@ -238,6 +221,9 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
...
@@ -238,6 +221,9 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
HashMap
<
String
,
Object
>
result
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
result
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
alarmTrendMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
alarmTrendMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
maxValueAndWaringCycle
=
getWaringCycleAndMaxValueByWaring
(
idxBizPvWarningRecord
.
getWarningPeriod
(),
idxBizPvWarningRecord
.
getCONTENT
(),
idxBizPvWarningRecord
.
getPointName
());
HashMap
<
String
,
Object
>
maxValueAndWaringCycle
=
getWaringCycleAndMaxValueByWaring
(
idxBizPvWarningRecord
.
getWarningPeriod
(),
idxBizPvWarningRecord
.
getCONTENT
(),
idxBizPvWarningRecord
.
getPointName
());
Integer
warningCycle
=
Integer
.
valueOf
(
maxValueAndWaringCycle
.
get
(
"warningCycle"
).
toString
());
alarmTrendMap
.
put
(
"maxValue"
,
maxValueAndWaringCycle
.
get
(
"maxValue"
));
alarmTrendMap
.
put
(
"warningCycle"
,
warningCycle
);
List
<
HashMap
<
String
,
String
>>
alarmAbnormalityList
=
new
ArrayList
<>();
List
<
HashMap
<
String
,
String
>>
alarmAbnormalityList
=
new
ArrayList
<>();
List
<
IdxBizPvHealthIndex
>
idxBizPvHealthIndexList
=
idxBizPvHealthIndexMapper
.
selectList
(
new
QueryWrapper
<
IdxBizPvHealthIndex
>()
List
<
IdxBizPvHealthIndex
>
idxBizPvHealthIndexList
=
idxBizPvHealthIndexMapper
.
selectList
(
new
QueryWrapper
<
IdxBizPvHealthIndex
>()
.
eq
(
"GATEWAY_ID"
,
idxBizPvWarningRecord
.
getGatewayId
())
.
eq
(
"GATEWAY_ID"
,
idxBizPvWarningRecord
.
getGatewayId
())
...
@@ -290,9 +276,12 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
...
@@ -290,9 +276,12 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
alarmTrendMap
.
put
(
"warningCycle"
,
maxValueAndWaringCycle
.
get
(
"warningCycle"
));
alarmTrendMap
.
put
(
"warningCycle"
,
maxValueAndWaringCycle
.
get
(
"warningCycle"
));
result
.
put
(
"alarmTrend"
,
alarmTrendMap
);
result
.
put
(
"alarmTrend"
,
alarmTrendMap
);
// 异常度 alarmAbnormality
// 异常度 alarmAbnormality
int
alarmAbnormalitySize
=
idxBizPvHealthIndexListSize
>=
3
?
3
:
idxBizPvHealthIndexListSize
;
alarmAbnormalityList
=
alarmAbnormalityList
.
subList
(
alarmAbnormalityList
.
size
()
-
warningCycle
,
alarmAbnormalityList
.
size
());
alarmAbnormalityList
=
alarmAbnormalityList
.
subList
(
alarmAbnormalityList
.
size
()
-
alarmAbnormalitySize
,
alarmAbnormalityList
.
size
());
alarmAbnormalityList
.
sort
(
Comparator
.
comparingInt
(
o
->
Integer
.
parseInt
(
o
.
get
(
"sort"
))));
alarmAbnormalityList
.
sort
(
Comparator
.
comparingInt
(
o
->
Integer
.
parseInt
(
o
.
get
(
"sort"
))));
if
(
alarmAbnormalityList
.
size
()>
0
){
endTime
=
handlerDateStr
(
alarmAbnormalityList
.
get
(
0
).
get
(
"time"
),-
8
,
5
);
startTime
=
handlerDateStr
(
alarmAbnormalityList
.
get
(
alarmAbnormalityList
.
size
()-
1
).
get
(
"time"
),-
8
,-
5
);
}
result
.
put
(
"alarmAbnormalityList"
,
alarmAbnormalityList
);
result
.
put
(
"alarmAbnormalityList"
,
alarmAbnormalityList
);
result
.
put
(
"startTime"
,
startTime
);
result
.
put
(
"startTime"
,
startTime
);
result
.
put
(
"endTime"
,
endTime
);
result
.
put
(
"endTime"
,
endTime
);
...
@@ -625,7 +614,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
...
@@ -625,7 +614,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
String
spiltStr
=
CommonConstans
.
waringPeriodTowaringCycle
.
get
(
warningPeriod
);
String
spiltStr
=
CommonConstans
.
waringPeriodTowaringCycle
.
get
(
warningPeriod
);
String
[]
strings
=
warningContenct
.
split
(
spiltStr
);
String
[]
strings
=
warningContenct
.
split
(
spiltStr
);
Double
maxValue
=
0.0
;
Double
maxValue
=
0.0
;
Integer
warningCycle
=
0
;
Integer
warningCycle
=
1
;
if
(
strings
.
length
==
2
){
if
(
strings
.
length
==
2
){
if
(
spiltStr
.
equals
(
"分钟"
)){
if
(
spiltStr
.
equals
(
"分钟"
)){
warningCycle
=
Integer
.
valueOf
(
strings
[
0
])/
10
;
warningCycle
=
Integer
.
valueOf
(
strings
[
0
])/
10
;
...
...
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