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
eb56d70c
Commit
eb56d70c
authored
Aug 02, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
离散率增加
parent
37255a65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+23
-9
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
eb56d70c
...
...
@@ -836,8 +836,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
for
(
IndicatorsDto
listDatum
:
listData
)
{
Map
<
String
,
Object
>
statusMap
=
new
HashMap
<>();
statusMap
.
put
(
"data"
,
StringUtils
.
isEmpty
(
listDatum
.
getDisplayName
())?
listDatum
.
getEquipmentIndexName
():
listDatum
.
getDisplayName
());
statusMap
.
put
(
"state"
,
listDatum
.
getState
().
equals
(
"true"
)?
1
:
0
);
statusMap
.
put
(
"status"
,
listDatum
.
getState
().
equals
(
"true"
)?
1
:
0
);
statusMap
.
put
(
"state"
,
listDatum
.
getState
().
equals
(
"true"
)?
0
:
1
);
statusMap
.
put
(
"status"
,
listDatum
.
getState
().
equals
(
"true"
)?
0
:
1
);
statusMap
.
put
(
"title"
,
listDatum
.
getState
().
equals
(
"true"
)?
"断"
:
"通"
);
statusMaps
.
add
(
statusMap
);
}
...
...
@@ -1398,7 +1398,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
if
(
listDatum
.
getValue
().
equals
(
"true"
)){
url
=
pictureUrl
+
listDatum
.
getPictureName
();
}
else
{
url
=
pictureUrl
+
listDatum
.
getPictureName
().
replace
(
"
red"
,
"green
"
);
url
=
pictureUrl
+
listDatum
.
getPictureName
().
replace
(
"
green"
,
"red
"
);
}
photoUrls
.
put
(
listDatum
.
getDisplayName
().
split
(
"_"
)[
0
]+
"url"
,
url
);
}
...
...
@@ -1441,7 +1441,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
resultMap
.
put
(
"equipmentSpecificName"
,
list
.
get
(
0
).
getEquipmentSpecificName
());
resultMap
.
put
(
"equipmentIndexName"
,
list
.
get
(
0
).
getEquipmentSpecificName
());
resultMap
.
put
(
"equipmentInfoName"
,
list
.
get
(
0
).
getEquipmentSpecificName
().
substring
(
5
).
replace
(
"/"
,
" "
));
resultMap
.
put
(
"status"
,
list
.
get
(
0
).
getValue
().
equals
(
"true"
)?
"
异常"
:
"正常运行
"
);
resultMap
.
put
(
"status"
,
list
.
get
(
0
).
getValue
().
equals
(
"true"
)?
"
正常运行"
:
"异常
"
);
}
return
resultMap
;
}
...
...
@@ -1506,9 +1506,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
collect
.
get
(
s
).
stream
().
forEach
(
e
->{
String
picturl
=
""
;
if
(
e
.
getValue
().
equals
(
"true"
)){
picturl
=
pictureUrl
+
"dlg-h-red.png"
;
}
else
{
picturl
=
pictureUrl
+
"dlg-h-green.png"
;
}
else
{
picturl
=
pictureUrl
+
"dlg-h-red.png"
;
}
if
(
e
.
getEquipmentIndexName
().
endsWith
(
"断路器合闸"
)){
resultMap
.
put
(
e
.
getEquipmentIndexName
().
substring
(
0
,
3
),
picturl
);
...
...
@@ -1536,15 +1536,17 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public
ResultsData
collectingBox
(
String
gatewayId
,
int
current
,
int
size
){
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
ArrayList
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
String
sql
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentIndexName =~/路电流/ "
;
String
sql1
=
"SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentIndexName =~/平均电流/ "
;
List
<
IndicatorsDto
>
list
=
influxDButils
.
getListData
(
sql
,
IndicatorsDto
.
class
);
List
<
IndicatorsDto
>
list1
=
influxDButils
.
getListData
(
sql1
,
IndicatorsDto
.
class
);
if
(!
ValidationUtil
.
isEmpty
(
list
)){
Map
<
String
,
List
<
IndicatorsDto
>>
collect
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
IndicatorsDto:
:
getEquipmentNumber
));
for
(
String
s
:
collect
.
keySet
())
{
List
<
IndicatorsDto
>
indicatorsDtos
=
collect
.
get
(
s
);
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Double
avageValue
=
0.0
;
avageValue
=
indicatorsDtos
.
stream
().
filter
(
e
->
!
ObjectUtils
.
isEmpty
(
e
.
getValue
())).
mapToDouble
(
l
->
Double
.
parseDouble
((
String
)
l
.
getValue
())).
average
().
getAsDouble
();
avageValue
=
Double
.
valueOf
(
String
.
format
(
"%.2f"
,
avageValue
));
...
...
@@ -1553,7 +1555,19 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
resultMap
.
put
(
"zz"
,
"#"
+
name
[
0
]+
"子阵"
);
resultMap
.
put
(
"nbq"
,
"逆变器"
+
name
[
1
]);
resultMap
.
put
(
"hlx"
,
"#"
+
name
[
2
]+
"汇流箱"
);
resultMap
.
put
(
"lsv"
,
"1.7840"
);
double
lsv
=
0.00
;
if
(!
ValidationUtil
.
isEmpty
(
list1
)){
List
<
IndicatorsDto
>
dtos
=
list1
.
stream
().
filter
(
e
->
e
.
getEquipmentNumber
().
equals
(
s
)).
collect
(
Collectors
.
toList
());
if
(!
ValidationUtil
.
isEmpty
(
dtos
)){
for
(
IndicatorsDto
indicatorsDto
:
indicatorsDtos
)
{
lsv
=
lsv
+
Math
.
pow
(
Double
.
parseDouble
(
indicatorsDto
.
getValue
())
-
Double
.
parseDouble
(
dtos
.
get
(
0
).
getValue
()),
2
);
}
}
lsv
=
Math
.
sqrt
(
lsv
)/
Double
.
parseDouble
(
dtos
.
get
(
0
).
getValue
());
}
resultMap
.
put
(
"lsv"
,
String
.
format
(
"%.2f"
,
lsv
));
resultList
.
add
(
resultMap
);
}
}
...
...
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