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
0804f4b6
Commit
0804f4b6
authored
Jul 20, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业务接口查询慢问题修改
parent
0cf773bd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
14 deletions
+33
-14
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+16
-1
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+17
-13
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/CommonServiceImpl.java
View file @
0804f4b6
...
...
@@ -54,7 +54,22 @@ public class CommonServiceImpl {
avageValue
=
mapList
.
stream
().
filter
(
stringObjectMap
->
!
ObjectUtils
.
isEmpty
(
stringObjectMap
.
get
(
"value"
))).
mapToDouble
(
l
->
Double
.
parseDouble
((
String
)
l
.
get
(
"value"
))).
average
().
getAsDouble
();
return
Double
.
valueOf
(
String
.
format
(
"%.2f"
,
avageValue
));
}
public
Double
getTotalByIndicatior
(
List
<
Map
<
String
,
Object
>>
mapList
,
String
indicator
){
Double
totalvalue
=
0.0
;
totalvalue
=
mapList
.
stream
().
filter
(
stringObjectMap
->
stringObjectMap
.
get
(
"equipmentIndexName"
).
toString
().
contains
(
"indicator"
)&&!
ObjectUtils
.
isEmpty
(
stringObjectMap
.
get
(
"value"
))).
mapToDouble
(
l
->
Double
.
parseDouble
((
String
)
l
.
get
(
"value"
))).
sum
();
return
Double
.
valueOf
(
String
.
format
(
"%.2f"
,
totalvalue
));
}
/**
* @deprecated 获取指标值平均值
* @param gatewayId 网关id 用于拼接sql语句
* @param indicator 指标名称 查询条件-根据指标名称获取风速
* @return 指标值总和
*/
public
Double
getAvgvalueByIndicatior
(
List
<
Map
<
String
,
Object
>>
mapList
,
String
indicator
){
Double
avageValue
=
0.0
;
avageValue
=
mapList
.
stream
().
filter
(
stringObjectMap
->
stringObjectMap
.
get
(
"equipmentIndexName"
).
toString
().
contains
(
"indicator"
)&&!
ObjectUtils
.
isEmpty
(
stringObjectMap
.
get
(
"value"
))).
mapToDouble
(
l
->
Double
.
parseDouble
((
String
)
l
.
get
(
"value"
))).
sum
();
return
Double
.
valueOf
(
String
.
format
(
"%.2f"
,
avageValue
));
}
public
Double
getStationCapactityByStationWerks
(
String
WERKS
){
return
sjglZsjZsbtzMapper
.
getStationCapactityByStationWerks
(
WERKS
);
}
...
...
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 @
0804f4b6
...
...
@@ -65,7 +65,8 @@ public class MonitoringServiceImpl {
@Autowired
EmqKeeper
emqKeeper
;
@Autowired
InfluxdbUtil
influxdbUtil
;
/**
* 根据场站编号获取该场站的装机容量
*
...
...
@@ -197,12 +198,13 @@ public class MonitoringServiceImpl {
if
(
getStationCaPACITYL
(
stationBasic
.
getStationNumber
())
!=
null
)
{
completionOfPowerIndicatorsDto
.
setInstallCapactity
(
String
.
format
(
"%.2f"
,
getStationCaPACITYL
(
stationBasic
.
getStationNumber
())));
}
List
<
Map
<
String
,
Object
>>
mapList
=
influxdbUtil
.
query
(
"SELECT * FROM indicators_"
+
stationBasic
.
getFanGatewayId
());
try
{
completionOfPowerIndicatorsDto
.
setWindSpeedOrIrradiance
(
String
.
valueOf
(
commonServiceImpl
.
getAvgvalueByIndicatior
(
stationBasic
.
getFanGatewayId
()
,
"30秒平均风速"
)));
completionOfPowerIndicatorsDto
.
setActivePower
(
String
.
valueOf
(
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
()
,
"有功功率"
)));
completionOfPowerIndicatorsDto
.
setDailyPower
(
String
.
valueOf
(
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
()
,
"日发电量"
)));
completionOfPowerIndicatorsDto
.
setMonthlyPower
(
String
.
valueOf
(
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
()
,
"月发电量"
)));
completionOfPowerIndicatorsDto
.
setAnnualPower
(
String
.
valueOf
(
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
()
,
"年发电量"
)));
completionOfPowerIndicatorsDto
.
setWindSpeedOrIrradiance
(
String
.
valueOf
(
commonServiceImpl
.
getAvgvalueByIndicatior
(
mapList
,
"30秒平均风速"
)));
completionOfPowerIndicatorsDto
.
setActivePower
(
String
.
valueOf
(
commonServiceImpl
.
getTotalByIndicatior
(
mapList
,
"有功功率"
)));
completionOfPowerIndicatorsDto
.
setDailyPower
(
String
.
valueOf
(
commonServiceImpl
.
getTotalByIndicatior
(
mapList
,
"日发电量"
)));
completionOfPowerIndicatorsDto
.
setMonthlyPower
(
String
.
valueOf
(
commonServiceImpl
.
getTotalByIndicatior
(
mapList
,
"月发电量"
)));
completionOfPowerIndicatorsDto
.
setAnnualPower
(
String
.
valueOf
(
commonServiceImpl
.
getTotalByIndicatior
(
mapList
,
"年发电量"
)));
}
catch
(
Exception
exception
)
{
completionOfPowerIndicatorsDto
.
setWindSpeedOrIrradiance
(
"0"
);
completionOfPowerIndicatorsDto
.
setActivePower
(
"0"
);
...
...
@@ -247,10 +249,11 @@ public class MonitoringServiceImpl {
//年利用小时数
AtomicReference
<
Double
>
useHours
=
new
AtomicReference
<>(
0.01
);
stationBasicList
.
forEach
(
stationBasic
->
{
dailyPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"日发电量"
));
monthlyPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"月发电量"
));
annualPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"年发电量"
));
useHours
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"日工作时间"
));
List
<
Map
<
String
,
Object
>>
mapList
=
influxdbUtil
.
query
(
"SELECT * FROM indicators_"
+
stationBasic
.
getFanGatewayId
());
dailyPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
mapList
,
"日发电量"
));
monthlyPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
mapList
,
"月发电量"
));
annualPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
mapList
,
"年发电量"
));
useHours
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
mapList
,
"日工作时间"
));
});
SocialContributionDto
dailyPowerdto
=
new
SocialContributionDto
();
dailyPowerdto
.
setTitle
(
String
.
format
(
"%.2f"
,
dailyPower
.
get
()));
...
...
@@ -577,9 +580,10 @@ public class MonitoringServiceImpl {
//年发电量
AtomicReference
<
Double
>
annualPower
=
new
AtomicReference
<>(
0.0
);
stationBasicList
.
forEach
(
stationBasic
->
{
dailyPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"日发电量"
));
monthlyPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"月发电量"
));
annualPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"年发电量"
));
List
<
Map
<
String
,
Object
>>
mapList
=
influxdbUtil
.
query
(
"SELECT * FROM indicators_"
+
stationBasic
.
getFanGatewayId
());
dailyPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
mapList
,
"日发电量"
));
monthlyPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
mapList
,
"月发电量"
));
annualPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
mapList
,
"年发电量"
));
});
HashMap
<
String
,
String
>
dayHashMap
=
new
HashMap
<>();
dayHashMap
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
dailyPower
.
get
())
+
"KWh"
);
...
...
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