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
40bf6548
Commit
40bf6548
authored
Aug 01, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
4f0d23fc
ab680ae8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
0 deletions
+73
-0
MonitoringMapController.java
.../module/jxiop/biz/controller/MonitoringMapController.java
+7
-0
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+66
-0
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 @
40bf6548
...
...
@@ -130,4 +130,11 @@ public class MonitoringMapController extends BaseController {
public
ResponseModel
<
HashMap
<
String
,
List
<
String
>>>
getPowerGenerationTrendsOfCompletionTopFive
(
@RequestParam
(
required
=
false
)
String
areaName
)
{
return
ResponseHelper
.
buildResponse
(
monitoringServiceImpl
.
getPowerGenerationTrendsOfCompletionTopFive
(
areaName
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
value
=
"监盘首页-发电小时排名top3"
)
@GetMapping
(
"/getPowerGenerationTrendsOfCompletionTopThree"
)
public
ResponseModel
<
Page
<
HashMap
<
String
,
String
>>>
getPowerGenerationTrendsOfCompletionTopThree
(
@RequestParam
(
required
=
false
)
String
areaName
,
@RequestParam
(
required
=
false
,
defaultValue
=
"0"
)
String
tabValue
)
{
return
ResponseHelper
.
buildResponse
(
monitoringServiceImpl
.
getPowerGenerationTrendsOfCompletionTopThree
(
tabValue
,
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 @
40bf6548
...
...
@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.unbescape.css.CssIdentifierEscapeLevel
;
import
java.net.URLDecoder
;
import
java.util.*
;
...
...
@@ -645,6 +646,8 @@ public class MonitoringServiceImpl {
hashMap
.
put
(
"seriesData"
,
yList
);
return
hashMap
;
}
public
List
<
String
>
getXListofRecentOneYear
(){
List
<
String
>
xList
=
new
ArrayList
<>();
Calendar
calendar
=
Calendar
.
getInstance
();
...
...
@@ -656,4 +659,67 @@ public class MonitoringServiceImpl {
}
return
xList
;
}
public
Page
<
HashMap
<
String
,
String
>>
getPowerGenerationTrendsOfCompletionTopThree
(
String
tabValue
,
String
areaName
){
Page
<
HashMap
<
String
,
String
>>
page
=
new
Page
<>(
1
,
3
);
List
<
HashMap
<
String
,
String
>>
mapList
=
new
ArrayList
<>();
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
List
<
StationBasic
>
fdzList
=
new
ArrayList
<>();
List
<
StationBasic
>
gfdzlist
=
new
ArrayList
<>();
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
stationBasicListAll
=
getListOfStationBasicByAreaName
(
areaName
);
}
else
{
stationBasicListAll
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"station_name"
));
}
String
indicator
=
"日发电量"
;
if
(
tabValue
.
equals
(
1
)){
indicator
=
"月发电量"
;
}
else
{
indicator
=
"年发电量"
;
}
//填写发电小时数
String
finalIndicator
=
indicator
;
stationBasicListAll
.
forEach
(
stationBasic
->
{
Double
install
=
getStationCaPACITYL
(
stationBasic
.
getStationNumber
());
Double
total
=
commonServiceImpl
.
getTotalByIndicatior
(
stationBasic
.
getFanGatewayId
(),
finalIndicator
);
stationBasic
.
setAddress
(
String
.
format
(
"%.2f"
,
total
));
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
)){
stationBasic
.
setAddress
(
String
.
format
(
"%.2f"
,
total
/
100
/
install
));
}
else
{
stationBasic
.
setAddress
(
String
.
format
(
"%.2f"
,
total
/
1000000
/
install
));
}
if
(
stationBasic
.
getAddress
().
equals
(
"NaN"
)){
stationBasic
.
setAddress
(
"0.00"
);
}
});
//分组并排序
fdzList
=
stationBasicListAll
.
stream
().
filter
(
stationBasic
->
stationBasic
.
getStationType
().
equals
(
"FDZ"
)).
collect
(
Collectors
.
toList
()).
stream
().
sorted
(
Comparator
.
comparing
(
StationBasic:
:
getAddress
,
Comparator
.
comparingDouble
(
Double:
:
parseDouble
)).
reversed
()).
collect
(
Collectors
.
toList
());
gfdzlist
=
stationBasicListAll
.
stream
().
filter
(
stationBasic
->
!
stationBasic
.
getStationType
().
equals
(
"FDZ"
)).
collect
(
Collectors
.
toList
()).
stream
().
sorted
(
Comparator
.
comparing
(
StationBasic:
:
getAddress
,
Comparator
.
comparingDouble
(
Double:
:
parseDouble
)).
reversed
()).
collect
(
Collectors
.
toList
());
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
HashMap
<
String
,
String
>
stringHashMap
=
new
HashMap
<>();
stringHashMap
.
put
(
"sortNumber"
,
String
.
valueOf
(
i
+
1
));
StationBasic
stationBasic
=
new
StationBasic
();
if
(
i
<(
fdzList
.
size
())){
stationBasic
=
fdzList
.
get
(
i
);
stringHashMap
.
put
(
"stationName1"
,
stationBasic
.
getStationName
());
stringHashMap
.
put
(
"hours1"
,
stationBasic
.
getAddress
()+
"h"
);
}
else
{
stringHashMap
.
put
(
"stationName1"
,
""
);
stringHashMap
.
put
(
"hours1"
,
""
);
}
if
(
i
<(
gfdzlist
.
size
())){
stationBasic
=
gfdzlist
.
get
(
i
);
stringHashMap
.
put
(
"stationName2"
,
stationBasic
.
getStationName
());
stringHashMap
.
put
(
"hours2"
,
stationBasic
.
getAddress
()+
"h"
);
}
else
{
stringHashMap
.
put
(
"stationName2"
,
""
);
stringHashMap
.
put
(
"hours2"
,
""
);
}
mapList
.
add
(
stringHashMap
);
}
page
.
setRecords
(
mapList
);
//组装数据
return
page
;
}
}
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