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
f8c02037
Commit
f8c02037
authored
Feb 04, 2024
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复监盘报错
parent
128fd2bc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
932 additions
and
787 deletions
+932
-787
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+13
-10
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+889
-762
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+4
-1
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+18
-13
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+8
-1
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
f8c02037
...
@@ -1936,17 +1936,20 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -1936,17 +1936,20 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
Double
powerOfDay
=
0.0000
;
Double
powerOfDay
=
0.0000
;
Double
powerOfMonth
=
0.0000
;
Double
powerOfMonth
=
0.0000
;
Double
powerOfAnnual
=
0.0000
;
Double
powerOfAnnual
=
0.0000
;
if
(
ObjectUtils
.
isEmpty
(
query
)){
if
(
result
!=
null
)
powerOfDay
=
powerOfDay
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
));
{
powerOfMonth
=
powerOfMonth
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
));
if
(
ObjectUtils
.
isEmpty
(
query
)){
powerOfAnnual
=
powerOfAnnual
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
));
powerOfDay
=
powerOfDay
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
));
}
else
{
powerOfMonth
=
powerOfMonth
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
));
powerOfDay
=
powerOfDay
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorDay
));
powerOfAnnual
=
powerOfAnnual
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
));
powerOfMonth
=
powerOfMonth
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
));
}
else
{
powerOfAnnual
=
powerOfAnnual
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorYear
));
powerOfDay
=
powerOfDay
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorDay
));
}
powerOfMonth
=
powerOfMonth
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
));
powerOfAnnual
=
powerOfAnnual
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorYear
));
}
}
Map
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
hashMap
.
put
(
"日发电量"
,
powerOfDay
);
hashMap
.
put
(
"日发电量"
,
powerOfDay
);
hashMap
.
put
(
"月发电量"
,
powerOfMonth
);
hashMap
.
put
(
"月发电量"
,
powerOfMonth
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceImpl.java
View file @
f8c02037
...
@@ -30,114 +30,112 @@ import java.util.*;
...
@@ -30,114 +30,112 @@ import java.util.*;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
public
class
MonitoringServiceImpl
{
public
class
MonitoringServiceImpl
{
Logger
logger
=
LoggerFactory
.
getLogger
(
MonitoringServiceImpl
.
class
);
Logger
logger
=
LoggerFactory
.
getLogger
(
MonitoringServiceImpl
.
class
);
@Value
(
"${plannedPowerGenerationTotal:10000}"
)
@Value
(
"${plannedPowerGenerationTotal:10000}"
)
Long
plannedPowerGenerationTotal
;
Long
plannedPowerGenerationTotal
;
/**
/**
* 区域mapper
* 区域mapper
*/
*/
@Autowired
@Autowired
RegionMapper
regionMapper
;
RegionMapper
regionMapper
;
@Autowired
@Autowired
StationPlanMapper
stationPlanMapper
;
StationPlanMapper
stationPlanMapper
;
@Autowired
@Autowired
IndicatorDataMapper
indicatorDataMapper
;
IndicatorDataMapper
indicatorDataMapper
;
/**
/**
* 场站mapper
* 场站mapper
*/
*/
@Autowired
@Autowired
StationBasicMapper
stationBasicMapper
;
StationBasicMapper
stationBasicMapper
;
/**
/**
* 场站坐标mapper
* 场站坐标mapper
*/
*/
@Autowired
@Autowired
StationCoordinateMapper
stationCoordinateMapper
;
StationCoordinateMapper
stationCoordinateMapper
;
/***
/***
* 设备基础信息中间表数据-热工院
* 设备基础信息中间表数据-热工院
*/
*/
@Autowired
@Autowired
SjglZsjZsbtzServiceImpl
SjglZsjZsbtzServiceImpl
;
SjglZsjZsbtzServiceImpl
SjglZsjZsbtzServiceImpl
;
@Autowired
@Autowired
CommonServiceImpl
commonServiceImpl
;
CommonServiceImpl
commonServiceImpl
;
// 维护的接口信息
//维护的接口信息
@Autowired
@Autowired
MapRegionMapper
mapRegionMapper
;
MapRegionMapper
mapRegionMapper
;
@Autowired
@Autowired
EmqKeeper
emqKeeper
;
EmqKeeper
emqKeeper
;
// @Autowired
// @Autowired
// InfluxdbUtil influxdbUtil;
// InfluxdbUtil influxdbUtil;
/**
/**
* 根据场站编号获取该场站的装机容量
* 根据场站编号获取该场站的装机容量
*
*
* @param werks
* @param werks
* @return
* @return
*/
*/
public
Double
getStationCaPACITYL
(
String
werks
)
{
public
Double
getStationCaPACITYL
(
String
werks
)
{
Double
installCapacity
=
0.0
;
Double
installCapacity
=
0.0
;
installCapacity
=
this
.
SjglZsjZsbtzServiceImpl
.
getStationCapactityByStationWerks
(
werks
)
;
installCapacity
=
this
.
SjglZsjZsbtzServiceImpl
.
getStationCapactityByStationWerks
(
werks
)
;
return
ObjectUtils
.
isEmpty
(
installCapacity
)
?
0.00
:
installCapacity
;
return
ObjectUtils
.
isEmpty
(
installCapacity
)
?
0.00
:
installCapacity
;
}
}
/***
* 获取风站场站
/**
*
*
* 获取风站场站
*/
*
public
Map
<
String
,
String
>
getStationfs
(
StationBasic
stationBasic
)
{
* */
String
value
=
"0"
;
public
Map
<
String
,
String
>
getStationfs
(
StationBasic
stationBasic
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
String
value
=
"0"
;
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>()
;
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
))
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>
();
String
gatewayId
=
stationBasic
.
getFanGatewayId
();
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
))
{
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"30秒平均风速"
));
String
gatewayId
=
stationBasic
.
getFanGatewayId
(
);
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
gatewayId
)
);
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"30秒平均风速"
));
List
<
ESEquipments
>
result2
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
gatewayId
)
);
ESEquipments
.
class
);
List
<
ESEquipments
>
result2
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
value
=
String
.
format
(
"%.2f"
,
commonServiceImpl
.
getAvagerByEquipmentIndxName
(
result2
,
"30秒平均风速"
)
);
value
=
String
.
format
(
"%.2f"
,
commonServiceImpl
.
getAvagerByEquipmentIndxName
(
result2
,
"30秒平均风速"
)
);
map
.
put
(
"name"
,
"风速/辐照度"
);
map
.
put
(
"name"
,
"风速/辐照度
"
);
map
.
put
(
"value"
,
value
+
"m/s
"
);
map
.
put
(
"value"
,
value
+
"m/s"
);
}
else
{
}
else
{
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"WTX-801_25_WTX-801_总辐射"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"WTX-801_25_WTX-801_总辐射"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
List
<
ESEquipments
>
result1
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
List
<
ESEquipments
>
result1
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
ESEquipments
.
class
);
value
=
String
.
format
(
"%.2f"
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"WTX-801_25_WTX-801_总辐射"
));
value
=
String
.
format
(
"%.2f"
,
map
.
put
(
"name"
,
"风速/辐照度"
);
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"WTX-801_25_WTX-801_总辐射"
)
);
map
.
put
(
"value"
,
value
+
"W/㎡
"
);
map
.
put
(
"name"
,
"风速/辐照度
"
);
}
map
.
put
(
"value"
,
value
+
"W/㎡"
);
}
return
map
;
return
map
;
}
}
/***
/***
* 电站容量
* 电站容量
*
*/
*/
public
Map
<
String
,
String
>
getStationrl
(
StationBasic
stationBasic
)
{
public
Map
<
String
,
String
>
getStationrl
(
StationBasic
stationBasic
)
{
Double
installCapacity
=
0.0
;
Double
installCapacity
=
0.0
;
installCapacity
=
this
.
SjglZsjZsbtzServiceImpl
.
getStationCapactityByStationWerks
(
stationBasic
.
getStationNumber
());
installCapacity
=
this
.
SjglZsjZsbtzServiceImpl
String
value
=
ObjectUtils
.
isEmpty
(
installCapacity
)
?
"0.00"
:
String
.
format
(
"%.2f"
,
installCapacity
);
.
getStationCapactityByStationWerks
(
stationBasic
.
getStationNumber
()
);
Map
<
String
,
String
>
map
=
new
HashMap
<>(
);
String
value
=
ObjectUtils
.
isEmpty
(
installCapacity
)
?
"0.00"
:
String
.
format
(
"%.2f"
,
installCapacity
);
map
.
put
(
"name"
,
"容量"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>(
);
map
.
put
(
"value"
,
value
+
"MW
"
);
map
.
put
(
"name"
,
"容量
"
);
return
map
;
map
.
put
(
"value"
,
value
+
"MW"
)
;
}
return
map
;
}
/**
/**
* 根据省份名称查询电站详情
* 根据省份名称查询电站详情
*
*
* @param provinceName
* @param provinceName
* @return
* @return
*/
*/
// public List<RegionNationWideDto> getNationWideInfo(String provinceName, String type) {
// public List<RegionNationWideDto> getNationWideInfo(String provinceName, String type) {
// List<RegionNationWideDto> regionNationWideDtoList = new ArrayList<>();
// List<RegionNationWideDto> regionNationWideDtoList = new ArrayList<>();
// List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("belong_area").isNotNull("fan_gateway_id"));
// List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("belong_area").isNotNull("fan_gateway_id"));
...
@@ -226,7 +224,6 @@ public class MonitoringServiceImpl {
...
@@ -226,7 +224,6 @@ public class MonitoringServiceImpl {
// return regionNationWideDtoList;
// return regionNationWideDtoList;
// }
// }
// public ResultsData getCompletionOfPowerIndicatorsByProvinceName(int current, int size, String provinceName) {
// public ResultsData getCompletionOfPowerIndicatorsByProvinceName(int current, int size, String provinceName) {
//
//
// List<ColModel> colModels = new ArrayList<>();
// List<ColModel> colModels = new ArrayList<>();
...
@@ -368,82 +365,95 @@ public class MonitoringServiceImpl {
...
@@ -368,82 +365,95 @@ public class MonitoringServiceImpl {
// logger.error("-----------------发送区域实时生产数据消息=================== 失败!");
// logger.error("-----------------发送区域实时生产数据消息=================== 失败!");
// }
// }
// }
// }
public
List
<
TabDto
>
getTabsByStationBasicId
(
String
stationBasicId
)
{
public
List
<
TabDto
>
getTabsByStationBasicId
(
String
stationBasicId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationBasicId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationBasicId
);
List
<
TabDto
>
tabDtoList
=
new
ArrayList
<>();
List
<
TabDto
>
tabDtoList
=
new
ArrayList
<>();
if
(
stationBasic
.
getStationType
().
contains
(
"FDZ"
)
&&
stationBasic
.
getStationType
().
length
()
<
4
)
{
if
(
stationBasic
.
getStationType
().
contains
(
"FDZ"
)
&&
stationBasic
.
getStationType
().
length
()
<
4
)
{
TabDto
tab0
=
new
TabDto
(
"风机布置图"
,
"0"
);
TabDto
tab0
=
new
TabDto
(
"风机布置图"
,
"0"
);
TabDto
tab1
=
new
TabDto
(
"集电线路图"
,
"1"
);
TabDto
tab1
=
new
TabDto
(
"集电线路图"
,
"1"
);
TabDto
tab2
=
new
TabDto
(
"运行列表"
,
"2"
);
TabDto
tab2
=
new
TabDto
(
"运行列表"
,
"2"
);
TabDto
tab3
=
new
TabDto
(
"升压站监控"
,
"3"
);
TabDto
tab3
=
new
TabDto
(
"升压站监控"
,
"3"
);
TabDto
tab4
=
new
TabDto
(
"电量表计"
,
"4"
);
TabDto
tab4
=
new
TabDto
(
"电量表计"
,
"4"
);
TabDto
tab5
=
new
TabDto
(
"故障信息"
,
"5"
);
TabDto
tab5
=
new
TabDto
(
"故障信息"
,
"5"
);
tabDtoList
.
add
(
tab0
);
tabDtoList
.
add
(
tab0
);
tabDtoList
.
add
(
tab1
);
tabDtoList
.
add
(
tab1
);
tabDtoList
.
add
(
tab2
);
tabDtoList
.
add
(
tab2
);
tabDtoList
.
add
(
tab3
);
tabDtoList
.
add
(
tab3
);
tabDtoList
.
add
(
tab4
);
tabDtoList
.
add
(
tab4
);
tabDtoList
.
add
(
tab5
);
tabDtoList
.
add
(
tab5
);
}
else
{
}
else
{
TabDto
tab6
=
new
TabDto
(
"光伏区布置图"
,
"6"
);
TabDto
tab6
=
new
TabDto
(
"光伏区布置图"
,
"6"
);
TabDto
tab7
=
new
TabDto
(
"集电线路图"
,
"7"
);
TabDto
tab7
=
new
TabDto
(
"集电线路图"
,
"7"
);
TabDto
tab8
=
new
TabDto
(
"运行列表"
,
"8"
);
TabDto
tab8
=
new
TabDto
(
"运行列表"
,
"8"
);
TabDto
tab9
=
new
TabDto
(
"升压站监控"
,
"9"
);
TabDto
tab9
=
new
TabDto
(
"升压站监控"
,
"9"
);
TabDto
tab10
=
new
TabDto
(
"电量表计"
,
"10"
);
TabDto
tab10
=
new
TabDto
(
"电量表计"
,
"10"
);
TabDto
tab11
=
new
TabDto
(
"故障信息"
,
"11"
);
TabDto
tab11
=
new
TabDto
(
"故障信息"
,
"11"
);
// TabDto tab12 = new TabDto("集中式-离散率", "12");
// TabDto tab12 = new TabDto("集中式-离散率", "12");
// TabDto tab13 = new TabDto("组串式-离散率", "13");
// TabDto tab13 = new TabDto("组串式-离散率", "13");
TabDto
tab14
=
new
TabDto
(
"离散率"
,
"14"
);
TabDto
tab14
=
new
TabDto
(
"离散率"
,
"14"
);
tabDtoList
.
add
(
tab6
);
tabDtoList
.
add
(
tab6
);
tabDtoList
.
add
(
tab7
);
tabDtoList
.
add
(
tab7
);
tabDtoList
.
add
(
tab8
);
tabDtoList
.
add
(
tab8
);
tabDtoList
.
add
(
tab9
);
tabDtoList
.
add
(
tab9
);
tabDtoList
.
add
(
tab10
);
tabDtoList
.
add
(
tab10
);
tabDtoList
.
add
(
tab11
);
tabDtoList
.
add
(
tab11
);
// tabDtoList.add(tab12);
// tabDtoList.add(tab12);
// tabDtoList.add(tab13);
// tabDtoList.add(tab13);
tabDtoList
.
add
(
tab14
);
tabDtoList
.
add
(
tab14
);
}
}
return
tabDtoList
;
return
tabDtoList
;
}
}
public
List
<
MapAreaInfoDto
>
getAreaInfo
()
{
public
List
<
MapAreaInfoDto
>
getAreaInfo
()
{
List
<
MapAreaInfoDto
>
mapAreaInfoDtoList
=
new
ArrayList
<>();
List
<
MapAreaInfoDto
>
mapAreaInfoDtoList
=
new
ArrayList
<>();
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"belong_area"
));
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
List
<
MapRegion
>
mapRegionList
=
mapRegionMapper
.
selectList
(
new
QueryWrapper
<
MapRegion
>().
isNotNull
(
"name"
));
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"belong_area"
));
List
<
Region
>
regionList
=
regionMapper
.
selectList
(
new
QueryWrapper
<
Region
>().
eq
(
"LEVEL"
,
1
));
List
<
MapRegion
>
mapRegionList
=
mapRegionMapper
.
selectList
(
new
QueryWrapper
<
MapRegion
>().
isNotNull
(
"name"
));
mapRegionList
.
forEach
(
mapRegion
->
{
List
<
Region
>
regionList
=
regionMapper
.
selectList
(
new
QueryWrapper
<
Region
>().
eq
(
"LEVEL"
,
1
));
MapAreaInfoDto
mapAreaInfoDto
=
new
MapAreaInfoDto
();
mapRegionList
.
forEach
(
mapRegion
->
{
//开始处理省份名称-三维与二维的名称有差异
MapAreaInfoDto
mapAreaInfoDto
=
new
MapAreaInfoDto
();
ArrayList
<
String
>
stringArrayList
=
mapRegion
.
getProvince
();
// 开始处理省份名称-三维与二维的名称有差异
List
<
Region
>
regions
=
regionList
.
stream
().
filter
(
region
->
stringArrayList
.
contains
(
region
.
getRegionName
().
substring
(
0
,
2
))
||
stringArrayList
.
contains
(
region
.
getRegionName
().
substring
(
0
,
3
))).
collect
(
Collectors
.
toList
());
ArrayList
<
String
>
stringArrayList
=
mapRegion
.
getProvince
();
List
<
String
>
regionNames
=
regions
.
stream
().
map
(
region
->
region
.
getRegionName
()).
collect
(
Collectors
.
toList
());
List
<
Region
>
regions
=
regionList
.
stream
()
List
<
String
>
regionCodes
=
regions
.
stream
().
map
(
region
->
String
.
valueOf
(
region
.
getRegionCode
())).
collect
(
Collectors
.
toList
());
.
filter
(
region
->
stringArrayList
.
contains
(
region
.
getRegionName
().
substring
(
0
,
2
))
List
<
StationBasic
>
stationBasicListAll
=
stationBasicList
.
stream
().
filter
(
stationBasic
->
regionCodes
.
contains
(
stationBasic
.
getBelongArea
().
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
split
(
","
)[
0
])).
collect
(
Collectors
.
toList
());
||
stringArrayList
.
contains
(
region
.
getRegionName
().
substring
(
0
,
3
)))
mapAreaInfoDto
.
setProvince
(
regionNames
);
.
collect
(
Collectors
.
toList
());
// --------------------省份名称处理结束----------------------------
List
<
String
>
regionNames
=
regions
.
stream
().
map
(
region
->
region
.
getRegionName
())
//设置片区名称
.
collect
(
Collectors
.
toList
());
mapAreaInfoDto
.
setAreaName
(
mapRegion
.
getName
());
List
<
String
>
regionCodes
=
regions
.
stream
().
map
(
region
->
String
.
valueOf
(
region
.
getRegionCode
()))
//设置片区code
.
collect
(
Collectors
.
toList
());
mapAreaInfoDto
.
setAreaCode
(
mapRegion
.
getAreaCode
());
List
<
StationBasic
>
stationBasicListAll
=
stationBasicList
.
stream
()
//风电站数量
.
filter
(
stationBasic
->
regionCodes
mapAreaInfoDto
.
setWindPowerStationCount
(
String
.
valueOf
(
stationBasicListAll
.
stream
().
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"FDZ"
)).
count
()));
.
contains
(
stationBasic
.
getBelongArea
().
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
split
(
","
)[
0
]))
//集中式光伏电站数量
.
collect
(
Collectors
.
toList
());
mapAreaInfoDto
.
setCentralizedPhotovoltaicStationCount
(
String
.
valueOf
(
stationBasicListAll
.
stream
().
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"JZSGFDZ"
)).
count
()));
mapAreaInfoDto
.
setProvince
(
regionNames
);
//分布式光伏电站数量
// --------------------省份名称处理结束----------------------------
mapAreaInfoDto
.
setDistributedPhotovoltaicStationCount
(
String
.
valueOf
(
stationBasicListAll
.
stream
().
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"FBSGFDZ"
)).
count
()));
// 设置片区名称
//储能光伏电站数量
mapAreaInfoDto
.
setAreaName
(
mapRegion
.
getName
());
mapAreaInfoDto
.
setEnergyStorageStationCount
(
String
.
valueOf
(
stationBasicListAll
.
stream
().
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"CNDZ"
)).
count
()));
// 设置片区code
//获取装机容量
mapAreaInfoDto
.
setAreaCode
(
mapRegion
.
getAreaCode
());
mapAreaInfoDto
.
setInstalledCapacity
(
getInstallCapity
(
stationBasicListAll
));
// 风电站数量
//获取当日发电量
mapAreaInfoDto
.
setWindPowerStationCount
(
String
.
valueOf
(
stationBasicListAll
.
stream
()
mapAreaInfoDto
.
setElectricityGenerationOfDay
(
getPowerOfDaily
(
stationBasicListAll
));
.
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"FDZ"
)).
count
()));
mapAreaInfoDto
.
setPosition
(
mapRegion
.
getPosition
());
// 集中式光伏电站数量
mapAreaInfoDtoList
.
add
(
mapAreaInfoDto
);
mapAreaInfoDto
.
setCentralizedPhotovoltaicStationCount
(
String
.
valueOf
(
stationBasicListAll
.
stream
()
});
.
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"JZSGFDZ"
)).
count
()));
// 分布式光伏电站数量
return
mapAreaInfoDtoList
;
mapAreaInfoDto
.
setDistributedPhotovoltaicStationCount
(
String
.
valueOf
(
stationBasicListAll
.
stream
()
}
.
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"FBSGFDZ"
)).
count
()));
// 储能光伏电站数量
mapAreaInfoDto
.
setEnergyStorageStationCount
(
String
.
valueOf
(
stationBasicListAll
.
stream
()
.
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"CNDZ"
)).
count
()));
// 获取装机容量
mapAreaInfoDto
.
setInstalledCapacity
(
getInstallCapity
(
stationBasicListAll
));
// 获取当日发电量
mapAreaInfoDto
.
setElectricityGenerationOfDay
(
getPowerOfDaily
(
stationBasicListAll
));
mapAreaInfoDto
.
setPosition
(
mapRegion
.
getPosition
());
mapAreaInfoDtoList
.
add
(
mapAreaInfoDto
);
});
return
mapAreaInfoDtoList
;
}
// public List<HomeMapStationInfoDto> getStaitonListInfoByAreaName(String areaName) {
// public List<HomeMapStationInfoDto> getStaitonListInfoByAreaName(String areaName) {
// List<HomeMapStationInfoDto> homeMapStationInfoDtoList = new ArrayList<>();
// List<HomeMapStationInfoDto> homeMapStationInfoDtoList = new ArrayList<>();
...
@@ -488,160 +498,172 @@ public class MonitoringServiceImpl {
...
@@ -488,160 +498,172 @@ public class MonitoringServiceImpl {
// return homeMapStationInfoDtoList;
// return homeMapStationInfoDtoList;
// }
// }
public
Map
<
String
,
Object
>
getDetailsWindSpeedAlldata
(
StationBasic
stationBasic
)
{
public
Map
<
String
,
Object
>
getDetailsWindSpeedAlldata
(
StationBasic
stationBasic
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
String
>
values
=
new
ArrayList
<>();
List
<
String
>
values
=
new
ArrayList
<>();
Map
<
Date
,
Double
>
groupMap
=
new
HashMap
<>();
Map
<
Date
,
Double
>
groupMap
=
new
HashMap
<>();
List
<
String
>
time
=
new
ArrayList
<>();
List
<
String
>
time
=
new
ArrayList
<>();
Map
<
String
,
Object
>
activePowerInfo
=
new
HashMap
<>();
Map
<
String
,
Object
>
activePowerInfo
=
new
HashMap
<>();
List
<
IndicatorData
>
activePowerList
=
new
ArrayList
<>();
List
<
IndicatorData
>
activePowerList
=
new
ArrayList
<>();
// String startTime = DateUtil.today() + " 00:00:00";
// String startTime = DateUtil.today() + " 00:00:00";
// String endTime = DateUtil.today() + " 23:59:59";
// String endTime = DateUtil.today() + " 23:59:59";
Date
currentDayStartTime
=
DateUtils
.
getCurrentDayStartTime
(
new
Date
());
Date
currentDayStartTime
=
DateUtils
.
getCurrentDayStartTime
(
new
Date
());
Date
currentDayEndTime
=
DateUtils
.
getCurrentDayEndTime
(
new
Date
());
Date
currentDayEndTime
=
DateUtils
.
getCurrentDayEndTime
(
new
Date
());
Calendar
calendar
=
Calendar
.
getInstance
(
TimeZone
.
getTimeZone
(
"UTC"
));
Calendar
calendar
=
Calendar
.
getInstance
(
TimeZone
.
getTimeZone
(
"UTC"
));
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss'Z'"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss'Z'"
);
sdf
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"UTC"
));
sdf
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"UTC"
));
String
startTime
=
sdf
.
format
(
currentDayStartTime
);
String
startTime
=
sdf
.
format
(
currentDayStartTime
);
String
endTime
=
sdf
.
format
(
currentDayEndTime
);
String
endTime
=
sdf
.
format
(
currentDayEndTime
);
Double
installedCapacity
=
commonServiceImpl
.
getStationCapactityByStationWerks
(
stationBasic
.
getStationNumber
());
Double
installedCapacity
=
commonServiceImpl
.
getStationCapactityByStationWerks
(
stationBasic
.
getStationNumber
());
if
(
"FDZ"
.
equals
(
stationBasic
.
getStationType
()))
{
if
(
"FDZ"
.
equals
(
stationBasic
.
getStationType
()))
{
activePowerList
=
indicatorDataMapper
.
selectDataByequipmentIndexNameAndtime
(
CommonConstans
.
xiazaoActivePowerPoint
,
startTime
,
endTime
,
stationBasic
.
getBoosterGatewayId
());
activePowerList
=
indicatorDataMapper
.
selectDataByequipmentIndexNameAndtime
(
}
else
{
CommonConstans
.
xiazaoActivePowerPoint
,
startTime
,
endTime
,
stationBasic
.
getBoosterGatewayId
());
activePowerList
=
indicatorDataMapper
.
selectDataByequipmentIndexNameAndtime
(
CommonConstans
.
taiheActivePowerPoint
,
startTime
,
endTime
,
stationBasic
.
getBoosterGatewayId
());
}
else
{
}
activePowerList
=
indicatorDataMapper
.
selectDataByequipmentIndexNameAndtime
(
for
(
int
i
=
0
;
i
<
activePowerList
.
size
();
i
++)
{
CommonConstans
.
taiheActivePowerPoint
,
startTime
,
endTime
,
stationBasic
.
getBoosterGatewayId
());
IndicatorData
indicatorData
=
activePowerList
.
get
(
i
);
}
time
.
add
(
DateUtil
.
format
(
indicatorData
.
getCreatedTime
(),
"HH:mm"
));
for
(
int
i
=
0
;
i
<
activePowerList
.
size
();
i
++)
{
if
(
"FDZ"
.
equals
(
stationBasic
.
getStationType
()))
{
IndicatorData
indicatorData
=
activePowerList
.
get
(
i
);
values
.
add
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
indicatorData
.
getValueF
()));
time
.
add
(
DateUtil
.
format
(
indicatorData
.
getCreatedTime
(),
"HH:mm"
));
}
else
{
if
(
"FDZ"
.
equals
(
stationBasic
.
getStationType
()))
{
values
.
add
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
indicatorData
.
getValueF
()
*
CommonConstans
.
kwToMv
));
values
.
add
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
indicatorData
.
getValueF
()));
}
}
else
{
}
values
.
add
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
String
max
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
values
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
indicatorData
.
getValueF
()
*
CommonConstans
.
kwToMv
));
String
min
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
values
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
}
String
mean
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
values
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
average
().
getAsDouble
());
}
activePowerInfo
.
put
(
"mean"
,
mean
);
String
max
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
activePowerInfo
.
put
(
"max"
,
max
);
values
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
activePowerInfo
.
put
(
"min"
,
min
);
String
min
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
activePowerInfo
.
put
(
"maxTime"
,
time
.
get
(
values
.
lastIndexOf
(
max
)));
values
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
activePowerInfo
.
put
(
"minTime"
,
time
.
get
(
values
.
lastIndexOf
(
min
)));
String
mean
=
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
activePowerInfo
.
put
(
"load"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
Double
.
valueOf
(
values
.
get
(
values
.
size
()
-
1
))
/
installedCapacity
));
values
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
average
().
getAsDouble
());
activePowerInfo
.
put
(
"mean"
,
mean
);
activePowerInfo
.
put
(
"max"
,
max
);
List
<
Map
<
String
,
Object
>>
seriesData
=
new
ArrayList
<>();
activePowerInfo
.
put
(
"min"
,
min
);
Map
<
String
,
Object
>
map3
=
new
HashMap
<>();
activePowerInfo
.
put
(
"maxTime"
,
time
.
get
(
values
.
lastIndexOf
(
max
)));
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
activePowerInfo
.
put
(
"minTime"
,
time
.
get
(
values
.
lastIndexOf
(
min
)));
Map
<
String
,
Object
>
map2
=
new
HashMap
<>();
activePowerInfo
.
put
(
"load"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
map1
.
put
(
"data"
,
values
);
Double
.
valueOf
(
values
.
get
(
values
.
size
()
-
1
))
/
installedCapacity
));
seriesData
.
add
(
map1
);
map
.
put
(
"seriesData"
,
seriesData
);
List
<
Map
<
String
,
Object
>>
seriesData
=
new
ArrayList
<>();
map
.
put
(
"axisData"
,
time
);
Map
<
String
,
Object
>
map3
=
new
HashMap
<>();
try
{
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
emqKeeper
.
getMqttClient
().
publish
(
stationBasic
.
getSequenceNbr
()
+
"_Power_table"
,
JSON
.
toJSON
(
map
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
Map
<
String
,
Object
>
map2
=
new
HashMap
<>();
emqKeeper
.
getMqttClient
().
publish
(
stationBasic
.
getSequenceNbr
()
+
"_Power_info"
,
JSON
.
toJSON
(
activePowerInfo
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
map1
.
put
(
"data"
,
values
);
}
catch
(
Exception
exception
)
{
seriesData
.
add
(
map1
);
exception
.
printStackTrace
();
map
.
put
(
"seriesData"
,
seriesData
);
}
map
.
put
(
"axisData"
,
time
);
return
map
;
try
{
}
emqKeeper
.
getMqttClient
().
publish
(
stationBasic
.
getSequenceNbr
()
+
"_Power_table"
,
JSON
.
toJSON
(
map
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
stationBasic
.
getSequenceNbr
()
+
"_Power_info"
,
public
String
getInstallCapity
(
List
<
StationBasic
>
stationBasicList
)
{
JSON
.
toJSON
(
activePowerInfo
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.0
);
}
catch
(
Exception
exception
)
{
stationBasicList
.
forEach
(
stationBasic
->
{
exception
.
printStackTrace
();
if
(
stationBasic
.
getStationNumber
()
!=
null
)
{
}
try
{
return
map
;
total
.
updateAndGet
(
v
->
v
+
getStationCaPACITYL
(
stationBasic
.
getStationNumber
()));
}
}
catch
(
Exception
e
)
{
public
String
getInstallCapity
(
List
<
StationBasic
>
stationBasicList
)
{
}
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.0
);
}
stationBasicList
.
forEach
(
stationBasic
->
{
});
if
(
stationBasic
.
getStationNumber
()
!=
null
)
{
return
String
.
format
(
"%.2f"
,
total
.
get
());
try
{
}
total
.
updateAndGet
(
v
->
v
+
getStationCaPACITYL
(
stationBasic
.
getStationNumber
()));
}
catch
(
Exception
e
)
{
public
String
getPowerOfDaily
(
List
<
StationBasic
>
stationBasicList
)
{
}
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.0
);
}
stationBasicList
.
forEach
(
stationBasic
->
{
});
if
(
stationBasic
.
getFanGatewayId
()
!=
null
)
{
return
String
.
format
(
"%.2f"
,
total
.
get
());
try
{
}
total
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"日发电量"
));
}
catch
(
Exception
e
)
{
public
String
getPowerOfDaily
(
List
<
StationBasic
>
stationBasicList
)
{
}
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.0
);
}
stationBasicList
.
forEach
(
stationBasic
->
{
if
(
stationBasic
.
getFanGatewayId
()
!=
null
)
{
});
try
{
return
String
.
format
(
"%.2f"
,
total
.
get
());
total
.
updateAndGet
(
}
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"日发电量"
));
}
catch
(
Exception
e
)
{
public
List
<
Map
<
String
,
String
>>
getStaionCategoryInfo
(
String
areaName
)
{
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
}
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
}
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
stationBasicListAll
=
getListOfStationBasicByAreaName
(
areaName
);
});
}
else
{
return
String
.
format
(
"%.2f"
,
total
.
get
());
stationBasicListAll
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
}
}
Map
<
String
,
List
<
StationBasic
>>
listMap
=
stationBasicListAll
.
stream
().
collect
(
Collectors
.
groupingBy
(
stationBasic
->
stationBasic
.
getStationTypeName
()));
public
List
<
Map
<
String
,
String
>>
getStaionCategoryInfo
(
String
areaName
)
{
listMap
.
keySet
().
forEach
(
key
->
{
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
Map
<
String
,
String
>
stringStringMap
=
new
HashMap
<>();
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
stringStringMap
.
put
(
"name"
,
key
);
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
stringStringMap
.
put
(
"value"
,
String
.
valueOf
(
listMap
.
get
(
key
).
size
()));
stationBasicListAll
=
getListOfStationBasicByAreaName
(
areaName
);
result
.
add
(
stringStringMap
);
}
else
{
});
stationBasicListAll
=
stationBasicMapper
return
result
;
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
}
}
Map
<
String
,
List
<
StationBasic
>>
listMap
=
stationBasicListAll
.
stream
()
//获取装机容量
.
collect
(
Collectors
.
groupingBy
(
stationBasic
->
stationBasic
.
getStationTypeName
()));
public
HashMap
<
String
,
String
>
getInstallCapityByAreaName
(
String
areaName
)
{
listMap
.
keySet
().
forEach
(
key
->
{
HashMap
<
String
,
String
>
hashMap
=
new
HashMap
<>();
Map
<
String
,
String
>
stringStringMap
=
new
HashMap
<>();
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.0
);
stringStringMap
.
put
(
"name"
,
key
);
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
stringStringMap
.
put
(
"value"
,
String
.
valueOf
(
listMap
.
get
(
key
).
size
()));
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
result
.
add
(
stringStringMap
);
stationBasicListAll
=
getListOfStationBasicByAreaName
(
areaName
);
});
}
else
{
return
result
;
stationBasicListAll
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
}
}
stationBasicListAll
.
forEach
(
stationBasic
->
{
// 获取装机容量
total
.
updateAndGet
(
v
->
v
+
getStationCaPACITYL
(
stationBasic
.
getStationNumber
()));
public
HashMap
<
String
,
String
>
getInstallCapityByAreaName
(
String
areaName
)
{
});
HashMap
<
String
,
String
>
hashMap
=
new
HashMap
<>();
hashMap
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
total
.
get
()));
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.0
);
return
hashMap
;
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
}
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
stationBasicListAll
=
getListOfStationBasicByAreaName
(
areaName
);
//获取有功功率
}
else
{
public
HashMap
<
String
,
String
>
getActivePowerByAreaName
(
String
areaName
)
{
stationBasicListAll
=
stationBasicMapper
HashMap
<
String
,
String
>
hashMap
=
new
HashMap
<>();
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.0
);
}
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
stationBasicListAll
.
forEach
(
stationBasic
->
{
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
total
.
updateAndGet
(
v
->
v
+
getStationCaPACITYL
(
stationBasic
.
getStationNumber
()));
stationBasicListAll
=
getListOfStationBasicByAreaName
(
areaName
);
});
}
else
{
hashMap
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
total
.
get
()));
stationBasicListAll
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
return
hashMap
;
}
}
stationBasicListAll
.
forEach
(
stationBasic
->
{
total
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"有功功率"
));
// 获取有功功率
});
public
HashMap
<
String
,
String
>
getActivePowerByAreaName
(
String
areaName
)
{
//有功功率换算
HashMap
<
String
,
String
>
hashMap
=
new
HashMap
<>();
hashMap
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
total
.
get
()
/
1000
));
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.0
);
return
hashMap
;
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
}
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
stationBasicListAll
=
getListOfStationBasicByAreaName
(
areaName
);
//获取社会贡献
}
else
{
stationBasicListAll
=
stationBasicMapper
/**
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
* @param areaName 片区名称
}
* @param stationId 场站id
stationBasicListAll
.
forEach
(
stationBasic
->
{
* @return 社会贡献列表
total
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"有功功率"
));
* @deprecated 如果areaName 与 stationID 都不传 则查全国、如果areaName传了 staionID没有传则查片区 如果 areaName 与stationId都传 则取场站id
});
*/
// 有功功率换算
hashMap
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
total
.
get
()
/
1000
));
return
hashMap
;
}
// 获取社会贡献
/**
* @param areaName 片区名称
* @param stationId 场站id
* @return 社会贡献列表
* @deprecated 如果areaName 与 stationID 都不传 则查全国、如果areaName传了 staionID没有传则查片区 如果
* areaName 与stationId都传 则取场站id
*/
// public Page<SocialContributionDto> getSocialContributionDtoList(String areaName, String stationId) {
// public Page<SocialContributionDto> getSocialContributionDtoList(String areaName, String stationId) {
// AtomicReference<Double> total = new AtomicReference<>(0.0);
// AtomicReference<Double> total = new AtomicReference<>(0.0);
// List<StationBasic> stationBasicListAll = new ArrayList<>();
// List<StationBasic> stationBasicListAll = new ArrayList<>();
...
@@ -731,20 +753,21 @@ public class MonitoringServiceImpl {
...
@@ -731,20 +753,21 @@ public class MonitoringServiceImpl {
// hashMapPage.setRecords(hashMapList);
// hashMapPage.setRecords(hashMapList);
// return hashMapPage;
// return hashMapPage;
// }
// }
public
List
<
StationBasic
>
getListOfStationBasicByAreaName
(
String
areaName
)
{
public
List
<
StationBasic
>
getListOfStationBasicByAreaName
(
String
areaName
)
{
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
MapRegion
mapRegion
=
mapRegionMapper
.
selectOne
(
new
QueryWrapper
<
MapRegion
>().
eq
(
"name"
,
areaName
));
MapRegion
mapRegion
=
mapRegionMapper
.
selectOne
(
new
QueryWrapper
<
MapRegion
>().
eq
(
"name"
,
areaName
));
//获取片区下的省份名称
// 获取片区下的省份名称
ArrayList
<
String
>
stringArrayList
=
mapRegion
.
getProvince
();
ArrayList
<
String
>
stringArrayList
=
mapRegion
.
getProvince
();
//变量获取所有的场站信息
// 变量获取所有的场站信息
for
(
int
i
=
0
;
i
<
stringArrayList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
stringArrayList
.
size
();
i
++)
{
Region
region
=
regionMapper
.
selectOne
(
new
QueryWrapper
<
Region
>().
eq
(
"LEVEL"
,
1
).
like
(
"REGION_NAME"
,
stringArrayList
.
get
(
i
)));
Region
region
=
regionMapper
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
like
(
"belong_area"
,
region
.
getRegionCode
()));
.
selectOne
(
new
QueryWrapper
<
Region
>().
eq
(
"LEVEL"
,
1
).
like
(
"REGION_NAME"
,
stringArrayList
.
get
(
i
)));
stationBasicListAll
.
addAll
(
stationBasicList
);
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
}
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
like
(
"belong_area"
,
region
.
getRegionCode
()));
return
stationBasicListAll
;
stationBasicListAll
.
addAll
(
stationBasicList
);
}
}
return
stationBasicListAll
;
}
// public HashMap<String, List<String>> getPowerGenerationTrendsOfCompletionRate(String areaName) {
// public HashMap<String, List<String>> getPowerGenerationTrendsOfCompletionRate(String areaName) {
// List<StationBasic> stationBasicListAll = new ArrayList<>();
// List<StationBasic> stationBasicListAll = new ArrayList<>();
...
@@ -774,7 +797,6 @@ public class MonitoringServiceImpl {
...
@@ -774,7 +797,6 @@ public class MonitoringServiceImpl {
// return hashMap;
// return hashMap;
// }
// }
// public Page<HashMap<String, String>> getPowerGenerationTrendsOfCompletionTopFive(String areaName) {
// public Page<HashMap<String, String>> getPowerGenerationTrendsOfCompletionTopFive(String areaName) {
// Page<HashMap<String, String>> hashMapPage = new Page<>(1, 5);
// Page<HashMap<String, String>> hashMapPage = new Page<>(1, 5);
// List<HashMap<String, String>> mapList = new ArrayList<>();
// List<HashMap<String, String>> mapList = new ArrayList<>();
...
@@ -811,18 +833,17 @@ public class MonitoringServiceImpl {
...
@@ -811,18 +833,17 @@ public class MonitoringServiceImpl {
// return hashMapPage;
// return hashMapPage;
// }
// }
public
List
<
String
>
getXListofRecentOneYear
()
{
public
List
<
String
>
getXListofRecentOneYear
()
{
List
<
String
>
xList
=
new
ArrayList
<>();
List
<
String
>
xList
=
new
ArrayList
<>();
Calendar
calendar
=
Calendar
.
getInstance
();
Calendar
calendar
=
Calendar
.
getInstance
();
Date
date
=
new
Date
();
Date
date
=
new
Date
();
for
(
int
i
=
1
;
i
<
13
;
i
++)
{
for
(
int
i
=
1
;
i
<
13
;
i
++)
{
calendar
.
setTime
(
date
);
calendar
.
setTime
(
date
);
calendar
.
add
(
Calendar
.
MONTH
,
i
-
12
);
calendar
.
add
(
Calendar
.
MONTH
,
i
-
12
);
xList
.
add
(
String
.
valueOf
(
calendar
.
get
(
Calendar
.
YEAR
)).
substring
(
2
,
4
)
+
"-"
+
calendar
.
get
(
Calendar
.
MONTH
));
xList
.
add
(
String
.
valueOf
(
calendar
.
get
(
Calendar
.
YEAR
)).
substring
(
2
,
4
)
+
"-"
+
calendar
.
get
(
Calendar
.
MONTH
));
}
}
return
xList
;
return
xList
;
}
}
//
//
// public Page<HashMap<String, String>> getPowerGenerationTrendsOfCompletionTopThree(String tabValue, String areaName) {
// public Page<HashMap<String, String>> getPowerGenerationTrendsOfCompletionTopThree(String tabValue, String areaName) {
...
@@ -893,21 +914,23 @@ public class MonitoringServiceImpl {
...
@@ -893,21 +914,23 @@ public class MonitoringServiceImpl {
// return page;
// return page;
// }
// }
@Scheduled
(
cron
=
"0/5 * * * * *"
)
@Scheduled
(
cron
=
"0/5 * * * * *"
)
public
void
getTotalData
()
{
public
void
getTotalData
()
{
//计算所有场站年计划完成量
// 计算所有场站年计划完成量
int
year
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
);
int
year
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
);
int
Moon
=
Calendar
.
getInstance
().
get
(
Calendar
.
MONTH
)
+
1
;
int
Moon
=
Calendar
.
getInstance
().
get
(
Calendar
.
MONTH
)
+
1
;
LambdaQueryWrapper
<
StationPlan
>
query
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
StationPlan
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
StationPlan:
:
getYear
,
String
.
valueOf
(
year
));
query
.
eq
(
StationPlan:
:
getYear
,
String
.
valueOf
(
year
));
List
<
StationPlan
>
stationPlans
=
stationPlanMapper
.
selectList
(
query
);
List
<
StationPlan
>
stationPlans
=
stationPlanMapper
.
selectList
(
query
);
double
yearValue
=
stationPlans
.
stream
().
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
double
yearValue
=
stationPlans
.
stream
().
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
double
fdzValue
=
stationPlans
.
stream
().
filter
(
e
->
e
.
getStationType
().
equals
(
"FDZ"
)).
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
double
fdzValue
=
stationPlans
.
stream
().
filter
(
e
->
e
.
getStationType
().
equals
(
"FDZ"
))
double
gfvalue
=
yearValue
-
fdzValue
;
.
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
double
gfvalue
=
yearValue
-
fdzValue
;
double
moonValue
=
stationPlans
.
stream
().
filter
(
e
->
e
.
getMonthly
().
equals
(
String
.
valueOf
(
Moon
))).
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
double
moonValue
=
stationPlans
.
stream
().
filter
(
e
->
e
.
getMonthly
().
equals
(
String
.
valueOf
(
Moon
)))
//查询风电站年计划完成量
.
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
// 查询风电站年计划完成量
//
//
// List<StationCacheInfoDto> listStationCacheInfoDto = commonServiceImpl.getListStationCacheInfoDto();
// List<StationCacheInfoDto> listStationCacheInfoDto = commonServiceImpl.getListStationCacheInfoDto();
// List<String> fdz = listStationCacheInfoDto.stream().filter(e -> e.getStationType().equals("FDZ")).map(StationCacheInfoDto::getStationId).collect(Collectors.toList());
// List<String> fdz = listStationCacheInfoDto.stream().filter(e -> e.getStationType().equals("FDZ")).map(StationCacheInfoDto::getStationId).collect(Collectors.toList());
...
@@ -917,142 +940,178 @@ public class MonitoringServiceImpl {
...
@@ -917,142 +940,178 @@ public class MonitoringServiceImpl {
// List<StationPlan> fdzPlans = stationPlanMapper.selectList(queryWrapper);
// List<StationPlan> fdzPlans = stationPlanMapper.selectList(queryWrapper);
// double fdzValue = fdzPlans.stream().mapToDouble(StationPlan::getValue).sum();
// double fdzValue = fdzPlans.stream().mapToDouble(StationPlan::getValue).sum();
List
<
StationBasic
>
stationBasicListAll
=
stationBasicMapper
List
<
StationBasic
>
stationBasicListAll
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
List
<
StationBasic
>
fdzList
=
stationBasicListAll
.
stream
().
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"FDZ"
)).
collect
(
Collectors
.
toList
());
List
<
StationBasic
>
fdzList
=
stationBasicListAll
.
stream
()
List
<
StationBasic
>
jzsgfdzList
=
stationBasicListAll
.
stream
().
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"JZSGFDZ"
)).
collect
(
Collectors
.
toList
());
.
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"FDZ"
)).
collect
(
Collectors
.
toList
());
List
<
StationBasic
>
fbsgfdzList
=
stationBasicListAll
.
stream
().
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"FBSGFDZ"
)).
collect
(
Collectors
.
toList
());
List
<
StationBasic
>
jzsgfdzList
=
stationBasicListAll
.
stream
()
List
<
StationBasic
>
gfList
=
stationBasicListAll
.
stream
().
filter
(
stationBasic
->
!
stationBasic
.
getStationType
().
equals
(
"FDZ"
)).
collect
(
Collectors
.
toList
());
.
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"JZSGFDZ"
)).
collect
(
Collectors
.
toList
());
Page
<
HashMap
<
String
,
String
>>
page
=
new
Page
<>(
1
,
10
);
List
<
StationBasic
>
fbsgfdzList
=
stationBasicListAll
.
stream
()
Page
<
HashMap
<
String
,
String
>>
page1
=
new
Page
<>(
1
,
10
);
.
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"FBSGFDZ"
)).
collect
(
Collectors
.
toList
());
Page
<
HashMap
<
String
,
String
>>
page2
=
new
Page
<>(
1
,
10
);
List
<
StationBasic
>
gfList
=
stationBasicListAll
.
stream
()
Page
<
HashMap
<
String
,
String
>>
page3
=
new
Page
<>(
1
,
10
);
.
filter
(
stationBasic
->
!
stationBasic
.
getStationType
().
equals
(
"FDZ"
)).
collect
(
Collectors
.
toList
());
Page
<
HashMap
<
String
,
String
>>
page
=
new
Page
<>(
1
,
10
);
Page
<
HashMap
<
String
,
String
>>
page1
=
new
Page
<>(
1
,
10
);
Page
<
HashMap
<
String
,
String
>>
page2
=
new
Page
<>(
1
,
10
);
Page
<
HashMap
<
String
,
String
>>
page3
=
new
Page
<>(
1
,
10
);
// ----------------装机容量开始-----------------------
// ----------------装机容量开始-----------------------
List
<
HashMap
<
String
,
String
>>
list
=
new
ArrayList
<>();
List
<
HashMap
<
String
,
String
>>
list
=
new
ArrayList
<>();
//
装机容量
//
装机容量
HashMap
<
String
,
String
>
stringHashMap
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap
=
new
HashMap
<>();
BigDecimal
totalInstall
=
new
BigDecimal
(
getInstallCapity
(
stationBasicListAll
));
BigDecimal
totalInstall
=
new
BigDecimal
(
getInstallCapity
(
stationBasicListAll
));
// stringHashMap.put("title", totalInstall.toString());
// stringHashMap.put("title", totalInstall.toString());
//
stringHashMap.put("data", "");
//
stringHashMap.put("data", "");
// list.add(stringHashMap);
// list.add(stringHashMap);
//
风电站
//
风电站
HashMap
<
String
,
String
>
stringHashMap1
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap1
=
new
HashMap
<>();
BigDecimal
fdzInstall
=
new
BigDecimal
(
getInstallCapity
(
fdzList
));
BigDecimal
fdzInstall
=
new
BigDecimal
(
getInstallCapity
(
fdzList
));
stringHashMap1
.
put
(
"title"
,
fdzInstall
.
toString
());
stringHashMap1
.
put
(
"title"
,
fdzInstall
.
toString
());
stringHashMap1
.
put
(
"data"
,
String
.
valueOf
(
fdzList
.
size
()));
stringHashMap1
.
put
(
"data"
,
String
.
valueOf
(
fdzList
.
size
()));
list
.
add
(
stringHashMap1
);
list
.
add
(
stringHashMap1
);
//
集中式光伏电站
//
集中式光伏电站
HashMap
<
String
,
String
>
stringHashMap2
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap2
=
new
HashMap
<>();
BigDecimal
jzsInstall
=
new
BigDecimal
(
getInstallCapity
(
jzsgfdzList
));
BigDecimal
jzsInstall
=
new
BigDecimal
(
getInstallCapity
(
jzsgfdzList
));
stringHashMap2
.
put
(
"title"
,
jzsInstall
.
toString
());
stringHashMap2
.
put
(
"title"
,
jzsInstall
.
toString
());
stringHashMap2
.
put
(
"data"
,
String
.
valueOf
(
jzsgfdzList
.
size
()));
stringHashMap2
.
put
(
"data"
,
String
.
valueOf
(
jzsgfdzList
.
size
()));
list
.
add
(
stringHashMap2
);
list
.
add
(
stringHashMap2
);
//
分布式光伏电站
//
分布式光伏电站
HashMap
<
String
,
String
>
stringHashMap3
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap3
=
new
HashMap
<>();
BigDecimal
fbsInstall
=
new
BigDecimal
(
getInstallCapity
(
fbsgfdzList
));
BigDecimal
fbsInstall
=
new
BigDecimal
(
getInstallCapity
(
fbsgfdzList
));
stringHashMap3
.
put
(
"title"
,
fbsInstall
.
toString
());
stringHashMap3
.
put
(
"title"
,
fbsInstall
.
toString
());
stringHashMap3
.
put
(
"data"
,
String
.
valueOf
(
fbsgfdzList
.
size
()));
stringHashMap3
.
put
(
"data"
,
String
.
valueOf
(
fbsgfdzList
.
size
()));
list
.
add
(
stringHashMap3
);
list
.
add
(
stringHashMap3
);
page
.
setRecords
(
list
);
page
.
setRecords
(
list
);
BigDecimal
gfInstall
=
new
BigDecimal
(
getInstallCapity
(
gfList
));
BigDecimal
gfInstall
=
new
BigDecimal
(
getInstallCapity
(
gfList
));
//----------------------装机容量结束----------------------------------------
//----------------------装机容量结束----------------------------------------
// ----------------装机容量开始-----------------------
// ----------------装机容量开始-----------------------
List
<
HashMap
<
String
,
String
>>
list1
=
new
ArrayList
<>();
List
<
HashMap
<
String
,
String
>>
list1
=
new
ArrayList
<>();
List
<
HashMap
<
String
,
String
>>
list2
=
new
ArrayList
<>();
List
<
HashMap
<
String
,
String
>>
list2
=
new
ArrayList
<>();
List
<
HashMap
<
String
,
String
>>
list3
=
new
ArrayList
<>();
List
<
HashMap
<
String
,
String
>>
list3
=
new
ArrayList
<>();
AtomicReference
<
Double
>
powerOfDayFD
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
powerOfDayFD
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
powerOfMonthFD
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
powerOfMonthFD
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
powerOfAnnualFD
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
powerOfAnnualFD
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
powerOfDayGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
powerOfDayGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
powerOfMonthGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
powerOfMonthGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
powerOfAnnualGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
powerOfAnnualGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
fdzList
.
forEach
(
stationBasic
->
{
fdzList
.
forEach
(
stationBasic
->
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
,
"年发电量"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
,
"年发电量"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
// powerOfDayFD.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量"));
// powerOfDayFD.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "日发电量"));
// powerOfMonthFD.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量"));
// powerOfMonthFD.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "月发电量"));
// powerOfAnnualFD.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"));
// powerOfAnnualFD.updateAndGet(v -> v + commonServiceImpl.getSumByEquipmentIndxName(result, "年发电量"));
powerOfDayFD
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
powerOfDayFD
.
updateAndGet
(
powerOfMonthFD
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
powerOfAnnualFD
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
powerOfMonthFD
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
powerOfAnnualFD
.
updateAndGet
(
});
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
gfList
.
forEach
(
stationBasic
->
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
});
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
CommonConstans
.
taiHeGenIndicator
);
gfList
.
forEach
(
stationBasic
->
{
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
CommonConstans
.
taiHeGenIndicator
);
powerOfDayGF
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorDay
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
powerOfMonthGF
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
powerOfAnnualGF
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorYear
));
ESEquipments
.
class
);
});
powerOfDayGF
.
updateAndGet
(
HashMap
<
String
,
String
>
stringHashMap4
=
new
HashMap
<>();
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorDay
));
stringHashMap4
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfDayFD
.
get
())
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfDayGF
.
get
()));
powerOfMonthGF
.
updateAndGet
(
v
->
v
list1
.
add
(
stringHashMap4
);
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
));
HashMap
<
String
,
String
>
stringHashMap5
=
new
HashMap
<>();
powerOfAnnualGF
.
updateAndGet
(
stringHashMap5
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthFD
.
get
())
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthGF
.
get
()));
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorYear
));
list1
.
add
(
stringHashMap5
);
});
HashMap
<
String
,
String
>
stringHashMap6
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap4
=
new
HashMap
<>();
stringHashMap6
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualFD
.
get
())
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualGF
.
get
()));
stringHashMap4
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfDayFD
.
get
())
+
"/"
list1
.
add
(
stringHashMap6
);
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfDayGF
.
get
()));
HashMap
<
String
,
String
>
stringHashMap7
=
new
HashMap
<>();
list1
.
add
(
stringHashMap4
);
stringHashMap7
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualFD
.
get
()
/
fdzValue
)
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualGF
.
get
()
/
gfvalue
));
HashMap
<
String
,
String
>
stringHashMap5
=
new
HashMap
<>();
list1
.
add
(
stringHashMap7
);
stringHashMap5
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthFD
.
get
())
+
"/"
HashMap
<
String
,
String
>
stringHashMap8
=
new
HashMap
<>();
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthGF
.
get
()));
stringHashMap8
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualFD
.
get
()
*
CommonConstans
.
wkwhToMv
)
/
fdzInstall
.
doubleValue
())
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualGF
.
get
()
*
CommonConstans
.
wkwhToMv
)
/
gfInstall
.
doubleValue
()));
list1
.
add
(
stringHashMap5
);
list1
.
add
(
stringHashMap8
);
HashMap
<
String
,
String
>
stringHashMap6
=
new
HashMap
<>();
page1
.
setRecords
(
list1
);
stringHashMap6
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualFD
.
get
())
+
"/"
HashMap
<
String
,
String
>
stringHashMap9
=
new
HashMap
<>();
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualGF
.
get
()));
stringHashMap9
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfDayFD
.
get
()
+
powerOfDayGF
.
get
()));
list1
.
add
(
stringHashMap6
);
HashMap
<
String
,
String
>
resultMap
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap7
=
new
HashMap
<>();
resultMap
.
put
(
"Day"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfDayFD
.
get
()
+
powerOfDayGF
.
get
()));
stringHashMap7
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualFD
.
get
()
/
fdzValue
)
list2
.
add
(
stringHashMap9
);
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualGF
.
get
()
/
gfvalue
));
HashMap
<
String
,
String
>
stringHashMap10
=
new
HashMap
<>();
list1
.
add
(
stringHashMap7
);
stringHashMap10
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
()));
HashMap
<
String
,
String
>
stringHashMap8
=
new
HashMap
<>();
resultMap
.
put
(
"Moon"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
()));
stringHashMap8
.
put
(
"title"
,
resultMap
.
put
(
"YJHWC"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
())
/
moonValue
*
100
));
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
list2
.
add
(
stringHashMap10
);
(
powerOfAnnualFD
.
get
()
*
CommonConstans
.
wkwhToMv
)
/
fdzInstall
.
doubleValue
())
+
"/"
HashMap
<
String
,
String
>
stringHashMap11
=
new
HashMap
<>();
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
stringHashMap11
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
()));
(
powerOfAnnualGF
.
get
()
*
CommonConstans
.
wkwhToMv
)
/
gfInstall
.
doubleValue
()));
resultMap
.
put
(
"Year"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
()));
list1
.
add
(
stringHashMap8
);
list2
.
add
(
stringHashMap11
);
page1
.
setRecords
(
list1
);
HashMap
<
String
,
String
>
stringHashMap12
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap9
=
new
HashMap
<>();
stringHashMap12
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
())
/
yearValue
*
100
));
stringHashMap9
.
put
(
"title"
,
resultMap
.
put
(
"NJHWC"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
())
/
yearValue
*
100
));
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfDayFD
.
get
()
+
powerOfDayGF
.
get
()));
list2
.
add
(
stringHashMap12
);
HashMap
<
String
,
String
>
resultMap
=
new
HashMap
<>();
page2
.
setRecords
(
list2
);
resultMap
.
put
(
"Day"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfDayFD
.
get
()
+
powerOfDayGF
.
get
()));
Double
totalAnnual
=
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
());
list2
.
add
(
stringHashMap9
);
HashMap
<
String
,
String
>
stringHashMap13
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap10
=
new
HashMap
<>();
stringHashMap13
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
carbonDioxide
)));
stringHashMap10
.
put
(
"title"
,
stringHashMap13
.
put
(
"unit"
,
"二氧化碳减排量(t)"
);
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
()));
list3
.
add
(
stringHashMap13
);
resultMap
.
put
(
"Moon"
,
HashMap
<
String
,
String
>
stringHashMap14
=
new
HashMap
<>();
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
()));
stringHashMap14
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
standardCoal
)));
resultMap
.
put
(
"YJHWC"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
stringHashMap14
.
put
(
"unit"
,
"节约标准煤(t)"
);
(
powerOfMonthFD
.
get
()
+
powerOfMonthGF
.
get
())
/
moonValue
*
100
));
list3
.
add
(
stringHashMap14
);
list2
.
add
(
stringHashMap10
);
HashMap
<
String
,
String
>
stringHashMap15
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap11
=
new
HashMap
<>();
stringHashMap15
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
toner
)));
stringHashMap11
.
put
(
"title"
,
stringHashMap15
.
put
(
"unit"
,
"碳粉尘减排量(t)"
);
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
()));
list3
.
add
(
stringHashMap15
);
resultMap
.
put
(
"Year"
,
HashMap
<
String
,
String
>
stringHashMap16
=
new
HashMap
<>();
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
()));
stringHashMap16
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
sulfurDioxide
)));
list2
.
add
(
stringHashMap11
);
stringHashMap16
.
put
(
"unit"
,
"二氧化硫减排量(t)"
);
HashMap
<
String
,
String
>
stringHashMap12
=
new
HashMap
<>();
list3
.
add
(
stringHashMap16
);
stringHashMap12
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
page3
.
setRecords
(
list3
);
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
())
/
yearValue
*
100
));
try
{
resultMap
.
put
(
"NJHWC"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_zjrl_topic"
,
JSON
.
toJSON
(
page
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
())
/
yearValue
*
100
));
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_ssscsj_topic"
,
JSON
.
toJSON
(
page1
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
list2
.
add
(
stringHashMap12
);
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_zssscsj_topic"
,
JSON
.
toJSON
(
page2
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
page2
.
setRecords
(
list2
);
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_qgjrdz_topic"
,
JSON
.
toJSON
(
resultMap
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
Double
totalAnnual
=
(
powerOfAnnualFD
.
get
()
+
powerOfAnnualGF
.
get
());
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_zshgx_topic"
,
JSON
.
toJSON
(
page3
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
HashMap
<
String
,
String
>
stringHashMap13
=
new
HashMap
<>();
}
catch
(
Exception
ex
)
{
stringHashMap13
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
carbonDioxide
)));
}
stringHashMap13
.
put
(
"unit"
,
"二氧化碳减排量(t)"
);
}
list3
.
add
(
stringHashMap13
);
HashMap
<
String
,
String
>
stringHashMap14
=
new
HashMap
<>();
stringHashMap14
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
standardCoal
)));
stringHashMap14
.
put
(
"unit"
,
"节约标准煤(t)"
);
list3
.
add
(
stringHashMap14
);
HashMap
<
String
,
String
>
stringHashMap15
=
new
HashMap
<>();
stringHashMap15
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
toner
)));
stringHashMap15
.
put
(
"unit"
,
"碳粉尘减排量(t)"
);
list3
.
add
(
stringHashMap15
);
HashMap
<
String
,
String
>
stringHashMap16
=
new
HashMap
<>();
stringHashMap16
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
totalAnnual
*
CommonConstans
.
sulfurDioxide
)));
stringHashMap16
.
put
(
"unit"
,
"二氧化硫减排量(t)"
);
list3
.
add
(
stringHashMap16
);
page3
.
setRecords
(
list3
);
try
{
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_zjrl_topic"
,
JSON
.
toJSON
(
page
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_ssscsj_topic"
,
JSON
.
toJSON
(
page1
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_zssscsj_topic"
,
JSON
.
toJSON
(
page2
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_qgjrdz_topic"
,
JSON
.
toJSON
(
resultMap
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_zshgx_topic"
,
JSON
.
toJSON
(
page3
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
}
catch
(
Exception
ex
)
{
}
}
// public List<HashMap<String, Object>> getNationalPowerGenerationData() {
// public List<HashMap<String, Object>> getNationalPowerGenerationData() {
// List<HashMap<String, Object>> resultHashMap = new ArrayList<>();
// List<HashMap<String, Object>> resultHashMap = new ArrayList<>();
...
@@ -1076,40 +1135,44 @@ public class MonitoringServiceImpl {
...
@@ -1076,40 +1135,44 @@ public class MonitoringServiceImpl {
// return resultHashMap;
// return resultHashMap;
// }
// }
public
HashMap
<
String
,
Object
>
getTableByStationListAndTitle
(
String
title
,
List
<
StationBasic
>
stationBasicList
,
String
color
)
{
public
HashMap
<
String
,
Object
>
getTableByStationListAndTitle
(
String
title
,
List
<
StationBasic
>
stationBasicList
,
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
String
color
)
{
List
<
String
>
xData
=
new
ArrayList
<>();
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
List
<
String
>
yData
=
new
ArrayList
<>();
List
<
String
>
xData
=
new
ArrayList
<>();
stationBasicList
.
forEach
(
stationBasic
->
{
List
<
String
>
yData
=
new
ArrayList
<>();
xData
.
add
(
stationBasic
.
getStationName
());
stationBasicList
.
forEach
(
stationBasic
->
{
yData
.
add
(
stationBasic
.
getAddress
());
xData
.
add
(
stationBasic
.
getStationName
());
});
yData
.
add
(
stationBasic
.
getAddress
());
hashMap
.
put
(
"title"
,
title
);
});
hashMap
.
put
(
"color"
,
color
);
hashMap
.
put
(
"title"
,
title
);
hashMap
.
put
(
"xData"
,
xData
);
hashMap
.
put
(
"color"
,
color
);
hashMap
.
put
(
"yData"
,
yData
);
hashMap
.
put
(
"xData"
,
xData
);
return
hashMap
;
hashMap
.
put
(
"yData"
,
yData
);
}
return
hashMap
;
}
public
List
<
HashMap
<
String
,
Object
>>
getSelectDataForNational
()
{
List
<
HashMap
<
String
,
Object
>>
hashMapList
=
new
ArrayList
<>();
public
List
<
HashMap
<
String
,
Object
>>
getSelectDataForNational
()
{
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"belong_area"
).
isNotNull
(
"fan_gateway_id"
));
List
<
HashMap
<
String
,
Object
>>
hashMapList
=
new
ArrayList
<>();
List
<
Region
>
regionList
=
this
.
regionMapper
.
selectList
(
new
QueryWrapper
<
Region
>().
eq
(
"level"
,
1
));
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
regionList
.
forEach
(
region
->
{
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"belong_area"
).
isNotNull
(
"fan_gateway_id"
));
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
List
<
Region
>
regionList
=
this
.
regionMapper
.
selectList
(
new
QueryWrapper
<
Region
>().
eq
(
"level"
,
1
));
hashMap
.
put
(
"label"
,
region
.
getRegionName
());
regionList
.
forEach
(
region
->
{
hashMap
.
put
(
"value"
,
region
.
getRegionCode
());
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
List
<
HashMap
<
String
,
Object
>>
children
=
stationBasicList
.
stream
().
filter
(
stationBasic
->
stationBasic
.
getBelongArea
().
contains
(
String
.
valueOf
(
region
.
getRegionCode
()))).
map
(
stationBasic
->
{
hashMap
.
put
(
"label"
,
region
.
getRegionName
());
HashMap
<
String
,
Object
>
hashMap1
=
new
HashMap
<>();
hashMap
.
put
(
"value"
,
region
.
getRegionCode
());
hashMap1
.
put
(
"label"
,
stationBasic
.
getStationName
());
List
<
HashMap
<
String
,
Object
>>
children
=
stationBasicList
.
stream
().
filter
(
hashMap1
.
put
(
"value"
,
stationBasic
.
getSequenceNbr
());
stationBasic
->
stationBasic
.
getBelongArea
().
contains
(
String
.
valueOf
(
region
.
getRegionCode
())))
return
hashMap1
;
.
map
(
stationBasic
->
{
}).
collect
(
Collectors
.
toList
());
HashMap
<
String
,
Object
>
hashMap1
=
new
HashMap
<>();
hashMap
.
put
(
"children"
,
children
);
hashMap1
.
put
(
"label"
,
stationBasic
.
getStationName
());
hashMapList
.
add
(
hashMap
);
hashMap1
.
put
(
"value"
,
stationBasic
.
getSequenceNbr
());
});
return
hashMap1
;
return
hashMapList
;
}).
collect
(
Collectors
.
toList
());
}
hashMap
.
put
(
"children"
,
children
);
hashMapList
.
add
(
hashMap
);
});
return
hashMapList
;
}
// const data = {
// const data = {
// xData: [],
// xData: [],
...
@@ -1127,234 +1190,298 @@ public class MonitoringServiceImpl {
...
@@ -1127,234 +1190,298 @@ public class MonitoringServiceImpl {
// ]
// ]
// };
// };
public
HashMap
<
String
,
Object
>
getTheStationPowerCurve
(
String
stationId
,
String
date
)
{
public
HashMap
<
String
,
Object
>
getTheStationPowerCurve
(
String
stationId
,
String
date
)
{
HashMap
<
String
,
Object
>
result
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
HashMap
<
String
,
Object
>>
hashMapList
=
new
ArrayList
<>();
List
<
HashMap
<
String
,
Object
>>
hashMapList
=
new
ArrayList
<>();
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
//x轴数据
// x轴数据
List
<
String
>
xdata
=
new
ArrayList
<>();
List
<
String
>
xdata
=
new
ArrayList
<>();
//实时有功功率
// 实时有功功率
List
<
String
>
currentPowerYdata
=
new
ArrayList
<>();
List
<
String
>
currentPowerYdata
=
new
ArrayList
<>();
//短期功率预测
// 短期功率预测
List
<
String
>
shortPowerYdata
=
new
ArrayList
<>();
List
<
String
>
shortPowerYdata
=
new
ArrayList
<>();
//超短期功率预测
// 超短期功率预测
List
<
String
>
superPowerShortYdata
=
new
ArrayList
<>();
List
<
String
>
superPowerShortYdata
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
25
;
i
++)
{
for
(
int
i
=
0
;
i
<
25
;
i
++)
{
xdata
.
add
(
String
.
format
(
"%02d"
,
i
)
+
":00"
);
xdata
.
add
(
String
.
format
(
"%02d"
,
i
)
+
":00"
);
currentPowerYdata
.
add
(
String
.
format
(
"%.2f"
,
Math
.
random
()
*
30.0
));
currentPowerYdata
.
add
(
String
.
format
(
"%.2f"
,
Math
.
random
()
*
30.0
));
shortPowerYdata
.
add
(
String
.
format
(
"%.2f"
,
Math
.
random
()
*
40.0
));
shortPowerYdata
.
add
(
String
.
format
(
"%.2f"
,
Math
.
random
()
*
40.0
));
superPowerShortYdata
.
add
(
String
.
format
(
"%.2f"
,
Math
.
random
()
*
35.0
));
superPowerShortYdata
.
add
(
String
.
format
(
"%.2f"
,
Math
.
random
()
*
35.0
));
}
}
result
.
put
(
"xData"
,
xdata
);
result
.
put
(
"xData"
,
xdata
);
HashMap
<
String
,
Object
>
currentPowerHashMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
currentPowerHashMap
=
new
HashMap
<>();
currentPowerHashMap
.
put
(
"title"
,
"实时有功 "
+
date
);
currentPowerHashMap
.
put
(
"title"
,
"实时有功 "
+
date
);
currentPowerHashMap
.
put
(
"yData"
,
currentPowerYdata
);
currentPowerHashMap
.
put
(
"yData"
,
currentPowerYdata
);
result
.
put
(
"currentPower"
,
currentPowerHashMap
);
result
.
put
(
"currentPower"
,
currentPowerHashMap
);
HashMap
<
String
,
Object
>
shortPowerHashMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
shortPowerHashMap
=
new
HashMap
<>();
shortPowerHashMap
.
put
(
"title"
,
"短期功率预测 "
+
date
);
shortPowerHashMap
.
put
(
"title"
,
"短期功率预测 "
+
date
);
shortPowerHashMap
.
put
(
"yData"
,
currentPowerYdata
);
shortPowerHashMap
.
put
(
"yData"
,
currentPowerYdata
);
result
.
put
(
"shortPower"
,
shortPowerHashMap
);
result
.
put
(
"shortPower"
,
shortPowerHashMap
);
HashMap
<
String
,
Object
>
superShortPowerHashMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
superShortPowerHashMap
=
new
HashMap
<>();
superShortPowerHashMap
.
put
(
"title"
,
"超短期功率预测 "
+
date
);
superShortPowerHashMap
.
put
(
"title"
,
"超短期功率预测 "
+
date
);
superShortPowerHashMap
.
put
(
"yData"
,
currentPowerYdata
);
superShortPowerHashMap
.
put
(
"yData"
,
currentPowerYdata
);
result
.
put
(
"superShortPower"
,
superShortPowerHashMap
);
result
.
put
(
"superShortPower"
,
superShortPowerHashMap
);
HashMap
<
String
,
Object
>
footerList
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
footerList
=
new
HashMap
<>();
String
currentMin
=
String
.
format
(
"%.2f"
,
currentPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
String
currentMin
=
String
.
format
(
"%.2f"
,
String
shortMin
=
String
.
format
(
"%.2f"
,
shortPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
currentPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
String
supreMin
=
String
.
format
(
"%.2f"
,
superPowerShortYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
String
shortMin
=
String
.
format
(
"%.2f"
,
List
<
String
>
gz
=
new
ArrayList
<>();
shortPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
List
<
String
>
sj1
=
new
ArrayList
<>();
String
supreMin
=
String
.
format
(
"%.2f"
,
gz
.
add
(
currentMin
);
superPowerShortYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
min
().
getAsDouble
());
sj1
.
add
(
xdata
.
get
(
currentPowerYdata
.
indexOf
(
currentMin
)));
List
<
String
>
gz
=
new
ArrayList
<>();
gz
.
add
(
shortMin
);
List
<
String
>
sj1
=
new
ArrayList
<>();
sj1
.
add
(
xdata
.
get
(
shortPowerYdata
.
indexOf
(
shortMin
)));
gz
.
add
(
currentMin
);
gz
.
add
(
supreMin
);
sj1
.
add
(
xdata
.
get
(
currentPowerYdata
.
indexOf
(
currentMin
)));
sj1
.
add
(
xdata
.
get
(
superPowerShortYdata
.
indexOf
(
supreMin
)));
gz
.
add
(
shortMin
);
sj1
.
add
(
xdata
.
get
(
shortPowerYdata
.
indexOf
(
shortMin
)));
String
currentMax
=
String
.
format
(
"%.2f"
,
currentPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
gz
.
add
(
supreMin
);
String
shortMax
=
String
.
format
(
"%.2f"
,
shortPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
sj1
.
add
(
xdata
.
get
(
superPowerShortYdata
.
indexOf
(
supreMin
)));
String
supreMax
=
String
.
format
(
"%.2f"
,
superPowerShortYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
List
<
String
>
zdz
=
new
ArrayList
<>();
String
currentMax
=
String
.
format
(
"%.2f"
,
List
<
String
>
sj2
=
new
ArrayList
<>();
currentPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
zdz
.
add
(
currentMax
);
String
shortMax
=
String
.
format
(
"%.2f"
,
zdz
.
add
(
shortMax
);
shortPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
zdz
.
add
(
supreMax
);
String
supreMax
=
String
.
format
(
"%.2f"
,
sj2
.
add
(
xdata
.
get
(
currentPowerYdata
.
indexOf
(
currentMax
)));
superPowerShortYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
max
().
getAsDouble
());
sj2
.
add
(
xdata
.
get
(
shortPowerYdata
.
indexOf
(
shortMax
)));
List
<
String
>
zdz
=
new
ArrayList
<>();
sj2
.
add
(
xdata
.
get
(
superPowerShortYdata
.
indexOf
(
supreMax
)));
List
<
String
>
sj2
=
new
ArrayList
<>();
String
currentAvg
=
currentPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
average
().
toString
();
zdz
.
add
(
currentMax
);
String
shortAvg
=
shortPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
average
().
toString
();
zdz
.
add
(
shortMax
);
String
supreAvg
=
superPowerShortYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
average
().
toString
();
zdz
.
add
(
supreMax
);
List
<
String
>
pjz
=
new
ArrayList
<>();
sj2
.
add
(
xdata
.
get
(
currentPowerYdata
.
indexOf
(
currentMax
)));
List
<
String
>
fjl
=
new
ArrayList
<>();
sj2
.
add
(
xdata
.
get
(
shortPowerYdata
.
indexOf
(
shortMax
)));
pjz
.
add
(
currentAvg
);
sj2
.
add
(
xdata
.
get
(
superPowerShortYdata
.
indexOf
(
supreMax
)));
pjz
.
add
(
shortAvg
);
String
currentAvg
=
currentPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
average
().
toString
();
pjz
.
add
(
supreAvg
);
String
shortAvg
=
shortPowerYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
average
().
toString
();
fjl
=
Arrays
.
asList
(
"0.68"
,
"0.89"
,
"0.56"
);
String
supreAvg
=
superPowerShortYdata
.
stream
().
mapToDouble
(
Double:
:
parseDouble
).
average
().
toString
();
List
<
String
>
pjz
=
new
ArrayList
<>();
footerList
.
put
(
"gz"
,
gz
);
List
<
String
>
fjl
=
new
ArrayList
<>();
footerList
.
put
(
"sj1"
,
sj1
);
pjz
.
add
(
currentAvg
);
footerList
.
put
(
"zdz"
,
zdz
);
pjz
.
add
(
shortAvg
);
footerList
.
put
(
"sj2"
,
sj2
);
pjz
.
add
(
supreAvg
);
footerList
.
put
(
"pjz"
,
pjz
);
fjl
=
Arrays
.
asList
(
"0.68"
,
"0.89"
,
"0.56"
);
footerList
.
put
(
"fjl"
,
fjl
);
result
.
put
(
"footerList"
,
footerList
);
footerList
.
put
(
"gz"
,
gz
);
return
result
;
footerList
.
put
(
"sj1"
,
sj1
);
}
footerList
.
put
(
"zdz"
,
zdz
);
footerList
.
put
(
"sj2"
,
sj2
);
public
Double
keepFourdecimalPlaces
(
Double
param
)
{
footerList
.
put
(
"pjz"
,
pjz
);
return
Double
.
valueOf
(
String
.
format
(
"%.4f"
,
param
));
footerList
.
put
(
"fjl"
,
fjl
);
}
result
.
put
(
"footerList"
,
footerList
);
return
result
;
public
Map
<
String
,
String
>
getGenPowerInfoForBuDun
(
String
areaCode
,
String
stationId
)
{
}
HashMap
<
String
,
String
>
returnResult
=
new
HashMap
<>();
returnResult
.
put
(
"monthCompleteRate"
,
"0.00%"
);
public
Double
keepFourdecimalPlaces
(
Double
param
)
{
returnResult
.
put
(
"monthValue"
,
"0.0000"
);
return
Double
.
valueOf
(
String
.
format
(
"%.4f"
,
param
));
returnResult
.
put
(
"monthPlanValue"
,
"0.0000"
);
}
returnResult
.
put
(
"yearCompleteRate"
,
"0.00%"
);
returnResult
.
put
(
"yearValue"
,
"0.0000"
);
public
Map
<
String
,
String
>
getGenPowerInfoForBuDun
(
String
areaCode
,
String
stationId
)
{
returnResult
.
put
(
"yearPlanValue"
,
"0.0000"
);
HashMap
<
String
,
String
>
returnResult
=
new
HashMap
<>();
returnResult
.
put
(
"monthCompleteRate"
,
"0.00%"
);
List
<
StationCacheInfoDto
>
stationCacheInfoDtos
=
commonServiceImpl
.
getListStationCacheInfoDto
();
returnResult
.
put
(
"monthValue"
,
"0.0000"
);
if
(
StringUtils
.
isNotBlank
(
areaCode
))
{
returnResult
.
put
(
"monthPlanValue"
,
"0.0000"
);
stationCacheInfoDtos
=
stationCacheInfoDtos
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getAreaCode
().
equals
(
areaCode
)).
collect
(
Collectors
.
toList
());
returnResult
.
put
(
"yearCompleteRate"
,
"0.00%"
);
}
returnResult
.
put
(
"yearValue"
,
"0.0000"
);
if
(
StringUtils
.
isNotBlank
(
stationId
))
{
returnResult
.
put
(
"yearPlanValue"
,
"0.0000"
);
stationCacheInfoDtos
=
stationCacheInfoDtos
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getStationId
().
equals
(
stationId
)).
collect
(
Collectors
.
toList
());
}
List
<
StationCacheInfoDto
>
stationCacheInfoDtos
=
commonServiceImpl
.
getListStationCacheInfoDto
();
//月发电量
if
(
StringUtils
.
isNotBlank
(
areaCode
))
{
AtomicReference
<
Double
>
monthlyPower
=
new
AtomicReference
<>(
0.0
);
stationCacheInfoDtos
=
stationCacheInfoDtos
.
stream
()
//年发电量
.
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getAreaCode
().
equals
(
areaCode
))
AtomicReference
<
Double
>
annualPower
=
new
AtomicReference
<>(
0.0
);
.
collect
(
Collectors
.
toList
());
for
(
StationCacheInfoDto
stationCacheInfoDto
:
stationCacheInfoDtos
)
{
}
if
(
StringUtils
.
isNotBlank
(
stationId
))
{
if
(
"FDZ"
.
equals
(
stationCacheInfoDto
.
getStationType
()))
{
stationCacheInfoDtos
=
stationCacheInfoDtos
.
stream
()
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
.
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getStationId
().
equals
(
stationId
))
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"月发电量"
,
"年发电量"
));
.
collect
(
Collectors
.
toList
());
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationCacheInfoDto
.
getFanGatewayId
()));
}
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
// 月发电量
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
AtomicReference
<
Double
>
monthlyPower
=
new
AtomicReference
<>(
0.0
);
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
// 年发电量
}
else
{
AtomicReference
<
Double
>
annualPower
=
new
AtomicReference
<>(
0.0
);
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
for
(
StationCacheInfoDto
stationCacheInfoDto
:
stationCacheInfoDtos
)
{
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
CommonConstans
.
taiHeGenIndicator
);
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationCacheInfoDto
.
getBoosterGatewayId
()));
if
(
"FDZ"
.
equals
(
stationCacheInfoDto
.
getStationType
()))
{
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
)));
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"月发电量"
,
"年发电量"
));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorYear
)));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
}
Arrays
.
asList
(
stationCacheInfoDto
.
getFanGatewayId
()));
}
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
List
<
String
>
stationIds
=
stationCacheInfoDtos
.
stream
().
map
(
StationCacheInfoDto:
:
getStationId
).
collect
(
Collectors
.
toList
());
ESEquipments
.
class
);
List
<
StationPlan
>
stationPlans
=
stationPlanMapper
.
selectList
(
new
QueryWrapper
<
StationPlan
>().
in
(
"station_basic_id"
,
stationIds
));
monthlyPower
.
updateAndGet
(
String
currentYearAndMonth
=
DateUtil
.
format
(
new
Date
(),
DatePattern
.
NORM_MONTH_PATTERN
);
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
String
currentYear
=
currentYearAndMonth
.
split
(
"-"
)[
0
];
annualPower
.
updateAndGet
(
Integer
currentMonth
=
Integer
.
valueOf
(
currentYearAndMonth
.
split
(
"-"
)[
1
]);
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
Double
yearPlanValue
=
stationPlans
.
stream
().
filter
(
stationPlan
->
stationPlan
.
getYear
().
equals
(
currentYear
)).
mapToDouble
(
i
->
i
.
getValue
()).
sum
();
}
else
{
Double
monthPlanValue
=
stationPlans
.
stream
().
filter
(
stationPlan
->
currentMonth
==
Integer
.
valueOf
(
stationPlan
.
getMonthly
())).
mapToDouble
(
i
->
i
.
getValue
()).
sum
();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
if
(
monthlyPower
.
get
()
>
0
&&
monthPlanValue
>
0
)
{
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
CommonConstans
.
taiHeGenIndicator
);
returnResult
.
put
(
"monthCompleteRate"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
monthlyPower
.
get
()
/
monthPlanValue
)
*
100
)
+
"%"
);
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
returnResult
.
put
(
"monthValue"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
monthlyPower
.
get
()));
Arrays
.
asList
(
stationCacheInfoDto
.
getBoosterGatewayId
()));
returnResult
.
put
(
"monthPlanValue"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
monthPlanValue
));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
}
ESEquipments
.
class
);
if
(
annualPower
.
get
()
>
0
&&
yearPlanValue
>
0
)
{
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
returnResult
.
put
(
"yearCompleteRate"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
annualPower
.
get
()
/
yearPlanValue
)
*
100
)
+
"%"
);
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
)));
returnResult
.
put
(
"yearValue"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
annualPower
.
get
()));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
returnResult
.
put
(
"yearPlanValue"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
yearPlanValue
));
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorYear
)));
}
}
return
returnResult
;
}
}
List
<
String
>
stationIds
=
stationCacheInfoDtos
.
stream
().
map
(
StationCacheInfoDto:
:
getStationId
)
.
collect
(
Collectors
.
toList
());
public
Map
<
String
,
Object
>
getGenPowerInfo
(
String
areaCode
)
{
List
<
StationPlan
>
stationPlans
=
stationPlanMapper
List
<
StationCacheInfoDto
>
stationCacheInfoDtos
=
commonServiceImpl
.
getListStationCacheInfoDto
();
.
selectList
(
new
QueryWrapper
<
StationPlan
>().
in
(
"station_basic_id"
,
stationIds
));
if
(
StringUtils
.
isNotBlank
(
areaCode
))
{
String
currentYearAndMonth
=
DateUtil
.
format
(
new
Date
(),
DatePattern
.
NORM_MONTH_PATTERN
);
MapRegion
mapRegion
=
mapRegionMapper
.
selectOne
(
new
QueryWrapper
<
MapRegion
>().
eq
(
"area_code"
,
areaCode
));
String
currentYear
=
currentYearAndMonth
.
split
(
"-"
)[
0
];
List
<
StationCacheInfoDto
>
filterData
=
stationCacheInfoDtos
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getAreaCode
().
equals
(
areaCode
)).
collect
(
Collectors
.
toList
());
Integer
currentMonth
=
Integer
.
valueOf
(
currentYearAndMonth
.
split
(
"-"
)[
1
]);
stationCacheInfoDtos
=
filterData
.
size
()
>
0
?
filterData
:
stationCacheInfoDtos
;
Double
yearPlanValue
=
stationPlans
.
stream
().
filter
(
stationPlan
->
stationPlan
.
getYear
().
equals
(
currentYear
))
if
(!
ObjectUtils
.
isEmpty
(
mapRegion
)){
.
mapToDouble
(
i
->
i
.
getValue
()).
sum
();
stationCacheInfoDtos
=
filterData
;
Double
monthPlanValue
=
stationPlans
.
stream
()
}
.
filter
(
stationPlan
->
currentMonth
==
Integer
.
valueOf
(
stationPlan
.
getMonthly
()))
}
.
mapToDouble
(
i
->
i
.
getValue
()).
sum
();
List
<
StationCacheInfoDto
>
fanStationList
=
stationCacheInfoDtos
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getStationType
().
equals
(
"FDZ"
)).
collect
(
Collectors
.
toList
());
if
(
monthlyPower
.
get
()
>
0
&&
monthPlanValue
>
0
)
{
List
<
StationCacheInfoDto
>
pvStationList
=
stationCacheInfoDtos
.
stream
().
filter
(
stationCacheInfoDto
->
!
stationCacheInfoDto
.
getStationType
().
equals
(
"FDZ"
)).
collect
(
Collectors
.
toList
());
returnResult
.
put
(
"monthCompleteRate"
,
Map
<
String
,
List
<
StationCacheInfoDto
>>
groupByProvince
=
stationCacheInfoDtos
.
stream
().
collect
(
Collectors
.
groupingBy
(
StationCacheInfoDto:
:
getBelongProvince
));
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
monthlyPower
.
get
()
/
monthPlanValue
)
*
100
)
+
"%"
);
HashMap
<
String
,
Object
>
returnResult
=
new
HashMap
<>();
returnResult
.
put
(
"monthValue"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
monthlyPower
.
get
()));
HashMap
<
String
,
Object
>
pv_interval
=
new
HashMap
<>();
returnResult
.
put
(
"monthPlanValue"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
monthPlanValue
));
HashMap
<
String
,
Object
>
fan_interval
=
new
HashMap
<>();
}
HashMap
<
String
,
Double
>
dayGenCache
=
new
HashMap
();
if
(
annualPower
.
get
()
>
0
&&
yearPlanValue
>
0
)
{
HashMap
<
String
,
Double
>
monthGenCache
=
new
HashMap
();
returnResult
.
put
(
"yearCompleteRate"
,
returnResult
.
put
(
"pv_station_count"
,
pvStationList
.
size
());
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
annualPower
.
get
()
/
yearPlanValue
)
*
100
)
+
"%"
);
returnResult
.
put
(
"fan_station_count"
,
fanStationList
.
size
());
returnResult
.
put
(
"yearValue"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
annualPower
.
get
()));
AtomicReference
<
Double
>
powerOfDayFD
=
new
AtomicReference
<>(
new
Double
(
0.00
));
returnResult
.
put
(
"yearPlanValue"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
yearPlanValue
));
AtomicReference
<
Double
>
powerOfMonthFD
=
new
AtomicReference
<>(
new
Double
(
0.00
));
}
AtomicReference
<
Double
>
powerOfDayGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
return
returnResult
;
AtomicReference
<
Double
>
powerOfMonthGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
}
AtomicReference
<
Double
>
planOfFD
=
new
AtomicReference
<>(
new
Double
(
0.00
));
AtomicReference
<
Double
>
planOfGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
public
Map
<
String
,
Object
>
getGenPowerInfo
(
String
areaCode
)
{
fanStationList
.
forEach
(
stationBasic
->
{
List
<
StationCacheInfoDto
>
stationCacheInfoDtos
=
commonServiceImpl
.
getListStationCacheInfoDto
();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
if
(
StringUtils
.
isNotBlank
(
areaCode
))
{
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
));
MapRegion
mapRegion
=
mapRegionMapper
.
selectOne
(
new
QueryWrapper
<
MapRegion
>().
eq
(
"area_code"
,
areaCode
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
List
<
StationCacheInfoDto
>
filterData
=
stationCacheInfoDtos
.
stream
()
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
.
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getAreaCode
().
equals
(
areaCode
))
powerOfDayFD
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
.
collect
(
Collectors
.
toList
());
powerOfMonthFD
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
stationCacheInfoDtos
=
filterData
.
size
()
>
0
?
filterData
:
stationCacheInfoDtos
;
dayGenCache
.
put
(
stationBasic
.
getStationId
(),
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
if
(!
ObjectUtils
.
isEmpty
(
mapRegion
))
{
monthGenCache
.
put
(
stationBasic
.
getStationId
(),
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
stationCacheInfoDtos
=
filterData
;
planOfFD
.
updateAndGet
(
v
->
v
+
getPlanGenByStationIdAndMonth
(
stationBasic
.
getStationId
()));
}
});
}
pvStationList
.
forEach
(
stationBasic
->
{
List
<
StationCacheInfoDto
>
fanStationList
=
stationCacheInfoDtos
.
stream
()
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
.
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getStationType
().
equals
(
"FDZ"
))
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
CommonConstans
.
taiHeGenIndicator
);
.
collect
(
Collectors
.
toList
());
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
List
<
StationCacheInfoDto
>
pvStationList
=
stationCacheInfoDtos
.
stream
()
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
.
filter
(
stationCacheInfoDto
->
!
stationCacheInfoDto
.
getStationType
().
equals
(
"FDZ"
))
powerOfDayGF
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorDay
));
.
collect
(
Collectors
.
toList
());
powerOfMonthGF
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
));
Map
<
String
,
List
<
StationCacheInfoDto
>>
groupByProvince
=
stationCacheInfoDtos
.
stream
()
dayGenCache
.
put
(
stationBasic
.
getStationId
(),
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorDay
)));
.
collect
(
Collectors
.
groupingBy
(
StationCacheInfoDto:
:
getBelongProvince
));
monthGenCache
.
put
(
stationBasic
.
getStationId
(),
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
)));
HashMap
<
String
,
Object
>
returnResult
=
new
HashMap
<>();
planOfGF
.
updateAndGet
(
v
->
v
+
getPlanGenByStationIdAndMonth
(
stationBasic
.
getStationId
()));
HashMap
<
String
,
Object
>
pv_interval
=
new
HashMap
<>();
});
HashMap
<
String
,
Object
>
fan_interval
=
new
HashMap
<>();
returnResult
.
put
(
"today_pv_power"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfDayGF
.
get
()));
HashMap
<
String
,
Double
>
dayGenCache
=
new
HashMap
();
returnResult
.
put
(
"today_fan_power"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfDayFD
.
get
()));
HashMap
<
String
,
Double
>
monthGenCache
=
new
HashMap
();
returnResult
.
put
(
"month_pv_power"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthGF
.
get
()));
returnResult
.
put
(
"pv_station_count"
,
pvStationList
.
size
());
returnResult
.
put
(
"month_fan_power"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthFD
.
get
()));
returnResult
.
put
(
"fan_station_count"
,
fanStationList
.
size
());
returnResult
.
put
(
"month_pv_quota_schedule"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfMonthGF
.
get
()
/
planOfGF
.
get
())
*
100
));
AtomicReference
<
Double
>
powerOfDayFD
=
new
AtomicReference
<>(
new
Double
(
0.00
));
if
(
returnResult
.
get
(
"month_pv_quota_schedule"
).
toString
().
equals
(
"NaN"
)){
AtomicReference
<
Double
>
powerOfMonthFD
=
new
AtomicReference
<>(
new
Double
(
0.00
));
returnResult
.
put
(
"month_pv_quota_schedule"
,
0.00f
);
AtomicReference
<
Double
>
powerOfDayGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
}
AtomicReference
<
Double
>
powerOfMonthGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
returnResult
.
put
(
"month_fan_quota_schedule"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfMonthFD
.
get
()
/
planOfFD
.
get
())
*
100
));
AtomicReference
<
Double
>
planOfFD
=
new
AtomicReference
<>(
new
Double
(
0.00
));
if
(
returnResult
.
get
(
"month_fan_quota_schedule"
).
toString
().
equals
(
"NaN"
)){
AtomicReference
<
Double
>
planOfGF
=
new
AtomicReference
<>(
new
Double
(
0.00
));
returnResult
.
put
(
"month_fan_quota_schedule"
,
0.00f
);
fanStationList
.
forEach
(
stationBasic
->
{
}
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
groupByProvince
.
keySet
().
forEach
(
s
->
{
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
));
HashMap
<
String
,
Object
>
fan
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
HashMap
<
String
,
Object
>
pv
=
new
HashMap
<>();
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
List
<
StationCacheInfoDto
>
list
=
groupByProvince
.
get
(
s
);
ESEquipments
.
class
);
List
<
String
>
fanStationIds
=
list
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getStationType
().
equals
(
"FDZ"
)).
collect
(
Collectors
.
toList
()).
stream
().
map
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getStationId
()).
collect
(
Collectors
.
toList
());
if
(
result
!=
null
)
{
List
<
String
>
pvStationIds
=
list
.
stream
().
filter
(
stationCacheInfoDto
->
!
stationCacheInfoDto
.
getStationType
().
equals
(
"FDZ"
)).
collect
(
Collectors
.
toList
()).
stream
().
map
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getStationId
()).
collect
(
Collectors
.
toList
());
powerOfDayFD
.
updateAndGet
(
fan
.
put
(
"station_count"
,
fanStationIds
.
size
());
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
pv
.
put
(
"station_count"
,
pvStationIds
.
size
());
powerOfMonthFD
.
updateAndGet
(
fan
.
put
(
"today_power"
,
getTotalPowerFromCache
(
fanStationIds
,
dayGenCache
));
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
pv
.
put
(
"today_power"
,
getTotalPowerFromCache
(
pvStationIds
,
dayGenCache
));
dayGenCache
.
put
(
stationBasic
.
getStationId
(),
fan
.
put
(
"month_power"
,
getTotalPowerFromCache
(
fanStationIds
,
monthGenCache
));
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
pv
.
put
(
"month_power"
,
getTotalPowerFromCache
(
pvStationIds
,
monthGenCache
));
monthGenCache
.
put
(
stationBasic
.
getStationId
(),
pv_interval
.
put
(
s
,
pv
);
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
fan_interval
.
put
(
s
,
fan
);
}
planOfFD
.
updateAndGet
(
v
->
v
+
getPlanGenByStationIdAndMonth
(
stationBasic
.
getStationId
()));
});
});
returnResult
.
put
(
"pv_interval"
,
pv_interval
);
pvStationList
.
forEach
(
stationBasic
->
{
returnResult
.
put
(
"fan_interval"
,
fan_interval
);
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
return
returnResult
;
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
CommonConstans
.
taiHeGenIndicator
);
}
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
public
Double
getPlanGenByStationIdAndMonth
(
String
stationId
)
{
ESEquipments
.
class
);
String
[]
dates
=
DateUtil
.
today
().
split
(
"-"
);
if
(
result
!=
null
)
{
return
stationPlanMapper
.
getPlanGenByStationIdAndMonth
(
stationId
,
dates
[
0
],
String
.
valueOf
(
Integer
.
valueOf
(
dates
[
1
])));
powerOfDayGF
.
updateAndGet
(
v
->
v
}
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorDay
));
powerOfMonthGF
.
updateAndGet
(
v
->
v
public
Double
getTotalPowerFromCache
(
List
<
String
>
keys
,
HashMap
<
String
,
Double
>
cache
)
{
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
));
AtomicReference
<
Double
>
result
=
new
AtomicReference
<>(
0.0
);
dayGenCache
.
put
(
stationBasic
.
getStationId
(),
keepFourdecimalPlaces
(
keys
.
forEach
(
s
->
{
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorDay
)));
result
.
set
(
result
.
get
()
+
cache
.
get
(
s
));
monthGenCache
.
put
(
stationBasic
.
getStationId
(),
keepFourdecimalPlaces
(
});
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
)));
return
keepFourdecimalPlaces
(
result
.
get
());
}
}
planOfGF
.
updateAndGet
(
v
->
v
+
getPlanGenByStationIdAndMonth
(
stationBasic
.
getStationId
()));
});
returnResult
.
put
(
"today_pv_power"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfDayGF
.
get
()));
returnResult
.
put
(
"today_fan_power"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfDayFD
.
get
()));
returnResult
.
put
(
"month_pv_power"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthGF
.
get
()));
returnResult
.
put
(
"month_fan_power"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfMonthFD
.
get
()));
returnResult
.
put
(
"month_pv_quota_schedule"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfMonthGF
.
get
()
/
planOfGF
.
get
())
*
100
));
if
(
returnResult
.
get
(
"month_pv_quota_schedule"
).
toString
().
equals
(
"NaN"
))
{
returnResult
.
put
(
"month_pv_quota_schedule"
,
0.00f
);
}
returnResult
.
put
(
"month_fan_quota_schedule"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfMonthFD
.
get
()
/
planOfFD
.
get
())
*
100
));
if
(
returnResult
.
get
(
"month_fan_quota_schedule"
).
toString
().
equals
(
"NaN"
))
{
returnResult
.
put
(
"month_fan_quota_schedule"
,
0.00f
);
}
groupByProvince
.
keySet
().
forEach
(
s
->
{
HashMap
<
String
,
Object
>
fan
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
pv
=
new
HashMap
<>();
List
<
StationCacheInfoDto
>
list
=
groupByProvince
.
get
(
s
);
List
<
String
>
fanStationIds
=
list
.
stream
()
.
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getStationType
().
equals
(
"FDZ"
))
.
collect
(
Collectors
.
toList
()).
stream
()
.
map
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getStationId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
pvStationIds
=
list
.
stream
()
.
filter
(
stationCacheInfoDto
->
!
stationCacheInfoDto
.
getStationType
().
equals
(
"FDZ"
))
.
collect
(
Collectors
.
toList
()).
stream
()
.
map
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getStationId
()).
collect
(
Collectors
.
toList
());
fan
.
put
(
"station_count"
,
fanStationIds
.
size
());
pv
.
put
(
"station_count"
,
pvStationIds
.
size
());
fan
.
put
(
"today_power"
,
getTotalPowerFromCache
(
fanStationIds
,
dayGenCache
));
pv
.
put
(
"today_power"
,
getTotalPowerFromCache
(
pvStationIds
,
dayGenCache
));
fan
.
put
(
"month_power"
,
getTotalPowerFromCache
(
fanStationIds
,
monthGenCache
));
pv
.
put
(
"month_power"
,
getTotalPowerFromCache
(
pvStationIds
,
monthGenCache
));
pv_interval
.
put
(
s
,
pv
);
fan_interval
.
put
(
s
,
fan
);
});
returnResult
.
put
(
"pv_interval"
,
pv_interval
);
returnResult
.
put
(
"fan_interval"
,
fan_interval
);
return
returnResult
;
}
public
Double
getPlanGenByStationIdAndMonth
(
String
stationId
)
{
String
[]
dates
=
DateUtil
.
today
().
split
(
"-"
);
Double
plan
=
stationPlanMapper
.
getPlanGenByStationIdAndMonth
(
stationId
,
dates
[
0
],
String
.
valueOf
(
Integer
.
valueOf
(
dates
[
1
])));
if
(
plan
==
null
)
{
plan
=
0.0
;
}
return
plan
;
}
public
Double
getTotalPowerFromCache
(
List
<
String
>
keys
,
HashMap
<
String
,
Double
>
cache
)
{
AtomicReference
<
Double
>
result
=
new
AtomicReference
<>(
0.0
);
if
(
keys
!=
null
&&
!
keys
.
isEmpty
()
&&
cache
!=
null
&&
!
cache
.
isEmpty
())
{
keys
.
forEach
(
s
->
{
if
(
cache
.
get
(
s
)!=
null
)
{
result
.
set
(
result
.
get
()
+
cache
.
get
(
s
));
}
});
}
return
keepFourdecimalPlaces
(
result
.
get
());
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
f8c02037
...
@@ -567,7 +567,10 @@ public class CommonServiceImpl {
...
@@ -567,7 +567,10 @@ public class CommonServiceImpl {
public
Double
getSumByEquipmentIndxName
(
List
<
ESEquipments
>
equipments
,
String
indexName
)
{
public
Double
getSumByEquipmentIndxName
(
List
<
ESEquipments
>
equipments
,
String
indexName
)
{
Double
result
=
0.00
;
Double
result
=
0.00
;
result
=
equipments
.
stream
().
filter
(
esEquipments
->
esEquipments
.
getEquipmentIndexName
().
equals
(
indexName
)).
filter
(
esEquipments
->
esEquipments
.
getValueF
()
!=
null
).
mapToDouble
(
ESEquipments:
:
getValueF
).
sum
();
if
(
equipments
!=
null
)
{
result
=
equipments
.
stream
().
filter
(
esEquipments
->
esEquipments
.
getEquipmentIndexName
().
equals
(
indexName
)).
filter
(
esEquipments
->
esEquipments
.
getValueF
()
!=
null
).
mapToDouble
(
ESEquipments:
:
getValueF
).
sum
();
}
return
result
;
return
result
;
}
}
...
...
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 @
f8c02037
...
@@ -149,7 +149,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -149,7 +149,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
private
EquipmentSpecificIndexMapper
equipmentSpecificIndexMapper
;
private
EquipmentSpecificIndexMapper
equipmentSpecificIndexMapper
;
@Autowired
@Autowired
private
UserEmpowerMapper
userEmpowerMapper
;
private
UserEmpowerMapper
userEmpowerMapper
;
public
ResultsData
getNationWideInfo
(
int
current
,
int
size
,
String
gateway
,
String
equipmentNumber
)
{
public
ResultsData
getNationWideInfo
(
int
current
,
int
size
,
String
gateway
,
String
equipmentNumber
)
{
String
table
=
gateway
;
String
table
=
gateway
;
Map
<
String
,
List
<
String
>>
queryCodntion
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCodntion
=
new
HashMap
<>();
...
@@ -301,14 +301,15 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -301,14 +301,15 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public
TreeDto
getTreeInfo
(
String
sequenceNbr
,
ReginParams
reginParams
)
{
public
TreeDto
getTreeInfo
(
String
sequenceNbr
,
ReginParams
reginParams
)
{
String
userId
=
reginParams
.
getUserModel
().
getUserId
();
String
userId
=
reginParams
.
getUserModel
().
getUserId
();
String
companyLevel
=
""
;
String
companyLevel
=
""
;
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>().
eq
(
"amos_user_id"
,
userId
).
eq
(
"permission_type"
,
"YTH"
));
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>().
eq
(
"amos_user_id"
,
userId
).
eq
(
"permission_type"
,
"YTH"
));
if
(
ObjectUtils
.
isEmpty
(
stdUserEmpower
))
{
if
(
ObjectUtils
.
isEmpty
(
stdUserEmpower
))
{
// throw new BadRequest("您当前未配置数据权限!");
// throw new BadRequest("您当前未配置数据权限!");
}
else
{
}
else
{
String
permissionOrgCode
=
stdUserEmpower
.
getAmosOrgCode
().
get
(
0
);
String
permissionOrgCode
=
stdUserEmpower
.
getAmosOrgCode
().
get
(
0
);
Map
<
String
,
String
>
companyInfo
=
userEmpowerMapper
.
getCompanyInfoByOrgCode
(
permissionOrgCode
);
Map
<
String
,
String
>
companyInfo
=
userEmpowerMapper
.
getCompanyInfoByOrgCode
(
permissionOrgCode
);
companyLevel
=
companyInfo
.
get
(
"level"
).
toString
();
companyLevel
=
companyInfo
.
get
(
"level"
).
toString
();
}
}
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
sequenceNbr
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
sequenceNbr
);
List
<
Integer
>
integers
=
JSON
.
parseArray
(
stationBasic
.
getBelongArea
(),
Integer
.
class
);
List
<
Integer
>
integers
=
JSON
.
parseArray
(
stationBasic
.
getBelongArea
(),
Integer
.
class
);
...
@@ -350,11 +351,12 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -350,11 +351,12 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
gfzTreeDto
.
setChildren
(
gfz
);
gfzTreeDto
.
setChildren
(
gfz
);
List
<
TreeDto
>
treeDtos
=
Arrays
.
asList
(
fdzTreeDto
,
gfzTreeDto
);
List
<
TreeDto
>
treeDtos
=
Arrays
.
asList
(
fdzTreeDto
,
gfzTreeDto
);
treeDto
.
setChildren
(
treeDtos
);
treeDto
.
setChildren
(
treeDtos
);
if
(
companyLevel
.
equals
(
"station"
)){
if
(
companyLevel
.
equals
(
"station"
))
{
List
<
TreeDto
>
children
=
stationListByRegionCode
.
stream
().
filter
(
t
->
t
.
getCode
().
equals
(
sequenceNbr
)).
collect
(
Collectors
.
toList
());
List
<
TreeDto
>
children
=
stationListByRegionCode
.
stream
().
filter
(
t
->
t
.
getCode
().
equals
(
sequenceNbr
))
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
)){
.
collect
(
Collectors
.
toList
());
treeDto
=
fdzTreeDto
;
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
))
{
}
else
{
treeDto
=
fdzTreeDto
;
}
else
{
treeDto
=
gfzTreeDto
;
treeDto
=
gfzTreeDto
;
}
}
treeDto
.
setChildren
(
children
);
treeDto
.
setChildren
(
children
);
...
@@ -372,8 +374,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -372,8 +374,8 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return
new
ArrayList
<
ESEquipmentsDTO
>();
return
new
ArrayList
<
ESEquipmentsDTO
>();
}
}
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"风机状态"
,
"有功功率"
,
"发电状态"
,
"报警状态"
,
Arrays
.
asList
(
"风机状态"
,
"有功功率"
,
"发电状态"
,
"报警状态"
,
"停机状态"
,
"故障状态"
,
"待机状态"
,
"维护状态"
,
"发电机转速"
,
"正常发电状态"
,
"30秒平均风速"
));
"停机状态"
,
"故障状态"
,
"待机状态"
,
"维护状态"
,
"发电机转速"
,
"正常发电状态"
,
"30秒平均风速"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
Map
<
String
,
List
<
String
>>
queryCondtion1
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion1
=
new
HashMap
<>();
...
@@ -2398,6 +2400,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -2398,6 +2400,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
@Override
@Override
public
Map
<
String
,
Object
>
partofWaring3D
(
String
stationId
,
String
equipNum
)
{
public
Map
<
String
,
Object
>
partofWaring3D
(
String
stationId
,
String
equipNum
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
if
(
stationId
==
null
||
equipNum
==
null
||
"null"
.
equals
(
stationId
)
||
"equipNum"
.
equals
(
equipNum
))
{
return
resultMap
;
}
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceImpl.java
View file @
f8c02037
...
@@ -893,7 +893,14 @@ public class MonitoringServiceImpl {
...
@@ -893,7 +893,14 @@ public class MonitoringServiceImpl {
total
.
set
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
));
total
.
set
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
));
}
}
}
}
stationCacheInfoDto
.
setAddress
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
total
.
get
())
*
100
/
getPlanGenByStationIdAndMonth
(
stationCacheInfoDto
.
getStationId
())));
Double
PlanGen
=
getPlanGenByStationIdAndMonth
(
stationCacheInfoDto
.
getStationId
());
if
(
PlanGen
!=
null
)
{
stationCacheInfoDto
.
setAddress
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
total
.
get
())
*
100
/
PlanGen
));
}
else
{
stationCacheInfoDto
.
setAddress
(
"0.0"
);
}
});
});
List
<
StationCacheInfoDto
>
sorted
=
stationCacheInfoDtoList
.
stream
().
sorted
(
Comparator
.
comparing
(
StationCacheInfoDto:
:
getAddress
,
Comparator
.
comparingDouble
(
Double:
:
parseDouble
)).
reversed
()).
collect
(
Collectors
.
toList
());
List
<
StationCacheInfoDto
>
sorted
=
stationCacheInfoDtoList
.
stream
().
sorted
(
Comparator
.
comparing
(
StationCacheInfoDto:
:
getAddress
,
Comparator
.
comparingDouble
(
Double:
:
parseDouble
)).
reversed
()).
collect
(
Collectors
.
toList
());
sorted
.
forEach
(
stationBasic
->
{
sorted
.
forEach
(
stationBasic
->
{
...
...
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