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
49d49c6b
Commit
49d49c6b
authored
Oct 07, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日月年电量
parent
e356549e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
64 deletions
+1
-64
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+1
-1
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+0
-63
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/CommonServiceImpl.java
View file @
49d49c6b
...
@@ -319,7 +319,7 @@ public class CommonServiceImpl {
...
@@ -319,7 +319,7 @@ 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
)).
mapToDouble
(
ESEquipments:
:
getValueF
).
sum
();
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-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceImpl.java
View file @
49d49c6b
...
@@ -939,69 +939,6 @@ public class MonitoringServiceImpl {
...
@@ -939,69 +939,6 @@ public class MonitoringServiceImpl {
}
}
}
}
@Autowired
MonitoringServiceImpl
monitoringServiceImpl
;
/**
* 数据消息推送-30s一次
*/
@Scheduled
(
cron
=
"0/30 * * * * *"
)
public
void
getCompletionOfPowerIndicatorsByProvinceName1007
()
{
Page
<
SocialContributionDto
>
socialContributionDtoPage
=
new
Page
<
SocialContributionDto
>();
logger
.
error
(
"--------------------------区域实时数据消息开始发送----------------------------------------------"
);
List
<
SocialContributionDto
>
socialContributionDtoList
=
new
ArrayList
<>();
Region
region
=
this
.
regionMapper
.
selectOne
(
new
QueryWrapper
<
Region
>().
eq
(
"level"
,
1
).
eq
(
"region_name"
,
"江西省"
));
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
like
(
"belong_area"
,
region
.
getRegionCode
()).
isNotNull
(
"fan_gateway_id"
));
int
year
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
);
List
<
Long
>
fdz
=
stationBasicList
.
stream
().
map
(
StationBasic:
:
getSequenceNbr
).
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
);
//日发电量
AtomicReference
<
Double
>
dailyPower
=
new
AtomicReference
<>(
0.0
);
//月发电量
AtomicReference
<
Double
>
monthlyPower
=
new
AtomicReference
<>(
0.0
);
//年发电量
AtomicReference
<
Double
>
annualPower
=
new
AtomicReference
<>(
0.0
);
//年发电量完成比例
stationBasicList
.
forEach
(
stationBasic
->
{
if
(
"FDZ"
.
equals
(
stationBasic
.
getStationType
()))
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"有功功率"
,
"日发电量"
,
"月发电量"
,
"年发电量"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
dailyPower
.
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
,
"年发电量"
)));
}
else
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
,
"年发电量"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
Map
<
String
,
String
>
likeQuerCondtion
=
new
HashMap
<>();
likeQuerCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeQuerCondtion
);
dailyPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
monthlyPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
annualPower
.
updateAndGet
(
v
->
v
+
monitoringServiceImpl
.
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
}
});
HashMap
<
String
,
String
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"Day"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
dailyPower
.
get
()));
resultMap
.
put
(
"Moon"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
monthlyPower
.
get
()));
resultMap
.
put
(
"Year"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
annualPower
.
get
()));
try
{
emqKeeper
.
getMqttClient
().
publish
(
"bigscreen_qgjrdz_topic_1007"
,
JSON
.
toJSON
(
resultMap
).
toString
().
getBytes
(
"UTF-8"
),
1
,
true
);
logger
.
info
(
"-----------------大屏日月年发电量=================== 成功!"
+
JSON
.
toJSONString
(
socialContributionDtoPage
));
}
catch
(
Exception
exception
)
{
logger
.
error
(
"-----------------大屏日月年发电量=================== 失败!"
);
}
}
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
<>();
List
<
StationBasic
>
stationBasicListAll
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
List
<
StationBasic
>
stationBasicListAll
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
...
...
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