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
f8cfc179
Commit
f8cfc179
authored
Oct 10, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
监盘首页发电量top5调整
parent
d1dae55d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
25 deletions
+17
-25
StationPlanMapper.java
.../amos/boot/module/jxiop/api/mapper/StationPlanMapper.java
+3
-0
StationCacheInfoDto.java
...n/amos/boot/module/jxiop/biz/dto/StationCacheInfoDto.java
+2
-0
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+12
-25
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/mapper/StationPlanMapper.java
View file @
f8cfc179
...
...
@@ -24,5 +24,8 @@ public interface StationPlanMapper extends BaseMapper<StationPlan> {
//
// @Select("SELECT monthly ,sum(value) value from station_plan where year= #{year} GROUP BY monthly ")
// List<StationPlan> getStationPlanbyids(@Param("year") String year);
@Select
(
"select value from station_plan where station_basic_id=#{stationBasicId} and year= #{year} and monthly= #{monthly}"
)
Double
getPlanGenByStationIdAndMonth
(
@Param
(
"stationBasicId"
)
String
stationId
,
@Param
(
"year"
)
String
year
,
@Param
(
"monthly"
)
String
monthly
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/StationCacheInfoDto.java
View file @
f8cfc179
...
...
@@ -29,4 +29,6 @@ public class StationCacheInfoDto implements Serializable {
private
String
boosterGatewayId
;
//片区code
private
String
areaCode
;
//
private
String
address
;
}
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 @
f8cfc179
...
...
@@ -26,7 +26,6 @@ import org.typroject.tyboot.component.emq.EmqKeeper;
import
java.math.BigDecimal
;
import
java.net.URLDecoder
;
import
java.time.LocalDate
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
...
...
@@ -75,8 +74,8 @@ public class MonitoringServiceImpl {
// InfluxdbUtil influxdbUtil;
@Autowired
IndicatorDataMapper
indicatorDataMapper
;
@Autowired
StationPlanMapper
StationPlanMapper
;
/**
* 根据场站编号获取该场站的装机容量
*
...
...
@@ -798,48 +797,36 @@ public class MonitoringServiceImpl {
public
Page
<
HashMap
<
String
,
String
>>
getPowerGenerationTrendsOfCompletionTopFive
(
String
areaName
)
{
Page
<
HashMap
<
String
,
String
>>
hashMapPage
=
new
Page
<>(
1
,
5
);
List
<
HashMap
<
String
,
String
>>
mapList
=
new
ArrayList
<>();
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
List
<
StationCacheInfoDto
>
stationCacheInfoDtoList
=
new
ArrayList
<>();
stationCacheInfoDtoList
=
commonServiceImpl
.
getListStationCacheInfoDto
();
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
stationBasicListAll
=
getListOfStationBasicByAreaName
(
areaName
);
}
else
{
stationBasicListAll
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
stationCacheInfoDtoList
=
stationCacheInfoDtoList
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getBelongArea
().
equals
(
areaName
)).
collect
(
Collectors
.
toList
());
}
HashMap
<
String
,
List
<
String
>>
hashMap
=
new
HashMap
<>();
List
<
String
>
xList
=
new
ArrayList
<>();
List
<
String
>
yList
=
new
ArrayList
<>();
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.00
);
//月发电量
String
finalIndicator
=
"月发电量"
;
station
BasicListAll
.
forEach
(
stationBasic
->
{
station
CacheInfoDtoList
.
forEach
(
stationCacheInfoDto
->
{
List
<
Map
<
String
,
Object
>>
mapListData
=
new
ArrayList
<>();
if
(!
station
Basic
.
getStationType
().
equals
(
"FDZ"
))
{
if
(!
station
CacheInfoDto
.
getStationType
().
equals
(
"FDZ"
))
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
CommonConstans
.
taiHeGenIndicatorMonth
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
station
Basic
.
getBoosterGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
station
CacheInfoDto
.
getBoosterGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
total
.
set
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
CommonConstans
.
taiHeGenIndicatorMonth
));
}
else
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
finalIndicator
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
station
Basic
.
getFanGatewayId
()));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
station
CacheInfoDto
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
total
.
set
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
));
}
QueryWrapper
<
StationPlan
>
wrapper2
=
new
QueryWrapper
<>();
LocalDate
currentDate
=
LocalDate
.
now
();
int
month
=
currentDate
.
getMonthValue
();
wrapper2
.
select
(
"ifnull(sum(value), 0) as sum_value"
);
wrapper2
.
eq
(
"monthly"
,
month
);
wrapper2
.
eq
(
"station_basic_id"
,
stationBasic
.
getSequenceNbr
());
List
<
Map
<
String
,
Object
>>
list
=
StationPlanMapper
.
selectMaps
(
wrapper2
);
System
.
out
.
println
(
total
.
get
()+
"9999999999999999999999"
);
Double
sumValue
=
list
!=
null
&&
!
list
.
isEmpty
()
?
(
Double
)
list
.
get
(
0
).
get
(
"sum_value"
)
:
0
;
stationBasic
.
setAddress
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
total
.
get
()/
sumValue
*
100
));
stationCacheInfoDto
.
setAddress
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
total
.
get
())*
100
/
getPlanGenByStationIdAndMonth
(
stationCacheInfoDto
.
getStationId
())));
});
List
<
Station
Basic
>
sorted
=
stationBasicListAll
.
stream
().
sorted
(
Comparator
.
comparing
(
StationBasic
:
:
getAddress
,
Comparator
.
comparingDouble
(
Double:
:
parseDouble
)).
reversed
()).
collect
(
Collectors
.
toList
());
List
<
Station
CacheInfoDto
>
sorted
=
stationCacheInfoDtoList
.
stream
().
sorted
(
Comparator
.
comparing
(
StationCacheInfoDto
:
:
getAddress
,
Comparator
.
comparingDouble
(
Double:
:
parseDouble
)).
reversed
()).
collect
(
Collectors
.
toList
());
sorted
.
forEach
(
stationBasic
->
{
HashMap
<
String
,
String
>
hashMap1
=
new
HashMap
<>();
hashMap1
.
put
(
"stationName"
,
stationBasic
.
getStationName
());
...
...
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