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
ec8f258a
Commit
ec8f258a
authored
Jul 19, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
月发电量趋势与发电详情接口提交。
parent
2de18257
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
10 deletions
+78
-10
MonitoringMapController.java
.../module/jxiop/biz/controller/MonitoringMapController.java
+16
-2
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+62
-8
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitoringMapController.java
View file @
ec8f258a
...
...
@@ -31,8 +31,10 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.logging.Handler
;
@RestController
@Api
(
tags
=
"监盘地图接口"
)
...
...
@@ -85,14 +87,14 @@ public class MonitoringMapController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"监盘首页-装机容量"
)
@GetMapping
(
"/getInstallCapityByAreaName"
)
public
ResponseModel
<
String
>
getInstallCapityByAreaName
(
@RequestParam
(
required
=
false
)
String
areaName
)
{
public
ResponseModel
<
HashMap
<
String
,
String
>
>
getInstallCapityByAreaName
(
@RequestParam
(
required
=
false
)
String
areaName
)
{
return
ResponseHelper
.
buildResponse
(
monitoringServiceImpl
.
getInstallCapityByAreaName
(
areaName
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"监盘首页-有功功率"
)
@GetMapping
(
"/getActivePowerByAreaName"
)
public
ResponseModel
<
String
>
getActivePowerByAreaName
(
@RequestParam
(
required
=
false
)
String
areaName
)
{
public
ResponseModel
<
HashMap
<
String
,
String
>
>
getActivePowerByAreaName
(
@RequestParam
(
required
=
false
)
String
areaName
)
{
return
ResponseHelper
.
buildResponse
(
monitoringServiceImpl
.
getActivePowerByAreaName
(
areaName
));
}
...
...
@@ -102,4 +104,16 @@ public class MonitoringMapController extends BaseController {
public
ResponseModel
<
Page
<
SocialContributionDto
>>
getSocialContributionDtoList
(
@RequestParam
(
required
=
false
)
String
areaName
,
@RequestParam
(
required
=
false
)
String
station
)
{
return
ResponseHelper
.
buildResponse
(
monitoringServiceImpl
.
getSocialContributionDtoList
(
areaName
,
station
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"监盘首页-发电量趋势"
)
@GetMapping
(
"/getPowerGenerationTrends"
)
public
ResponseModel
<
HashMap
<
String
,
List
<
String
>>>
getPowerGenerationTrends
(
@RequestParam
(
required
=
false
)
String
areaName
)
{
return
ResponseHelper
.
buildResponse
(
monitoringServiceImpl
.
getPowerGenerationTrends
(
areaName
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"监盘首页-发电量详情"
)
@GetMapping
(
"/getDetailsOnPowergeneration"
)
public
ResponseModel
<
Page
<
HashMap
<
String
,
String
>>>
getDetailsOnPowergeneration
(
@RequestParam
(
required
=
false
)
String
areaName
)
{
return
ResponseHelper
.
buildResponse
(
monitoringServiceImpl
.
getDetailsOnPowergeneration
(
areaName
));
}
}
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 @
ec8f258a
...
...
@@ -18,10 +18,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.ObjectUtils
;
import
java.net.URLDecoder
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
...
...
@@ -381,7 +378,8 @@ public class MonitoringServiceImpl {
}
//获取装机容量
public
String
getInstallCapityByAreaName
(
String
areaName
)
{
public
HashMap
<
String
,
String
>
getInstallCapityByAreaName
(
String
areaName
)
{
HashMap
<
String
,
String
>
hashMap
=
new
HashMap
<>();
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.0
);
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
...
...
@@ -401,11 +399,13 @@ public class MonitoringServiceImpl {
stationBasicListAll
.
forEach
(
stationBasic
->
{
total
.
updateAndGet
(
v
->
v
+
getStationCaPACITYL
(
stationBasic
.
getStationNumber
()));
});
return
String
.
format
(
"%.2f"
,
total
.
get
());
hashMap
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
total
.
get
()))
;
return
hashMap
;
}
//获取有功功率
public
String
getActivePowerByAreaName
(
String
areaName
)
{
public
HashMap
<
String
,
String
>
getActivePowerByAreaName
(
String
areaName
)
{
HashMap
<
String
,
String
>
hashMap
=
new
HashMap
<>();
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.0
);
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
...
...
@@ -425,7 +425,8 @@ public class MonitoringServiceImpl {
stationBasicListAll
.
forEach
(
stationBasic
->
{
total
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"有功功率"
));
});
return
String
.
format
(
"%.2f"
,
total
.
get
());
hashMap
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
total
.
get
()))
;
return
hashMap
;
}
//获取社会贡献
...
...
@@ -461,4 +462,57 @@ public class MonitoringServiceImpl {
});
return
commonServiceImpl
.
getSocialContributionDtoList
(
total
.
get
());
}
public
HashMap
<
String
,
List
<
String
>>
getPowerGenerationTrends
(
String
areaName
){
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
eq
(
"station_type"
,
"FDZ"
).
isNotNull
(
"fan_gateway_id"
));
//月发电量
AtomicReference
<
Double
>
monthlyPower
=
new
AtomicReference
<>(
0.0
);
stationBasicList
.
forEach
(
stationBasic
->
{
monthlyPower
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
"月发电量"
));
});
HashMap
<
String
,
List
<
String
>>
hashMap
=
new
HashMap
<>();
List
<
String
>
xList
=
new
ArrayList
<>();
List
<
String
>
yList
=
new
ArrayList
<>();
for
(
int
i
=
1
;
i
<
13
;
i
++)
{
xList
.
add
(
i
+
"月"
);
if
(
i
==
new
Date
().
getMonth
()){
yList
.
add
(
String
.
format
(
"%.2f"
,
monthlyPower
.
get
()));
}
else
{
yList
.
add
(
"0"
);
}
}
hashMap
.
put
(
"axisData"
,
xList
);
hashMap
.
put
(
"seriesData"
,
yList
);
return
hashMap
;
}
public
Page
<
HashMap
<
String
,
String
>>
getDetailsOnPowergeneration
(
String
areaName
){
Page
<
HashMap
<
String
,
String
>>
hashMapPage
=
new
Page
<>(
1
,
99
);
List
<
HashMap
<
String
,
String
>>
hashMapList
=
new
ArrayList
<>();
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
eq
(
"station_type"
,
"FDZ"
).
isNotNull
(
"fan_gateway_id"
));
//日发电量
AtomicReference
<
Double
>
dailyPower
=
new
AtomicReference
<>(
0.0
);
//月发电量
AtomicReference
<
Double
>
monthlyPower
=
new
AtomicReference
<>(
0.0
);
//年发电量
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
(),
"年发电量"
));
});
HashMap
<
String
,
String
>
dayHashMap
=
new
HashMap
<>();
dayHashMap
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
dailyPower
.
get
())+
"KWh"
);
HashMap
<
String
,
String
>
monthHashMap
=
new
HashMap
<>();
monthHashMap
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
monthlyPower
.
get
())+
"KWh"
);
HashMap
<
String
,
String
>
annualHashMap
=
new
HashMap
<>();
annualHashMap
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
annualPower
.
get
())+
"KWh"
);
HashMap
<
String
,
String
>
totalHashMap
=
new
HashMap
<>();
totalHashMap
.
put
(
"title"
,
String
.
format
(
"%.2f"
,
annualPower
.
get
())+
"KWh"
);
hashMapList
.
add
(
dayHashMap
);
hashMapList
.
add
(
monthHashMap
);
hashMapList
.
add
(
annualHashMap
);
hashMapList
.
add
(
totalHashMap
);
hashMapPage
.
setRecords
(
hashMapList
);
return
hashMapPage
;
}
}
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