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
a86055cb
Commit
a86055cb
authored
Oct 12, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改电量表计问题
parent
0f22031c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
136 additions
and
97 deletions
+136
-97
CommonConstans.java
.../amos/boot/module/jxiop/biz/constants/CommonConstans.java
+33
-4
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+2
-2
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+101
-91
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/constants/CommonConstans.java
View file @
a86055cb
...
...
@@ -3,10 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.constants;
import
com.sun.javafx.logging.PulseLogger
;
import
org.checkerframework.checker.units.qual.C
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.*
;
public
class
CommonConstans
{
//光伏发电量系数
...
...
@@ -115,6 +112,7 @@ public class CommonConstans {
public
static
final
String
QueryStringIsAlarm
=
"isAlarm"
;
public
static
final
String
QueryStringIsAlarmKeyword
=
"isAlarm.keyword"
;
public
static
final
String
Twodecimalplaces
=
"%.2f"
;
public
static
final
String
Threedecimalplaces
=
"%.3f"
;
public
static
final
String
Fourdecimalplaces
=
"%.4f"
;
public
static
final
String
QueryStringFrontMoudleNotKeyWord
=
"frontModule"
;
//泰和的发电量数据
...
...
@@ -127,4 +125,35 @@ public class CommonConstans {
public
static
final
String
taiheIrradiationPonit
=
"WTX-801_25_WTX-801_总辐射"
;
public
static
final
String
xiazaoActivePowerPoint
=
"220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"
;
public
static
final
String
xiazaoWindSpeedrPoint
=
"瞬时风速"
;
public
static
final
List
<
String
>
xiazaoElectricityMeter
=
new
ArrayList
<>(
Arrays
.
asList
(
"夏雩线212主表"
,
"夏雩线212副表"
,
"1号主变高压侧201"
,
"1号主变低压侧301"
,
"35kV集电Ⅰ线311"
,
"35kV集电Ⅱ线312"
,
"35kV集电Ⅲ线313"
,
"35kV集电Ⅳ线314"
,
"35kV集电V线315"
,
"35kV#1SVG316"
,
"35kV#1SVG317"
,
"35kV#1接地变307"
));
public
static
final
List
<
String
>
taiheElectricityMeter
=
new
ArrayList
<>(
Arrays
.
asList
(
"前光Ⅰ线"
,
"前光Ⅱ线"
,
"消弧线圈兼接地变"
,
"#1SVG"
,
"前万线"
));
public
static
final
HashMap
<
String
,
List
<
String
>>
xiazaoElectricityMeterPointSort
=
new
HashMap
<
String
,
List
<
String
>>()
{
{
put
(
"夏雩线212主表"
,
Arrays
.
asList
(
"威胜电量采集WFET2000S_v3.002夏雩线主表正向总有功P+"
,
"威胜电量采集WFET2000S_v3.002夏雩线主表反向总有功P-"
,
"威胜电量采集WFET2000S_v3.002夏雩线主表正向总无功Q+"
,
"威胜电量采集WFET2000S_v3.002夏雩线主表反向总无功Q-"
));
put
(
"夏雩线212副表"
,
Arrays
.
asList
(
"威胜电量采集WFET2000S_v3.002夏雩线副表正向总有功P+"
,
"威胜电量采集WFET2000S_v3.002夏雩线副表反向总有功P-"
,
"威胜电量采集WFET2000S_v3.002夏雩线副表正向总无功Q+"
,
"威胜电量采集WFET2000S_v3.002夏雩线副表反向总无功Q-"
));
put
(
"1号主变高压侧201"
,
Arrays
.
asList
(
"威胜电量采集WFET2000S_v3.002#1主变高压侧正向总有功P+"
,
"威胜电量采集WFET2000S_v3.002#1主变高压侧反向总有功P-"
,
"威胜电量采集WFET2000S_v3.002#1主变高压侧正向总无功Q+"
,
"威胜电量采集WFET2000S_v3.002#1主变高压侧反向总无功Q-"
));
put
(
"1号主变低压侧301"
,
Arrays
.
asList
(
"威胜电量采集WFET2000S_v3.002#1主变低压侧正向总有功P+"
,
"威胜电量采集WFET2000S_v3.002#1主变低压侧反向总有功P-"
,
"威胜电量采集WFET2000S_v3.002#1主变低压侧正向总无功Q+"
,
"威胜电量采集WFET2000S_v3.002#1主变低压侧反向总无功Q-"
));
put
(
"35kV集电Ⅰ线311"
,
Arrays
.
asList
(
"威胜电量采集WFET2000S_v3.002集电I线正向总有功P+"
,
"威胜电量采集WFET2000S_v3.002集电I线反向总有功P-"
,
"威胜电量采集WFET2000S_v3.002集电I线正向总无功Q+"
,
"威胜电量采集WFET2000S_v3.002集电I线反向总无功Q-"
));
put
(
"35kV集电Ⅱ线312"
,
Arrays
.
asList
(
"威胜电量采集WFET2000S_v3.002集电II线正向总有功P+"
,
"威胜电量采集WFET2000S_v3.002集电II线反向总有功P-"
,
"威胜电量采集WFET2000S_v3.002集电II线正向总无功Q+"
,
"威胜电量采集WFET2000S_v3.002集电II线反向总无功Q-"
));
put
(
"35kV集电Ⅲ线313"
,
Arrays
.
asList
(
"威胜电量采集WFET2000S_v3.002集电III线正向总有功P+"
,
"威胜电量采集WFET2000S_v3.002集电III线反向总有功P-"
,
"威胜电量采集WFET2000S_v3.002集电III线正向总无功Q+"
,
"威胜电量采集WFET2000S_v3.002集电III线反向总无功Q-"
));
put
(
"35kV集电Ⅳ线314"
,
Arrays
.
asList
(
"威胜电量采集WFET2000S_v3.002集电IV线正向总有功P+"
,
"威胜电量采集WFET2000S_v3.002集电IV线反向总有功P-"
,
"威胜电量采集WFET2000S_v3.002集电IV线正向总无功Q+"
,
"威胜电量采集WFET2000S_v3.002集电IV线反向总无功Q-"
));
put
(
"35kV集电V线315"
,
Arrays
.
asList
(
"威胜电量采集WFET2000S_v3.002集电V线正向总有功P+"
,
"威胜电量采集WFET2000S_v3.002集电V线反向总有功P-"
,
"威胜电量采集WFET2000S_v3.002集电V线正向总无功Q+"
,
"威胜电量采集WFET2000S_v3.002集电V线反向总无功Q-"
));
put
(
"35kV#1SVG316"
,
Arrays
.
asList
(
"威胜电量采集WFET2000S_v3.002#1SVG正向总有功P+"
,
"威胜电量采集WFET2000S_v3.002#1SVG反向总有功P-"
,
"威胜电量采集WFET2000S_v3.002#1SVG正向总无功Q+"
,
"威胜电量采集WFET2000S_v3.002#1SVG反向总无功Q-"
));
put
(
"35kV#1SVG317"
,
Arrays
.
asList
(
"威胜电量采集WFET2000S_v3.002#2SVG正向总有功P+"
,
"威胜电量采集WFET2000S_v3.002#2SVG反向总有功P-"
,
"威胜电量采集WFET2000S_v3.002#2SVG正向总无功Q+"
,
"威胜电量采集WFET2000S_v3.002#2SVG反向总无功Q-"
));
put
(
"35kV#1接地变307"
,
Arrays
.
asList
(
"威胜电量采集WFET2000S_v3.002站用接地变正向总有功P+"
,
"威胜电量采集WFET2000S_v3.002站用接地变反向总有功P-"
,
"威胜电量采集WFET2000S_v3.002站用接地变正向总无功Q+"
,
"威胜电量采集WFET2000S_v3.002站用接地变反向总无功Q-"
));
}
};
public
static
final
HashMap
<
String
,
List
<
String
>>
taiheElectricityMeterPointSort
=
new
HashMap
<
String
,
List
<
String
>>()
{
{
put
(
"前光Ⅰ线"
,
Arrays
.
asList
(
"314前光Ⅰ线保测_总正向有功电度"
,
"314前光Ⅰ线保测_总反向有功电度"
,
"314前光Ⅰ线保测_总感性无功电度"
,
"314前光Ⅰ线保测_总容性无功电度"
));
put
(
"前光Ⅱ线"
,
Arrays
.
asList
(
"315前光Ⅱ线保测_总正向有功电度"
,
"315前光Ⅱ线保测_总反向有功电度"
,
"315前光Ⅱ线保测_总感性无功电度"
,
"315前光Ⅱ线保测_总容性无功电度"
));
put
(
"消弧线圈兼接地变"
,
Arrays
.
asList
(
"311#1消弧线圈_总正向有功电度"
,
"311#1消弧线圈_总反向有功电度"
,
"311#1消弧线圈_总感性无功电度"
,
"311#1消弧线圈_总容性无功电度"
));
put
(
"#1SVG"
,
Arrays
.
asList
(
"312#1SVG_总正向有功电度"
,
"312#1SVG_总反向有功电度"
,
"312#1SVG_总感性无功电度"
,
"312#1SVG_总容性无功电度"
));
put
(
"前万线"
,
Arrays
.
asList
(
"313光差保护_总正向有功电度"
,
"313光差保护_总反向有功电度"
,
"313光差保护_总感性无功电度"
,
"313光差保护_总容性无功电度"
));
}
};
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
a86055cb
...
...
@@ -532,8 +532,8 @@ public class MonitorFanIdxController extends BaseController {
@RequestParam
(
value
=
"stationId"
)
String
stationId
,
@RequestParam
(
value
=
"stationType"
,
required
=
false
)
String
stationType
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
gatewayId
=
stationBasic
.
getBoosterGatewayId
();
ResultsData
resultsData
=
monitorFanIndicatorImpl
.
getElectricQuantityList
(
current
,
size
,
gatewayId
,
stationType
);
//
String gatewayId = stationBasic.getBoosterGatewayId();
ResultsData
resultsData
=
monitorFanIndicatorImpl
.
getElectricQuantityList
(
current
,
size
,
stationBasic
);
return
ResponseHelper
.
buildResponse
(
resultsData
);
}
...
...
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 @
a86055cb
...
...
@@ -120,55 +120,54 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public
void
UpdateMonitorFanIndicator
(
List
<
IndexDto
>
list
)
{
monitorFanIndicatorregionMapper
.
UpdateMonitorFanIndicator
(
list
);
}
@Override
public
ResultsData
getNationWideInfo
(
int
current
,
int
size
,
String
gateway
,
String
equipmentNumber
)
{
String
table
=
gateway
;
Map
<
String
,
List
<
String
>>
queryCodntion
=
new
HashMap
<>();
queryCodntion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
gateway
));
queryCodntion
.
put
(
CommonConstans
.
QueryStringIsAlarmKeyword
,
Arrays
.
asList
(
"1"
));
List
<
ESEquipments
>
alldata
=
commonServiceImpl
.
getListDataByCondtionsAndLike
(
queryCodntion
,
null
,
ESEquipments
.
class
,
null
);
List
<
ESEquipments
>
waringData
=
alldata
.
stream
()
.
filter
(
esEquipments
->
(!
esEquipments
.
getValue
().
equals
(
"0.0"
)
&&
!
esEquipments
.
getValue
().
equals
(
esEquipments
.
getValueLabel
())
||
(
esEquipments
.
getValue
().
equals
(
"true"
))))
.
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isNotEmpty
(
equipmentNumber
))
{
waringData
=
waringData
.
stream
()
.
filter
(
esEquipments
->
esEquipments
.
getEquipmentNumber
().
equals
(
equipmentNumber
))
.
collect
(
Collectors
.
toList
());
}
if
(
CollectionUtils
.
isNotEmpty
(
waringData
))
{
Integer
newSize
=
waringData
.
size
()
>=
size
?
size
:
waringData
.
size
();
waringData
=
waringData
.
stream
().
sorted
(
Comparator
.
comparing
(
ESEquipments:
:
getCreatedTime
).
reversed
())
.
collect
(
Collectors
.
toList
()).
subList
(((
current
-
1
)
*
newSize
),
(
current
*
newSize
));
waringData
.
forEach
(
i
->{
if
(
"true"
.
equals
(
i
.
getValue
()))
{
i
.
setValue
(
"合"
);
i
.
setValueLabel
(
i
.
getEquipmentIndexName
());
}
});
}
// 对于查询到的告警信息进行按照时间顺序进行排序
DataGridMock
DataGridMock
=
new
DataGridMock
(
current
,
!
waringData
.
isEmpty
()
?
waringData
.
size
()
:
0
,
false
,
current
,
waringData
);
ColModel
colModelequipmentNumber
=
new
ColModel
(
"equipmentNumber"
,
"equipmentNumber"
,
"设备"
,
"设备"
,
"dataGrid"
,
"equipmentNumber"
);
ColModel
colModelvalueLabel
=
new
ColModel
(
"valueLabel"
,
"valueLabel"
,
"事件描述"
,
"事件描述"
,
"dataGrid"
,
"valueLabel"
);
ColModel
colModelcreatedTime
=
new
ColModel
(
"createdTime"
,
"createdTime"
,
"发生时间"
,
"发生时间"
,
"dataGrid"
,
"createdTime"
);
ColModel
colModelvalue
=
new
ColModel
(
"value"
,
"value"
,
"告警值"
,
"告警值"
,
"dataGrid"
,
"value"
);
List
<
ColModel
>
listColModel
=
new
ArrayList
<>();
listColModel
.
add
(
colModelequipmentNumber
);
listColModel
.
add
(
colModelvalueLabel
);
listColModel
.
add
(
colModelcreatedTime
);
listColModel
.
add
(
colModelvalue
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
return
resultsData
;
}
@Override
public
ResultsData
getNationWideInfo
(
int
current
,
int
size
,
String
gateway
,
String
equipmentNumber
)
{
String
table
=
gateway
;
Map
<
String
,
List
<
String
>>
queryCodntion
=
new
HashMap
<>();
queryCodntion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
gateway
));
queryCodntion
.
put
(
CommonConstans
.
QueryStringIsAlarmKeyword
,
Arrays
.
asList
(
"1"
));
List
<
ESEquipments
>
alldata
=
commonServiceImpl
.
getListDataByCondtionsAndLike
(
queryCodntion
,
null
,
ESEquipments
.
class
,
null
);
List
<
ESEquipments
>
waringData
=
alldata
.
stream
()
.
filter
(
esEquipments
->
(!
esEquipments
.
getValue
().
equals
(
"0.0"
)
&&
!
esEquipments
.
getValue
().
equals
(
esEquipments
.
getValueLabel
())
||
(
esEquipments
.
getValue
().
equals
(
"true"
))))
.
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isNotEmpty
(
equipmentNumber
))
{
waringData
=
waringData
.
stream
()
.
filter
(
esEquipments
->
esEquipments
.
getEquipmentNumber
().
equals
(
equipmentNumber
))
.
collect
(
Collectors
.
toList
());
}
if
(
CollectionUtils
.
isNotEmpty
(
waringData
))
{
Integer
newSize
=
waringData
.
size
()
>=
size
?
size
:
waringData
.
size
();
waringData
=
waringData
.
stream
().
sorted
(
Comparator
.
comparing
(
ESEquipments:
:
getCreatedTime
).
reversed
())
.
collect
(
Collectors
.
toList
()).
subList
(((
current
-
1
)
*
newSize
),
(
current
*
newSize
));
waringData
.
forEach
(
i
->
{
if
(
"true"
.
equals
(
i
.
getValue
()))
{
i
.
setValue
(
"合"
);
i
.
setValueLabel
(
i
.
getEquipmentIndexName
());
}
});
}
// 对于查询到的告警信息进行按照时间顺序进行排序
DataGridMock
DataGridMock
=
new
DataGridMock
(
current
,
!
waringData
.
isEmpty
()
?
waringData
.
size
()
:
0
,
false
,
current
,
waringData
);
ColModel
colModelequipmentNumber
=
new
ColModel
(
"equipmentNumber"
,
"equipmentNumber"
,
"设备"
,
"设备"
,
"dataGrid"
,
"equipmentNumber"
);
ColModel
colModelvalueLabel
=
new
ColModel
(
"valueLabel"
,
"valueLabel"
,
"事件描述"
,
"事件描述"
,
"dataGrid"
,
"valueLabel"
);
ColModel
colModelcreatedTime
=
new
ColModel
(
"createdTime"
,
"createdTime"
,
"发生时间"
,
"发生时间"
,
"dataGrid"
,
"createdTime"
);
ColModel
colModelvalue
=
new
ColModel
(
"value"
,
"value"
,
"告警值"
,
"告警值"
,
"dataGrid"
,
"value"
);
List
<
ColModel
>
listColModel
=
new
ArrayList
<>();
listColModel
.
add
(
colModelequipmentNumber
);
listColModel
.
add
(
colModelvalueLabel
);
listColModel
.
add
(
colModelcreatedTime
);
listColModel
.
add
(
colModelvalue
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
return
resultsData
;
}
@Override
public
ResultsData
getLsNationWideInfo
(
int
current
,
int
size
,
String
stationBasicId
,
String
equipmentNumber
)
{
...
...
@@ -521,9 +520,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
activePowerInfo
.
put
(
"minTime"
,
time
.
get
(
values
.
lastIndexOf
(
min
)));
activePowerInfo
.
put
(
"load"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
Double
.
valueOf
(
values
.
get
(
values
.
size
()
-
1
))
/
installedCapacity
));
max
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
valueList
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
min
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
valueList
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
mean
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
valueList
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
average
().
getAsDouble
());
max
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
valueList
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
min
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
valueList
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
mean
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
valueList
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
average
().
getAsDouble
());
otherInfo
.
put
(
"mean"
,
mean
);
otherInfo
.
put
(
"max"
,
max
);
...
...
@@ -544,11 +543,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
map
.
put
(
"axisData"
,
time
);
try
{
log
.
info
(
"---------------------推送全站图表信息开始------------------------------"
);
emqKeeper
.
getMqttClient
().
publish
(
stationBasic
.
getSequenceNbr
()
+
"_activePower_table"
,
JSON
.
toJSON
(
map
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
stationBasic
.
getSequenceNbr
()
+
"_activePower_info"
,
JSON
.
toJSON
(
activePowerInfo
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
stationBasic
.
getSequenceNbr
()
+
"_other_info"
,
JSON
.
toJSON
(
otherInfo
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
stationBasic
.
getSequenceNbr
()
+
"_activePower_table"
,
JSON
.
toJSON
(
map
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
stationBasic
.
getSequenceNbr
()
+
"_activePower_info"
,
JSON
.
toJSON
(
activePowerInfo
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
stationBasic
.
getSequenceNbr
()
+
"_other_info"
,
JSON
.
toJSON
(
otherInfo
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
log
.
info
(
"---------------------推送全站图表信息结束------------------------------"
);
}
catch
(
Exception
exception
)
{
}
catch
(
Exception
exception
)
{
log
.
info
(
"---------------------推送全站图表信息失败------------------------------"
);
}
...
...
@@ -1061,7 +1060,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
});
Map
<
String
,
String
>
powerSqlMap
=
powerSqlList
.
stream
().
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentNumber
,
ESEquipments:
:
getValue
));
Map
<
String
,
String
>
windSpeedSqlMap
=
windSpeedSqlList
.
stream
().
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentNumber
,
ESEquipments:
:
getValue
));
windSqlSortList
=
windSqlList
.
stream
().
sorted
(
Comparator
.
comparing
(
ESEquipments:
:
getEquipmentNumber
,
Comparator
.
comparing
(
Integer:
:
parseInt
))).
collect
(
Collectors
.
toList
());
windSqlSortList
=
windSqlList
.
stream
().
sorted
(
Comparator
.
comparing
(
ESEquipments:
:
getEquipmentNumber
,
Comparator
.
comparing
(
Integer:
:
parseInt
))).
collect
(
Collectors
.
toList
());
Map
<
String
,
String
>
electricitySqlMap
=
electricitySqlList
.
stream
().
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentNumber
,
ESEquipments:
:
getValue
));
ArrayList
<
Map
<
String
,
String
>>
resultList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
windSqlSortList
.
size
();
i
++)
{
...
...
@@ -1087,19 +1086,18 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
public
ResultsData
getAlarmEventList
(
int
current
,
int
size
,
String
stationId
)
{
public
ResultsData
getAlarmEventList
(
int
current
,
int
size
,
String
stationId
)
{
LambdaQueryWrapper
<
AlarmEvent
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
if
(
stationId
!=
null
)
{
if
(
stationId
!=
null
)
{
queryWrapper
.
eq
(
AlarmEvent:
:
getStationId
,
stationId
);
}
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
7
);
queryWrapper
.
gt
(
AlarmEvent:
:
getCreatedTime
,
calendar
.
getTime
());
int
count
=
alarmEventMapper
.
selectCount
(
queryWrapper
);
List
<
AlarmEventDto
>
alarmEventList
=
alarmEventMapper
.
getAlarmEventList
(
null
,
stationId
,
(
current
-
1
)*
size
,
size
,
calendar
.
getTime
());
List
<
AlarmEventDto
>
alarmEventList
=
alarmEventMapper
.
getAlarmEventList
(
null
,
stationId
,
(
current
-
1
)
*
size
,
size
,
calendar
.
getTime
());
// List<AlarmEventDto> sorrtedAlarmEventList = alarmEventList.stream().sorted(Comparator.comparing(AlarmEventDto::getCreatedTime).reversed()).collect(Collectors.toList());
// ArrayList<Map<String, String>> resultList = new ArrayList<>();
...
...
@@ -1125,34 +1123,52 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
public
ResultsData
getElectricQuantityList
(
int
current
,
int
size
,
St
ring
gatewayId
,
String
stationType
)
{
public
ResultsData
getElectricQuantityList
(
int
current
,
int
size
,
St
ationBasic
stationBasic
)
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
gatewayId
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()
));
// queryCondtion.put(CommonConstans.QueryStringFrontMoudle, Arrays.asList("电量表计"));
Map
<
String
,
String
>
likeMap
=
new
HashMap
<>();
likeMap
.
put
(
CommonConstans
.
QueryStringFrontMoudleNotKeyWord
,
"电量表计"
);
List
<
ESEquipments
>
esEquipmentsList
=
commonServiceImpl
.
getListDataByCondtionsAndLike
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeMap
);
List
<
ESEquipments
>
windSqlList
=
esEquipmentsList
.
stream
().
filter
(
esEquipments
->
!
esEquipments
.
getDisplayName
().
equals
(
""
)
&&
!
esEquipments
.
getDisplayName
().
equals
(
"检修状态"
)).
collect
(
Collectors
.
toList
());
Map
<
String
,
List
<
ESEquipments
>>
maps
=
windSqlList
.
stream
().
collect
(
Collectors
.
groupingBy
(
ESEquipments:
:
getSystemType
));
ArrayList
<
Map
<
String
,
String
>>
resultList
=
new
ArrayList
<>();
ArrayList
<
Map
<
String
,
String
>>
resultList1
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
List
<
ESEquipments
>>
stringListEntry
:
maps
.
entrySet
())
{
List
<
String
>
nameList
=
new
ArrayList
<>();
Map
<
String
,
String
>
handleData
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
originalData
=
new
HashMap
<>();
if
(
"FDZ"
.
equals
(
stationBasic
.
getStationType
()))
{
handleData
=
windSqlList
.
stream
().
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentIndexName
,
esEquipments
->
String
.
format
(
CommonConstans
.
Threedecimalplaces
,
esEquipments
.
getValueF
())));
nameList
=
CommonConstans
.
xiazaoElectricityMeter
;
originalData
=
CommonConstans
.
xiazaoElectricityMeterPointSort
;
}
else
{
handleData
=
windSqlList
.
stream
().
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentIndexName
,
esEquipments
->
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
esEquipments
.
getValueF
()*
0.01
)));
nameList
=
CommonConstans
.
taiheElectricityMeter
;
originalData
=
CommonConstans
.
taiheElectricityMeterPointSort
;
}
for
(
int
i
=
0
;
i
<
nameList
.
size
();
i
++)
{
HashMap
<
String
,
String
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"name"
,
stringListEntry
.
getKey
());
for
(
ESEquipments
indicatorsDto
:
stringListEntry
.
getValue
())
{
stringStringHashMap
.
put
(
ElectricQuantity
.
getCode
(
indicatorsDto
.
getDisplayName
()),
String
.
format
(
"%.3f"
,
ObjectUtils
.
isEmpty
(
indicatorsDto
.
getValueF
())
?
0.0
:
indicatorsDto
.
getValueF
()));
String
name
=
nameList
.
get
(
i
);
stringStringHashMap
.
put
(
"name"
,
name
);
Double
electricityIndicator
=
1.0
;
List
<
String
>
dataList
=
originalData
.
get
(
name
);
stringStringHashMap
.
put
(
"zxzyg"
,
handleData
.
get
(
dataList
.
get
(
0
)));
stringStringHashMap
.
put
(
"fxzyg"
,
handleData
.
get
(
dataList
.
get
(
1
)));
stringStringHashMap
.
put
(
"zxzwg"
,
handleData
.
get
(
dataList
.
get
(
2
)));
stringStringHashMap
.
put
(
"fxzwg"
,
handleData
.
get
(
dataList
.
get
(
3
)));
if
(
name
.
equals
(
"夏雩线212主表"
)){
stringStringHashMap
.
put
(
"zxzyg"
,
String
.
format
(
CommonConstans
.
Threedecimalplaces
,
Double
.
valueOf
(
handleData
.
get
(
dataList
.
get
(
0
)))*
0.001
));
stringStringHashMap
.
put
(
"fxzyg"
,
String
.
format
(
CommonConstans
.
Threedecimalplaces
,
Double
.
valueOf
(
handleData
.
get
(
dataList
.
get
(
1
)))*
0.001
));
stringStringHashMap
.
put
(
"zxzwg"
,
String
.
format
(
CommonConstans
.
Threedecimalplaces
,
Double
.
valueOf
(
handleData
.
get
(
dataList
.
get
(
2
)))*
0.001
));
stringStringHashMap
.
put
(
"fxzwg"
,
String
.
format
(
CommonConstans
.
Threedecimalplaces
,
Double
.
valueOf
(
handleData
.
get
(
dataList
.
get
(
3
)))*
0.001
));
}
if
(
stringListEntry
.
getKey
().
contains
(
"SVG"
))
{
resultList1
.
add
(
stringStringHashMap
);
}
else
{
resultList
.
add
(
stringStringHashMap
);
if
(
name
.
equals
(
"夏雩线212副表"
)){
stringStringHashMap
.
put
(
"zxzyg"
,
String
.
format
(
CommonConstans
.
Threedecimalplaces
,
Double
.
valueOf
(
handleData
.
get
(
dataList
.
get
(
0
)))*
0.01
));
stringStringHashMap
.
put
(
"fxzyg"
,
String
.
format
(
CommonConstans
.
Threedecimalplaces
,
Double
.
valueOf
(
handleData
.
get
(
dataList
.
get
(
1
)))*
0.01
));
stringStringHashMap
.
put
(
"zxzwg"
,
String
.
format
(
CommonConstans
.
Threedecimalplaces
,
Double
.
valueOf
(
handleData
.
get
(
dataList
.
get
(
2
)))*
0.01
));
stringStringHashMap
.
put
(
"fxzwg"
,
String
.
format
(
CommonConstans
.
Threedecimalplaces
,
Double
.
valueOf
(
handleData
.
get
(
dataList
.
get
(
3
)))*
0.01
));
}
resultList
.
add
(
stringStringHashMap
);
}
Collator
instance
=
Collator
.
getInstance
(
Locale
.
CHINA
);
Collections
.
sort
(
resultList
,
(
e1
,
e2
)
->
{
return
instance
.
compare
(
e1
.
get
(
"name"
),
e2
.
get
(
"name"
));
});
resultList
.
addAll
(
resultList1
);
//构建平台数据
DataGridMock
DataGridMock
=
new
DataGridMock
(
current
,
resultList
.
size
(),
false
,
current
,
resultList
);
...
...
@@ -1161,13 +1177,6 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
ColModel
colModelEventDesc
=
new
ColModel
(
"fxzyg"
,
"fxzyg"
,
"反向总有功"
,
"反向总有功"
,
"dataGrid"
,
"fxzyg"
);
ColModel
colModelAlarmGroupName
=
new
ColModel
(
"zxzwg"
,
"zxzwg"
,
"正向总无功"
,
"正向总无功"
,
"dataGrid"
,
"zxzwg"
);
ColModel
colModelEventTime
=
new
ColModel
(
"fxzwg"
,
"fxzwg"
,
"反向总无功"
,
"反向总无功"
,
"dataGrid"
,
"fxzwg"
);
if
(
null
!=
stationType
)
{
colModelEventMovement
=
new
ColModel
(
"name"
,
"name"
,
"测量点"
,
"测量点"
,
"dataGrid"
,
"name"
);
colModelStationName
=
new
ColModel
(
"zgxwg"
,
"zgxwg"
,
"正向无功总"
,
"正向无功总"
,
"dataGrid"
,
"zgxwg"
);
colModelEventDesc
=
new
ColModel
(
"zzxwg"
,
"zzxwg"
,
"正向有功总"
,
"正向有功总"
,
"dataGrid"
,
"zzxwg"
);
colModelAlarmGroupName
=
new
ColModel
(
"zrxwg"
,
"zrxwg"
,
"反向无功总"
,
"反向无功总"
,
"dataGrid"
,
"zrxwg"
);
colModelEventTime
=
new
ColModel
(
"zfxyg"
,
"zfxyg"
,
"反向有功总"
,
"反向有功总"
,
"dataGrid"
,
"zfxyg"
);
}
List
<
ColModel
>
listColModel
=
Arrays
.
asList
(
colModelEventMovement
,
colModelStationName
,
colModelEventDesc
,
colModelAlarmGroupName
,
colModelEventTime
);
ResultsData
resultsData
=
new
ResultsData
(
DataGridMock
,
listColModel
);
return
resultsData
;
...
...
@@ -1676,6 +1685,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
return
s
;
}
public
String
keepFourDecimalPlaces
(
String
value
)
{
String
s
=
"0.0000"
;
if
(!
ObjectUtils
.
isEmpty
(
value
))
{
...
...
@@ -1687,6 +1697,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
return
s
;
}
public
HashMap
<
String
,
Object
>
SpeedIndicator
(
String
gatewayId
,
String
equipmentNumber
,
String
equipmentIndexName
)
{
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
...
...
@@ -1813,10 +1824,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List
<
ESEquipments
>
indicatorsDtos
=
collects
.
get
(
s
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
s
);
if
(
s
.
split
(
"-"
)[
1
].
equals
(
"A"
))
{
map
.
put
(
"sort"
,
s
.
split
(
"-"
)[
0
]
+
"1"
);
}
else
{
map
.
put
(
"sort"
,
s
.
split
(
"-"
)[
0
]
+
"2"
);
if
(
s
.
split
(
"-"
)[
1
].
equals
(
"A"
))
{
map
.
put
(
"sort"
,
s
.
split
(
"-"
)[
0
]
+
"1"
);
}
else
{
map
.
put
(
"sort"
,
s
.
split
(
"-"
)[
0
]
+
"2"
);
}
map
.
put
(
"type"
,
"兆能"
);
//此处暂时未提供数据 待定 暂写死值
map
.
put
(
"status"
,
"1"
);
//此处暂时未提供数据 待定 暂写死值
...
...
@@ -1927,7 +1938,6 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
}
List
<
String
>
list
=
Arrays
.
asList
(
equipNum
.
split
(
","
));
list
.
forEach
(
e
->
{
if
(
Integer
.
parseInt
(
e
)
==
intNum
)
{
statusMaps
.
add
(
map
);
...
...
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