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
511a37dc
Commit
511a37dc
authored
Nov 08, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
预警详情修改
parent
cbbf9846
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
32 deletions
+44
-32
AlarmInfoDetailServiceImpl.java
...le/jxiop/biz/service/impl/AlarmInfoDetailServiceImpl.java
+44
-32
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 @
511a37dc
...
@@ -7,9 +7,13 @@ import com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans;
...
@@ -7,9 +7,13 @@ import com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IAlarmInfoDetailService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IAlarmInfoDetailService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -54,6 +58,13 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
...
@@ -54,6 +58,13 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
@Autowired
@Autowired
private
PvWaringRecordMapper
pvWaringRecordMapper
;
private
PvWaringRecordMapper
pvWaringRecordMapper
;
@Autowired
FanHealthIndexMapper
fanHealthIndexMapper
;
@Autowired
PvHealthIndexMapper
pvHealthIndexMapper
;
@Override
@Override
public
Map
<
String
,
Object
>
getAlramInfoDetailOfFan
(
String
id
)
{
public
Map
<
String
,
Object
>
getAlramInfoDetailOfFan
(
String
id
)
{
...
@@ -184,26 +195,27 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
...
@@ -184,26 +195,27 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
alarmTrendMap
.
put
(
"maxValue"
,
maxValueAndWaringCycle
.
get
(
"maxValue"
));
alarmTrendMap
.
put
(
"maxValue"
,
maxValueAndWaringCycle
.
get
(
"maxValue"
));
alarmTrendMap
.
put
(
"warningCycle"
,
warningCycle
);
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
<
FanHealthIndex
>
idxBizFanHealthIndexList
=
fanHealthIndexMapper
.
selectList
(
new
QueryWrapper
<
FanHealthIndex
>()
.
eq
(
"GATEWAY_ID"
,
idxBizFanWarningRecord
.
getGatewayId
())
.
eq
(
"gateway_id"
,
idxBizFanWarningRecord
.
getGatewayId
())
.
eq
(
"INDEX_ADDRESS"
,
idxBizFanWarningRecord
.
getIndexAddress
())
.
eq
(
"index_address"
,
idxBizFanWarningRecord
.
getIndexAddress
())
.
eq
(
"ANALYSIS_TYPE"
,
idxBizFanWarningRecord
.
getWarningPeriod
())
.
eq
(
"analysis_type"
,
idxBizFanWarningRecord
.
getWarningPeriod
())
.
le
(
"ANALYSIS_TIME"
,
DateUtil
.
offsetMinute
(
DateUtil
.
parse
(
idxBizFanWarningRecord
.
getRecDate
(),
DatePattern
.
NORM_DATETIME_PATTERN
),
1
))
//时区减8小时 时间加1分钟
.
orderByDesc
(
"ANALYSIS_TIME"
)
.
le
(
"ts"
,
DateUtil
.
offsetMinute
(
DateUtil
.
parse
(
idxBizFanWarningRecord
.
getRecDate
(),
DatePattern
.
NORM_DATETIME_PATTERN
),
-
479
))
.
orderByDesc
(
"ts"
)
.
last
(
"limit 30"
));
.
last
(
"limit 30"
));
List
<
String
>
xDatas
=
new
ArrayList
<>();
List
<
String
>
xDatas
=
new
ArrayList
<>();
List
<
Double
>
yDatas
=
new
ArrayList
<>();
List
<
Double
>
yDatas
=
new
ArrayList
<>();
String
startTime
=
""
;
String
startTime
=
idxBizFanWarningRecord
.
getRecDate
()
;
String
endTime
=
""
;
String
endTime
=
idxBizFanWarningRecord
.
getRecDate
()
;
int
idxBizFanHealthIndexListSize
=
idxBizFanHealthIndexList
.
size
();
int
idxBizFanHealthIndexListSize
=
idxBizFanHealthIndexList
.
size
();
for
(
int
i
=
idxBizFanHealthIndexListSize
-
1
;
i
>=
0
;
i
--)
{
for
(
int
i
=
idxBizFanHealthIndexListSize
-
1
;
i
>=
0
;
i
--)
{
HashMap
<
String
,
String
>
alarmAbnormalityItem
=
new
HashMap
<>();
HashMap
<
String
,
String
>
alarmAbnormalityItem
=
new
HashMap
<>();
IdxBiz
FanHealthIndex
idxBizFanHealthIndex
=
idxBizFanHealthIndexList
.
get
(
i
);
FanHealthIndex
idxBizFanHealthIndex
=
idxBizFanHealthIndexList
.
get
(
i
);
xDatas
.
add
(
idxBizFanHealthIndex
.
getA
NALYSISTIME
());
xDatas
.
add
(
idxBizFanHealthIndex
.
getA
nalysisTime
());
yDatas
.
add
(
idxBizFanHealthIndex
.
getHealthIndex
());
yDatas
.
add
(
idxBizFanHealthIndex
.
getHealthIndex
());
alarmAbnormalityItem
.
put
(
"sort"
,
String
.
valueOf
(
i
));
alarmAbnormalityItem
.
put
(
"sort"
,
String
.
valueOf
(
i
));
alarmAbnormalityItem
.
put
(
"time"
,
idxBizFanHealthIndex
.
getA
NALYSISTIME
());
alarmAbnormalityItem
.
put
(
"time"
,
idxBizFanHealthIndex
.
getA
nalysisTime
());
alarmAbnormalityItem
.
put
(
"abnormal"
,
String
.
valueOf
(
idxBizFanHealthIndex
.
getA
NOMALY
()).
replace
(
"null"
,
"0.0"
));
alarmAbnormalityItem
.
put
(
"abnormal"
,
String
.
valueOf
(
idxBizFanHealthIndex
.
getA
nomaly
()).
replace
(
"null"
,
"0.0"
));
alarmAbnormalityItem
.
put
(
"healthValue"
,
String
.
valueOf
(
idxBizFanHealthIndex
.
getHealthIndex
()));
alarmAbnormalityItem
.
put
(
"healthValue"
,
String
.
valueOf
(
idxBizFanHealthIndex
.
getHealthIndex
()));
alarmAbnormalityList
.
add
(
alarmAbnormalityItem
);
alarmAbnormalityList
.
add
(
alarmAbnormalityItem
);
}
}
...
@@ -212,7 +224,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
...
@@ -212,7 +224,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
result
.
put
(
"alarmTrend"
,
alarmTrendMap
);
result
.
put
(
"alarmTrend"
,
alarmTrendMap
);
// 异常度 alarmAbnormality
// 异常度 alarmAbnormality
alarmAbnormalityList
=
alarmAbnormalityList
.
subList
(
alarmAbnormalityList
.
size
()
-
warningCycle
,
alarmAbnormalityList
.
size
());
alarmAbnormalityList
=
alarmAbnormalityList
.
subList
(
alarmAbnormalityList
.
size
()
-
warningCycle
>=
0
?
alarmAbnormalityList
.
size
()
-
warningCycle
:
0
,
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
){
if
(
alarmAbnormalityList
.
size
()>
0
){
endTime
=
handlerDateStr
(
alarmAbnormalityList
.
get
(
0
).
get
(
"time"
),-
8
,
5
);
endTime
=
handlerDateStr
(
alarmAbnormalityList
.
get
(
0
).
get
(
"time"
),-
8
,
5
);
...
@@ -237,47 +249,47 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
...
@@ -237,47 +249,47 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
alarmTrendMap
.
put
(
"maxValue"
,
maxValueAndWaringCycle
.
get
(
"maxValue"
));
alarmTrendMap
.
put
(
"maxValue"
,
maxValueAndWaringCycle
.
get
(
"maxValue"
));
alarmTrendMap
.
put
(
"warningCycle"
,
warningCycle
);
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
<
IdxBiz
PvHealthIndex
>()
List
<
PvHealthIndex
>
idxBizPvHealthIndexList
=
pvHealthIndexMapper
.
selectList
(
new
QueryWrapper
<
PvHealthIndex
>()
.
eq
(
"
GATEWAY_ID
"
,
idxBizPvWarningRecord
.
getGatewayId
())
.
eq
(
"
gateway_id
"
,
idxBizPvWarningRecord
.
getGatewayId
())
.
eq
(
"
INDEX_ADDRESS
"
,
idxBizPvWarningRecord
.
getIndexAddress
())
.
eq
(
"
index_address
"
,
idxBizPvWarningRecord
.
getIndexAddress
())
.
eq
(
"
ANALYSIS_TYPE
"
,
idxBizPvWarningRecord
.
getWarningPeriod
())
.
eq
(
"
analysis_type
"
,
idxBizPvWarningRecord
.
getWarningPeriod
())
.
le
(
"
ANALYSIS_TIME"
,
DateUtil
.
offsetMinute
(
DateUtil
.
parse
(
idxBizPvWarningRecord
.
getRecDate
(),
DatePattern
.
NORM_DATETIME_PATTERN
),
1
))
.
le
(
"
ts"
,
DateUtil
.
offsetMinute
(
DateUtil
.
parse
(
idxBizPvWarningRecord
.
getRecDate
(),
DatePattern
.
NORM_DATETIME_PATTERN
),
-
479
))
.
orderByDesc
(
"
ANALYSIS_TIME
"
)
.
orderByDesc
(
"
ts
"
)
.
last
(
"limit 30"
));
.
last
(
"limit 30"
));
List
<
String
>
xDatas
=
new
ArrayList
<>();
List
<
String
>
xDatas
=
new
ArrayList
<>();
List
<
Double
>
yDatas
=
new
ArrayList
<>();
List
<
Double
>
yDatas
=
new
ArrayList
<>();
String
startTime
=
""
;
String
startTime
=
idxBizPvWarningRecord
.
getRecDate
()
;
String
endTime
=
""
;
String
endTime
=
idxBizPvWarningRecord
.
getRecDate
()
;
int
idxBizPvHealthIndexListSize
=
idxBizPvHealthIndexList
.
size
();
int
idxBizPvHealthIndexListSize
=
idxBizPvHealthIndexList
.
size
();
for
(
int
i
=
idxBizPvHealthIndexList
.
size
()
-
1
;
i
>=
0
;
i
--)
{
for
(
int
i
=
idxBizPvHealthIndexList
.
size
()
-
1
;
i
>=
0
;
i
--)
{
HashMap
<
String
,
String
>
alarmAbnormalityItem
=
new
HashMap
<>();
HashMap
<
String
,
String
>
alarmAbnormalityItem
=
new
HashMap
<>();
IdxBiz
PvHealthIndex
idxBizPvHealthIndex
=
idxBizPvHealthIndexList
.
get
(
i
);
PvHealthIndex
idxBizPvHealthIndex
=
idxBizPvHealthIndexList
.
get
(
i
);
xDatas
.
add
(
idxBizPvHealthIndex
.
getA
NALYSISTIME
());
xDatas
.
add
(
idxBizPvHealthIndex
.
getA
nalysisTime
());
yDatas
.
add
(
idxBizPvHealthIndex
.
getHealthIndex
());
yDatas
.
add
(
idxBizPvHealthIndex
.
getHealthIndex
());
alarmAbnormalityItem
.
put
(
"sort"
,
String
.
valueOf
(
i
));
alarmAbnormalityItem
.
put
(
"sort"
,
String
.
valueOf
(
i
));
alarmAbnormalityItem
.
put
(
"time"
,
idxBizPvHealthIndex
.
getA
NALYSISTIME
());
alarmAbnormalityItem
.
put
(
"time"
,
idxBizPvHealthIndex
.
getA
nalysisTime
());
alarmAbnormalityItem
.
put
(
"abnormal"
,
String
.
valueOf
(
idxBizPvHealthIndex
.
getA
NOMALY
()).
replace
(
"null"
,
"0.0"
));
alarmAbnormalityItem
.
put
(
"abnormal"
,
String
.
valueOf
(
idxBizPvHealthIndex
.
getA
nomaly
()).
replace
(
"null"
,
"0.0"
));
alarmAbnormalityItem
.
put
(
"healthValue"
,
String
.
valueOf
(
idxBizPvHealthIndex
.
getHealthIndex
()));
alarmAbnormalityItem
.
put
(
"healthValue"
,
String
.
valueOf
(
idxBizPvHealthIndex
.
getHealthIndex
()));
if
(
idxBizPvHealthIndexListSize
>=
3
)
{
if
(
idxBizPvHealthIndexListSize
>=
3
)
{
if
(
i
==
0
)
{
if
(
i
==
0
)
{
endTime
=
handlerDateStr
(
idxBizPvHealthIndex
.
getA
NALYSISTIME
(),
-
8
,
5
);
endTime
=
handlerDateStr
(
idxBizPvHealthIndex
.
getA
nalysisTime
(),
-
8
,
5
);
}
}
if
(
i
==
2
)
{
if
(
i
==
2
)
{
startTime
=
handlerDateStr
(
idxBizPvHealthIndex
.
getA
NALYSISTIME
(),
-
8
,
-
5
);
startTime
=
handlerDateStr
(
idxBizPvHealthIndex
.
getA
nalysisTime
(),
-
8
,
-
5
);
}
}
}
}
if
(
idxBizPvHealthIndexListSize
==
2
)
{
if
(
idxBizPvHealthIndexListSize
==
2
)
{
if
(
i
==
0
)
{
if
(
i
==
0
)
{
endTime
=
handlerDateStr
(
idxBizPvHealthIndex
.
getA
NALYSISTIME
(),
-
8
,
5
);
endTime
=
handlerDateStr
(
idxBizPvHealthIndex
.
getA
nalysisTime
(),
-
8
,
5
);
}
}
if
(
i
==
1
)
{
if
(
i
==
1
)
{
startTime
=
handlerDateStr
(
idxBizPvHealthIndex
.
getA
NALYSISTIME
(),
-
8
,
-
5
);
startTime
=
handlerDateStr
(
idxBizPvHealthIndex
.
getA
nalysisTime
(),
-
8
,
-
5
);
}
}
}
}
if
(
idxBizPvHealthIndexListSize
==
1
)
{
if
(
idxBizPvHealthIndexListSize
==
1
)
{
if
(
i
==
0
)
{
if
(
i
==
0
)
{
endTime
=
handlerDateStr
(
idxBizPvHealthIndex
.
getA
NALYSISTIME
(),
-
8
,
5
);
endTime
=
handlerDateStr
(
idxBizPvHealthIndex
.
getA
nalysisTime
(),
-
8
,
5
);
startTime
=
handlerDateStr
(
idxBizPvHealthIndex
.
getA
NALYSISTIME
(),
-
8
,
-
5
);
startTime
=
handlerDateStr
(
idxBizPvHealthIndex
.
getA
nalysisTime
(),
-
8
,
-
5
);
}
}
}
}
alarmAbnormalityList
.
add
(
alarmAbnormalityItem
);
alarmAbnormalityList
.
add
(
alarmAbnormalityItem
);
...
@@ -288,7 +300,7 @@ public class AlarmInfoDetailServiceImpl implements IAlarmInfoDetailService {
...
@@ -288,7 +300,7 @@ 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
alarmAbnormalityList
=
alarmAbnormalityList
.
subList
(
alarmAbnormalityList
.
size
()
-
warningCycle
,
alarmAbnormalityList
.
size
());
alarmAbnormalityList
=
alarmAbnormalityList
.
subList
(
alarmAbnormalityList
.
size
()
-
warningCycle
>=
0
?
alarmAbnormalityList
.
size
()
-
warningCycle
:
0
,
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
){
if
(
alarmAbnormalityList
.
size
()>
0
){
endTime
=
handlerDateStr
(
alarmAbnormalityList
.
get
(
0
).
get
(
"time"
),-
8
,
5
);
endTime
=
handlerDateStr
(
alarmAbnormalityList
.
get
(
0
).
get
(
"time"
),-
8
,
5
);
...
...
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