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
c7aa0810
Commit
c7aa0810
authored
Oct 07, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改发电完成率
parent
0916e647
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
39 deletions
+39
-39
MonitoringServiceIMQTTmpl.java
...ule/jxiop/biz/service/impl/MonitoringServiceIMQTTmpl.java
+16
-21
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+23
-18
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceIMQTTmpl.java
View file @
c7aa0810
...
@@ -40,7 +40,6 @@ import java.util.stream.Collectors;
...
@@ -40,7 +40,6 @@ import java.util.stream.Collectors;
@Async
@Async
@Service
@Service
public
class
MonitoringServiceIMQTTmpl
{
public
class
MonitoringServiceIMQTTmpl
{
Logger
logger
=
LoggerFactory
.
getLogger
(
MonitoringServiceIMQTTmpl
.
class
);
//社会贡献Cron表达式
//社会贡献Cron表达式
private
final
String
totalSocialContributionCron
=
"0 0/1 * * * *"
;
private
final
String
totalSocialContributionCron
=
"0 0/1 * * * *"
;
//区域完成情况 Cron表达式
//区域完成情况 Cron表达式
...
@@ -55,9 +54,7 @@ public class MonitoringServiceIMQTTmpl {
...
@@ -55,9 +54,7 @@ public class MonitoringServiceIMQTTmpl {
private
final
String
fanStatusListCron
=
"0/30 * * * * *"
;
private
final
String
fanStatusListCron
=
"0/30 * * * * *"
;
//风机实时数据Cron表达式
//风机实时数据Cron表达式
private
final
String
fanCurrentDataCron
=
"0 0/1 * * * *"
;
private
final
String
fanCurrentDataCron
=
"0 0/1 * * * *"
;
@Value
(
"${fan.statuts.stattuspath}"
)
Logger
logger
=
LoggerFactory
.
getLogger
(
MonitoringServiceIMQTTmpl
.
class
);
private
String
fanStatusImagePathPrefix
;
@Autowired
@Autowired
StationPlanMapper
stationPlanMapper
;
StationPlanMapper
stationPlanMapper
;
/**
/**
...
@@ -65,7 +62,6 @@ public class MonitoringServiceIMQTTmpl {
...
@@ -65,7 +62,6 @@ public class MonitoringServiceIMQTTmpl {
*/
*/
@Autowired
@Autowired
StationBasicMapper
stationBasicMapper
;
StationBasicMapper
stationBasicMapper
;
@Autowired
@Autowired
CommonServiceImpl
commonServiceImpl
;
CommonServiceImpl
commonServiceImpl
;
@Autowired
@Autowired
...
@@ -74,13 +70,14 @@ public class MonitoringServiceIMQTTmpl {
...
@@ -74,13 +70,14 @@ public class MonitoringServiceIMQTTmpl {
EmqKeeper
emqKeeper
;
EmqKeeper
emqKeeper
;
@Autowired
@Autowired
MonitorFanIndicatorImpl
monitorFanIndicator
;
MonitorFanIndicatorImpl
monitorFanIndicator
;
@Autowired
@Autowired
CommonServiceImpl
commonService
;
CommonServiceImpl
commonService
;
@Autowired
@Autowired
InfluxDButils
influxDButils
;
InfluxDButils
influxDButils
;
@Autowired
@Autowired
MonitoringServiceImpl
monitoringServiceImpl
;
MonitoringServiceImpl
monitoringServiceImpl
;
@Value
(
"${fan.statuts.stattuspath}"
)
private
String
fanStatusImagePathPrefix
;
@Autowired
@Autowired
private
MonitorFanIndicatorMapper
monitorFanIndicatorregionMapper
;
private
MonitorFanIndicatorMapper
monitorFanIndicatorregionMapper
;
...
@@ -99,16 +96,16 @@ public class MonitoringServiceIMQTTmpl {
...
@@ -99,16 +96,16 @@ public class MonitoringServiceIMQTTmpl {
stationBasicList
.
forEach
(
stationBasic
->
{
stationBasicList
.
forEach
(
stationBasic
->
{
if
(
"FDZ"
.
equals
(
stationBasic
.
getStationType
()))
{
if
(
"FDZ"
.
equals
(
stationBasic
.
getStationType
()))
{
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
()));
totalSocialContribution
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"年发电量"
));
totalSocialContribution
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"年发电量"
));
}
else
{
}
else
{
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
()));
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
totalSocialContribution
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
);
totalSocialContribution
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
);
}
}
});
});
...
@@ -124,7 +121,7 @@ public class MonitoringServiceIMQTTmpl {
...
@@ -124,7 +121,7 @@ public class MonitoringServiceIMQTTmpl {
/**
/**
* 区域实时数据消息推送-30s一次
* 区域实时数据消息推送-30s一次
*/
*/
//
@Scheduled(cron = completionOfPowerIndicatorsByProvinceNameCron)
@Scheduled
(
cron
=
completionOfPowerIndicatorsByProvinceNameCron
)
public
void
getCompletionOfPowerIndicatorsByProvinceName
()
{
public
void
getCompletionOfPowerIndicatorsByProvinceName
()
{
Page
<
SocialContributionDto
>
socialContributionDtoPage
=
new
Page
<
SocialContributionDto
>();
Page
<
SocialContributionDto
>
socialContributionDtoPage
=
new
Page
<
SocialContributionDto
>();
logger
.
error
(
"--------------------------区域实时数据消息开始发送----------------------------------------------"
);
logger
.
error
(
"--------------------------区域实时数据消息开始发送----------------------------------------------"
);
...
@@ -134,8 +131,8 @@ public class MonitoringServiceIMQTTmpl {
...
@@ -134,8 +131,8 @@ public class MonitoringServiceIMQTTmpl {
int
year
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
);
int
year
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
);
List
<
Long
>
fdz
=
stationBasicList
.
stream
().
map
(
StationBasic:
:
getSequenceNbr
).
collect
(
Collectors
.
toList
());
List
<
Long
>
fdz
=
stationBasicList
.
stream
().
map
(
StationBasic:
:
getSequenceNbr
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
StationPlan
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
StationPlan
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
StationPlan:
:
getYear
,
String
.
valueOf
(
year
));
queryWrapper
.
eq
(
StationPlan:
:
getYear
,
String
.
valueOf
(
year
));
queryWrapper
.
in
(
StationPlan:
:
getStationBasicId
,
fdz
);
queryWrapper
.
in
(
StationPlan:
:
getStationBasicId
,
fdz
);
List
<
StationPlan
>
fdzPlans
=
stationPlanMapper
.
selectList
(
queryWrapper
);
List
<
StationPlan
>
fdzPlans
=
stationPlanMapper
.
selectList
(
queryWrapper
);
double
value
=
fdzPlans
.
stream
().
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
double
value
=
fdzPlans
.
stream
().
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
...
@@ -153,23 +150,22 @@ public class MonitoringServiceIMQTTmpl {
...
@@ -153,23 +150,22 @@ public class MonitoringServiceIMQTTmpl {
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
);
dailyPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
dailyPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
monthlyPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
monthlyPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
annualPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
annualPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
}
else
{
}
else
{
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
()));
Map
<
String
,
String
>
likeQuerCondtion
=
new
HashMap
<>();
Map
<
String
,
String
>
likeQuerCondtion
=
new
HashMap
<>();
likeQuerCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
likeQuerCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeQuerCondtion
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeQuerCondtion
);
dailyPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
dailyPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
monthlyPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
monthlyPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
annualPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)*
CommonConstans
.
pvGenPoweActor
));
annualPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
}
}
});
});
String
completionRatio
=
String
.
format
(
"%.2f"
,
annualPower
.
get
()
/
value
);
String
completionRatio
=
String
.
format
(
"%.2f"
,
(
annualPower
.
get
()
*
100
)
/
value
);
SocialContributionDto
dailyPowerdto
=
new
SocialContributionDto
();
SocialContributionDto
dailyPowerdto
=
new
SocialContributionDto
();
dailyPowerdto
.
setTitle
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
dailyPower
.
get
()));
dailyPowerdto
.
setTitle
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
dailyPower
.
get
()));
dailyPowerdto
.
setUnit
(
"万kWh"
);
dailyPowerdto
.
setUnit
(
"万kWh"
);
...
@@ -329,7 +325,6 @@ public class MonitoringServiceIMQTTmpl {
...
@@ -329,7 +325,6 @@ public class MonitoringServiceIMQTTmpl {
// }
// }
// });
// });
// }
// }
@Scheduled
(
cron
=
fanCurrentDataCron
)
@Scheduled
(
cron
=
fanCurrentDataCron
)
public
void
getFanCurrentData
()
{
public
void
getFanCurrentData
()
{
Integer
current
=
1
;
Integer
current
=
1
;
...
...
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 @
c7aa0810
...
@@ -268,6 +268,14 @@ public class MonitoringServiceImpl {
...
@@ -268,6 +268,14 @@ public class MonitoringServiceImpl {
//年发电量完成比例
//年发电量完成比例
String
completionRatio
=
"0.00"
;
String
completionRatio
=
"0.00"
;
//年利用小时数
//年利用小时数
int
year
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
);
List
<
String
>
fdz
=
stationBasicList
.
stream
().
map
(
StationCacheInfoDto:
:
getStationId
).
collect
(
Collectors
.
toList
());
LambdaQueryWrapper
<
StationPlan
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
StationPlan:
:
getYear
,
String
.
valueOf
(
year
));
queryWrapper
.
in
(
StationPlan:
:
getStationBasicId
,
fdz
);
List
<
StationPlan
>
fdzPlans
=
stationPlanMapper
.
selectList
(
queryWrapper
);
double
value
=
fdzPlans
.
stream
().
mapToDouble
(
StationPlan:
:
getValue
).
sum
();
AtomicReference
<
Double
>
useHours
=
new
AtomicReference
<>(
0.0
);
AtomicReference
<
Double
>
useHours
=
new
AtomicReference
<>(
0.0
);
AtomicReference
<
Double
>
installCapacity
=
new
AtomicReference
<>(
0.0
);
AtomicReference
<
Double
>
installCapacity
=
new
AtomicReference
<>(
0.0
);
stationBasicList
.
forEach
(
stationCacheInfoDto
->
{
stationBasicList
.
forEach
(
stationCacheInfoDto
->
{
...
@@ -288,13 +296,14 @@ public class MonitoringServiceImpl {
...
@@ -288,13 +296,14 @@ public class MonitoringServiceImpl {
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationCacheInfoDto
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationCacheInfoDto
.
getFanGatewayId
()));
Map
<
String
,
String
>
likeQuerCondtion
=
new
HashMap
<>();
Map
<
String
,
String
>
likeQuerCondtion
=
new
HashMap
<>();
likeQuerCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
likeQuerCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeQuerCondtion
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeQuerCondtion
);
dailyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
dailyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
}
}
installCapacity
.
updateAndGet
(
v
->
v
+
Double
.
parseDouble
(
stationCacheInfoDto
.
getInstalledCapacity
()));
installCapacity
.
updateAndGet
(
v
->
v
+
Double
.
parseDouble
(
stationCacheInfoDto
.
getInstalledCapacity
()));
});
});
completionRatio
=
String
.
format
(
"%.2f"
,(
annualPower
.
get
()*
100
)
/
value
);
SocialContributionDto
dailyPowerdto
=
new
SocialContributionDto
();
SocialContributionDto
dailyPowerdto
=
new
SocialContributionDto
();
dailyPowerdto
.
setTitle
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
dailyPower
.
get
()));
dailyPowerdto
.
setTitle
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
dailyPower
.
get
()));
dailyPowerdto
.
setUnit
(
"万kWh"
);
dailyPowerdto
.
setUnit
(
"万kWh"
);
...
@@ -305,11 +314,7 @@ public class MonitoringServiceImpl {
...
@@ -305,11 +314,7 @@ public class MonitoringServiceImpl {
annualPowerdto
.
setTitle
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
annualPower
.
get
()));
annualPowerdto
.
setTitle
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
annualPower
.
get
()));
annualPowerdto
.
setUnit
(
"万kWh"
);
annualPowerdto
.
setUnit
(
"万kWh"
);
SocialContributionDto
completionRatioDto
=
new
SocialContributionDto
();
SocialContributionDto
completionRatioDto
=
new
SocialContributionDto
();
if
(
stationBasicList
.
size
()
>
0
)
{
completionRatioDto
.
setTitle
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
23.21
+
Math
.
random
()
*
10
));
}
else
{
completionRatioDto
.
setTitle
(
completionRatio
);
completionRatioDto
.
setTitle
(
completionRatio
);
}
completionRatioDto
.
setUnit
(
"%"
);
completionRatioDto
.
setUnit
(
"%"
);
SocialContributionDto
useHoursDto
=
new
SocialContributionDto
();
SocialContributionDto
useHoursDto
=
new
SocialContributionDto
();
useHoursDto
.
setTitle
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
annualPower
.
get
()
/
installCapacity
.
get
()));
useHoursDto
.
setTitle
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
annualPower
.
get
()
/
installCapacity
.
get
()));
...
@@ -447,7 +452,7 @@ public class MonitoringServiceImpl {
...
@@ -447,7 +452,7 @@ public class MonitoringServiceImpl {
Map
<
String
,
List
<
String
>>
queryCondtion1
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion1
=
new
HashMap
<>();
queryCondtion1
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"WTX-801_25_WTX-801_总辐射"
));
queryCondtion1
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"WTX-801_25_WTX-801_总辐射"
));
queryCondtion1
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
queryCondtion1
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getBoosterGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
List
<
ESEquipments
>
result1
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion1
,
null
,
ESEquipments
.
class
);
List
<
ESEquipments
>
result1
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion1
,
null
,
ESEquipments
.
class
);
homeMapStationInfoDto
.
setSpeendOrirradiate
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"WTX-801_25_WTX-801_总辐射"
)));
homeMapStationInfoDto
.
setSpeendOrirradiate
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"WTX-801_25_WTX-801_总辐射"
)));
homeMapStationInfoDto
.
setCurrentPower
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"有功功率"
)));
homeMapStationInfoDto
.
setCurrentPower
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"有功功率"
)));
...
@@ -495,8 +500,8 @@ public class MonitoringServiceImpl {
...
@@ -495,8 +500,8 @@ public class MonitoringServiceImpl {
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
total
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
total
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -533,7 +538,7 @@ public class MonitoringServiceImpl {
...
@@ -533,7 +538,7 @@ public class MonitoringServiceImpl {
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
total1
=
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
;
total1
=
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
;
}
else
{
}
else
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
...
@@ -567,7 +572,7 @@ public class MonitoringServiceImpl {
...
@@ -567,7 +572,7 @@ public class MonitoringServiceImpl {
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
total
=
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
;
total
=
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
;
}
else
{
}
else
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
...
@@ -612,7 +617,7 @@ public class MonitoringServiceImpl {
...
@@ -612,7 +617,7 @@ public class MonitoringServiceImpl {
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
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
,
shouldQueryCondtion
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
dailyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
dailyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
...
@@ -668,7 +673,7 @@ public class MonitoringServiceImpl {
...
@@ -668,7 +673,7 @@ public class MonitoringServiceImpl {
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
total
=
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
;
total
=
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
;
}
else
{
}
else
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
...
@@ -712,7 +717,7 @@ public class MonitoringServiceImpl {
...
@@ -712,7 +717,7 @@ public class MonitoringServiceImpl {
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
total
.
set
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
);
total
.
set
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
);
}
else
{
}
else
{
...
@@ -779,8 +784,8 @@ public class MonitoringServiceImpl {
...
@@ -779,8 +784,8 @@ public class MonitoringServiceImpl {
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
total
=
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
;
total
=
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
;
}
else
{
}
else
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
finalIndicator
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
finalIndicator
));
...
@@ -925,7 +930,7 @@ public class MonitoringServiceImpl {
...
@@ -925,7 +930,7 @@ public class MonitoringServiceImpl {
stringHashMap6
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
)
+
"/"
+
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualGF
*
CommonConstans
.
pvGenPoweActor
));
stringHashMap6
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
)
+
"/"
+
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualGF
*
CommonConstans
.
pvGenPoweActor
));
list1
.
add
(
stringHashMap6
);
list1
.
add
(
stringHashMap6
);
HashMap
<
String
,
String
>
stringHashMap7
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap7
=
new
HashMap
<>();
stringHashMap7
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualFD
/
fdzValue
)
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
powerOfAnnualGF
*
CommonConstans
.
pvGenPoweActor
/
gfvalue
));
stringHashMap7
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualFD
*
100
)
/
fdzValue
)
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualGF
*
CommonConstans
.
pvGenPoweActor
*
100
)
/
gfvalue
));
list1
.
add
(
stringHashMap7
);
list1
.
add
(
stringHashMap7
);
HashMap
<
String
,
String
>
stringHashMap8
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap8
=
new
HashMap
<>();
stringHashMap8
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualFD
*
CommonConstans
.
wkwhToMv
)
/
fdzInstall
.
doubleValue
())
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualGF
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
wkwhToMv
)
/
gfInstall
.
doubleValue
()));
stringHashMap8
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualFD
*
CommonConstans
.
wkwhToMv
)
/
fdzInstall
.
doubleValue
())
+
"/"
+
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
powerOfAnnualGF
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
wkwhToMv
)
/
gfInstall
.
doubleValue
()));
...
@@ -941,7 +946,7 @@ public class MonitoringServiceImpl {
...
@@ -941,7 +946,7 @@ public class MonitoringServiceImpl {
stringHashMap11
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
+
powerOfAnnualGF
*
CommonConstans
.
pvGenPoweActor
));
stringHashMap11
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
powerOfAnnualFD
+
powerOfAnnualGF
*
CommonConstans
.
pvGenPoweActor
));
list2
.
add
(
stringHashMap11
);
list2
.
add
(
stringHashMap11
);
HashMap
<
String
,
String
>
stringHashMap12
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap12
=
new
HashMap
<>();
stringHashMap12
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
(
powerOfAnnualFD
+
powerOfAnnualGF
*
CommonConstans
.
pvGenPoweActor
)
/
yearValue
));
stringHashMap12
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
((
powerOfAnnualFD
+
powerOfAnnualGF
*
CommonConstans
.
pvGenPoweActor
)
*
100
)
/
yearValue
));
list2
.
add
(
stringHashMap12
);
list2
.
add
(
stringHashMap12
);
page2
.
setRecords
(
list2
);
page2
.
setRecords
(
list2
);
Double
totalAnnual
=
(
powerOfAnnualFD
+
powerOfAnnualGF
*
CommonConstans
.
pvGenPoweActor
);
Double
totalAnnual
=
(
powerOfAnnualFD
+
powerOfAnnualGF
*
CommonConstans
.
pvGenPoweActor
);
...
@@ -1188,7 +1193,7 @@ public class MonitoringServiceImpl {
...
@@ -1188,7 +1193,7 @@ public class MonitoringServiceImpl {
total
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
esEquipmentsList
,
"有功功率"
));
total
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
esEquipmentsList
,
"有功功率"
));
});
});
//有功功率换算
//有功功率换算
hashMap
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
total
.
get
()
/
1000
));
hashMap
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
total
.
get
()
/
1000
));
return
hashMap
;
return
hashMap
;
}
}
...
...
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