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
70daa26e
Commit
70daa26e
authored
Apr 07, 2024
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.运行监盘首页社会贡献、top5完成率、top3发电量接口调整
parent
f72ad26a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
261 additions
and
36 deletions
+261
-36
BuDunPvFanDto.java
...yeejoin/amos/boot/module/jxiop/api/dto/BuDunPvFanDto.java
+10
-0
BudunStationValueDto.java
.../amos/boot/module/jxiop/api/dto/BudunStationValueDto.java
+9
-0
Constants.java
...om/yeejoin/amos/boot/module/jxiop/api/util/Constants.java
+6
-1
MonitorService.java
...in/amos/boot/module/jxiop/biz/service/MonitorService.java
+2
-0
MonitorService.java
...in/amos/boot/module/jxiop/biz/service/MonitorService.java
+26
-0
MonitorServiceImpl.java
...oot/module/jxiop/biz/service/impl/MonitorServiceImpl.java
+208
-35
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/dto/BuDunPvFanDto.java
0 → 100644
View file @
70daa26e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
dto
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
BuDunPvFanDto
{
List
<
BudunStationValueDto
>
fan
;
List
<
BudunStationValueDto
>
pv
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/dto/BudunStationValueDto.java
0 → 100644
View file @
70daa26e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
dto
;
import
lombok.Data
;
@Data
public
class
BudunStationValueDto
{
private
String
station_name
;
private
Double
value
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/util/Constants.java
View file @
70daa26e
...
...
@@ -74,7 +74,12 @@ public class Constants {
public
static
final
String
REQUEST_GET
=
"GET"
;
public
static
final
String
REQUEST_POST
=
"POST"
;
public
static
final
String
get_province_item_url
=
"method=scene_screen.data_interface.get_province_item"
;
public
static
String
resovleRule_data
=
"data"
;
public
static
final
String
get_month_generation_trend_url
=
"method=scene_screen.data_interface.get_month_generation_trend"
;
public
static
final
String
get_area_item_url
=
"method=scene_screen.data_interface.get_area_item"
;
public
static
final
String
get_month_top_url
=
"method=scene_screen.data_interface.get_month_top"
;
public
static
final
String
get_hours_num_top
=
"scene_screen.data_interface.get_hours_num_top"
;
public
static
final
String
resovleRule_data
=
"data"
;
public
static
final
String
areaChinese
=
"区域"
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/MonitorService.java
View file @
70daa26e
...
...
@@ -27,4 +27,6 @@ public interface MonitorService {
* @return Map<String, Object>
*/
Map
<
String
,
Object
>
qyAccessSituation
();
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/MonitorService.java
View file @
70daa26e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.RegionNationWideDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.SocialContributionDto
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -35,4 +37,28 @@ public interface MonitorService {
* @return 有功功率
*/
public
HashMap
<
String
,
String
>
getActivePowerByAreaName
(
String
areaName
);
/**
* @description 根据地区名称获取发电数据
* @param areaName
* @return
*/
public
Page
<
HashMap
<
String
,
String
>>
getDetailsOnPowergeneration
(
String
areaName
);
/**
* @description 根据地区名称获取社会贡献数据
* @param areaName
* @param stationId
* @return
*/
public
Page
<
SocialContributionDto
>
getSocialContributionDtoList
(
String
areaName
,
String
stationId
)
;
/**
* @description 根据地区名称获取发电量完成度排名前五的数据
* @param areaName
* @return
*/
public
Page
<
HashMap
<
String
,
String
>>
getPowerGenerationTrendsOfCompletionTopFive
(
String
areaName
);
public
Page
<
HashMap
<
String
,
String
>>
getPowerGenerationTrendsOfCompletionTopThree
(
String
tabValue
,
String
areaName
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorServiceImpl.java
View file @
70daa26e
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.BuDunGenDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.BudunStationValueDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.BuDunPvFanDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.*
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.*
;
import
com.yeejoin.amos.boot.module.jxiop.api.util.Constants
;
import
com.yeejoin.amos.boot.module.jxiop.api.util.HttpRequestUtil
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESEquipments
;
import
com.yeejoin.amos.boot.module.jxiop.biz.constants.CommonConstans
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.CoreCommonService
;
...
...
@@ -26,8 +26,6 @@ import java.util.*;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
static
io
.
lettuce
.
core
.
ZStoreArgs
.
Builder
.
sum
;
@Service
@Slf4j
@RequiredArgsConstructor
...
...
@@ -102,36 +100,36 @@ public class MonitorServiceImpl implements MonitorService {
Double
useHoursOfAnnualGF
=
0.00
;
//获取全国数据
String
nationalUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_province_item_url
;
String
nationalUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_province_item_url
;
//获取风电
String
nationalFanUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_province_item_url
+
"&type=fan"
;
String
nationalFanUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_province_item_url
+
"&type=fan"
;
//获取光伏
String
nationalPVUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_province_item_url
+
"&type=pv"
;
List
<
BuDunGenDto
>
nationalGendto
=
httpRequestUtil
.
getResPonse
(
nationalPVUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunGenDto
.
class
);
List
<
BuDunGenDto
>
fanGendto
=
httpRequestUtil
.
getResPonse
(
nationalPVUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunGenDto
.
class
);
List
<
BuDunGenDto
>
pvGendto
=
httpRequestUtil
.
getResPonse
(
nationalPVUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunGenDto
.
class
);
if
(
nationalGendto
.
size
()>
0
)
{
BuDunGenDto
buDunGenDto
=
nationalGendto
.
get
(
0
);
powerOfDay
=
buDunGenDto
.
getDay
();
powerOfMonth
=
buDunGenDto
.
getMonth
();
powerOfAnnual
=
buDunGenDto
.
getYear
();
completeRateOfAnnual
=
buDunGenDto
.
getYear_complete
();
useHoursOfAnnual
=
buDunGenDto
.
getYear_hour_number
();
String
nationalPVUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_province_item_url
+
"&type=pv"
;
List
<
BuDunGenDto
>
nationalGendto
=
httpRequestUtil
.
getResPonse
(
nationalPVUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunGenDto
.
class
);
List
<
BuDunGenDto
>
fanGendto
=
httpRequestUtil
.
getResPonse
(
nationalPVUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunGenDto
.
class
);
List
<
BuDunGenDto
>
pvGendto
=
httpRequestUtil
.
getResPonse
(
nationalPVUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunGenDto
.
class
);
if
(
nationalGendto
.
size
()
>
0
)
{
BuDunGenDto
buDunGenDto
=
nationalGendto
.
get
(
0
);
powerOfDay
=
buDunGenDto
.
getDay
();
powerOfMonth
=
buDunGenDto
.
getMonth
();
powerOfAnnual
=
buDunGenDto
.
getYear
();
completeRateOfAnnual
=
buDunGenDto
.
getYear_complete
();
useHoursOfAnnual
=
buDunGenDto
.
getYear_hour_number
();
}
if
(
fanGendto
.
size
()>
0
)
{
if
(
fanGendto
.
size
()
>
0
)
{
BuDunGenDto
buDunGenDto
=
nationalGendto
.
get
(
0
);
powerOfDayFD
=
buDunGenDto
.
getDay
();
powerOfMonthFD
=
buDunGenDto
.
getMonth
();
powerOfAnnualFD
=
buDunGenDto
.
getYear
();
completeRateOfAnnualFD
=
buDunGenDto
.
getYear_complete
();
completeRateOfAnnualFD
=
buDunGenDto
.
getYear_complete
();
useHoursOfAnnualFD
=
buDunGenDto
.
getYear_hour_number
();
}
if
(
pvGendto
.
size
()>
0
)
{
if
(
pvGendto
.
size
()
>
0
)
{
BuDunGenDto
buDunGenDto
=
nationalGendto
.
get
(
0
);
powerOfDayGF
=
buDunGenDto
.
getDay
();
powerOfMonthGF
=
buDunGenDto
.
getMonth
();
powerOfAnnualGF
=
buDunGenDto
.
getYear
();
completeRateOfAnnualGF
=
buDunGenDto
.
getYear_complete
();
completeRateOfAnnualGF
=
buDunGenDto
.
getYear_complete
();
useHoursOfAnnualGF
=
buDunGenDto
.
getYear_hour_number
();
}
// if (coreValuesDtos.size() > 0) {
...
...
@@ -384,7 +382,7 @@ public class MonitorServiceImpl implements MonitorService {
completionOfPowerIndicatorsDto
.
setActivePower
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
coreCommonService
.
getSumOfByPointName
(
coreValuesDtoList
,
CommonConstans
.
ACTIVE_POWER
)));
gfzinstallCapacity
.
updateAndGet
(
v
->
v
+
Double
.
parseDouble
(
stationCacheInfoDto
.
getInstalledCapacity
()));
}
}
else
{
}
else
{
completionOfPowerIndicatorsDto
.
setWindSpeedOrIrradiance
(
"----"
);
completionOfPowerIndicatorsDto
.
setActivePower
(
"----"
);
completionOfPowerIndicatorsDto
.
setDailyPower
(
"----"
);
...
...
@@ -402,9 +400,9 @@ public class MonitorServiceImpl implements MonitorService {
}
completionOfPowerIndicatorsDtoList
.
add
(
completionOfPowerIndicatorsDto
);
});
String
provincelUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_province_item_url
+
"&provinceName="
+
provinceName
;
List
<
BuDunGenDto
>
provinceDtos
=
httpRequestUtil
.
getResPonse
(
provincelUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunGenDto
.
class
);
if
(
provinceDtos
.
size
()>
0
)
{
String
provincelUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_province_item_url
+
"&provinceName="
+
provinceName
;
List
<
BuDunGenDto
>
provinceDtos
=
httpRequestUtil
.
getResPonse
(
provincelUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunGenDto
.
class
);
if
(
provinceDtos
.
size
()
>
0
)
{
BuDunGenDto
buDunGenDto
=
provinceDtos
.
get
(
0
);
dailyPower
.
set
(
buDunGenDto
.
getDay
());
monthlyPower
.
set
(
buDunGenDto
.
getMonth
());
...
...
@@ -480,35 +478,101 @@ public class MonitorServiceImpl implements MonitorService {
return
stationCacheInfoDtos
;
}
public
HashMap
<
String
,
String
>
getActivePowerByAreaName
(
String
areaName
)
{
List
<
StationCacheInfoDto
>
stationCacheInfoDtoList
=
this
.
getListStationCacheInfoDto
();
List
<
CoreValuesDto
>
coreValuesDtos
=
coreCommonService
.
getValuesByStationNamesAndPointsNames
(
null
,
null
);
List
<
CoreValuesDto
>
coreValuesDtos
=
coreCommonService
.
getValuesByStationNamesAndPointsNames
(
null
,
null
);
HashMap
<
String
,
String
>
hashMap
=
new
HashMap
<>();
Double
total
=
0.00
;
Double
total
=
0.00
;
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
stationCacheInfoDtoList
=
stationCacheInfoDtoList
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getBelongArea
().
equals
(
areaName
)&&
stationCacheInfoDto
.
getStationCoreName
()!=
null
&&
stationCacheInfoDto
.
getBoosterCoreName
()!=
null
).
collect
(
Collectors
.
toList
());
List
<
String
>
stationNames
=
new
ArrayList
<>();
stationNames
.
addAll
(
stationCacheInfoDtoList
.
stream
().
map
(
StationCacheInfoDto:
:
getStationCoreName
).
collect
(
Collectors
.
toList
()));
stationNames
.
addAll
(
stationCacheInfoDtoList
.
stream
().
map
(
StationCacheInfoDto:
:
getBoosterCoreName
).
collect
(
Collectors
.
toList
()));
coreValuesDtos
=
coreValuesDtos
.
stream
().
filter
(
coreValuesDto
->
stationNames
.
contains
(
coreValuesDto
.
getName
())).
collect
(
Collectors
.
toList
());
stationCacheInfoDtoList
=
stationCacheInfoDtoList
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getBelongArea
().
equals
(
areaName
)
&&
stationCacheInfoDto
.
getStationCoreName
()
!=
null
&&
stationCacheInfoDto
.
getBoosterCoreName
()
!=
null
).
collect
(
Collectors
.
toList
());
List
<
String
>
stationNames
=
new
ArrayList
<>();
stationNames
.
addAll
(
stationCacheInfoDtoList
.
stream
().
map
(
StationCacheInfoDto:
:
getStationCoreName
).
collect
(
Collectors
.
toList
()));
stationNames
.
addAll
(
stationCacheInfoDtoList
.
stream
().
map
(
StationCacheInfoDto:
:
getBoosterCoreName
).
collect
(
Collectors
.
toList
()));
coreValuesDtos
=
coreValuesDtos
.
stream
().
filter
(
coreValuesDto
->
stationNames
.
contains
(
coreValuesDto
.
getName
())).
collect
(
Collectors
.
toList
());
}
total
=
coreCommonService
.
getSumOfByPointName
(
coreValuesDtos
,
CommonConstans
.
ACTIVE_POWER
);
total
=
coreCommonService
.
getSumOfByPointName
(
coreValuesDtos
,
CommonConstans
.
ACTIVE_POWER
);
//有功功率换算
hashMap
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
total
));
hashMap
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
total
));
return
hashMap
;
}
@Override
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
<
StationCacheInfoDto
>
stationCacheInfoDtoList
=
new
ArrayList
<>();
String
requestUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_area_item_url
;
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
if
(!
areaName
.
contains
(
Constants
.
areaChinese
))
{
areaName
=
Constants
.
areaChinese
;
}
requestUrl
=
requestUrl
+
"&areaName="
+
areaName
;
}
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
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
);
List
<
BuDunGenDto
>
buDunGenDtos
=
httpRequestUtil
.
getResPonse
(
requestUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunGenDto
.
class
);
if
(
buDunGenDtos
.
size
()
>
0
)
{
BuDunGenDto
buDunGenDto
=
buDunGenDtos
.
get
(
0
);
dailyPower
.
set
(
buDunGenDto
.
getDay
());
monthlyPower
.
set
(
buDunGenDto
.
getMonth
());
annualPower
.
set
(
buDunGenDto
.
getYear
());
annualPower
.
set
(
buDunGenDto
.
getYear
());
}
HashMap
<
String
,
String
>
dayHashMap
=
new
HashMap
<>();
dayHashMap
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
dailyPower
.
get
())
+
"万kWh"
);
HashMap
<
String
,
String
>
monthHashMap
=
new
HashMap
<>();
monthHashMap
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
monthlyPower
.
get
())
+
"万kWh"
);
HashMap
<
String
,
String
>
annualHashMap
=
new
HashMap
<>();
annualHashMap
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
annualPower
.
get
())
+
"万kWh"
);
HashMap
<
String
,
String
>
totalHashMap
=
new
HashMap
<>();
totalHashMap
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
annualPower
.
get
())
+
"万kWh"
);
hashMapList
.
add
(
dayHashMap
);
hashMapList
.
add
(
monthHashMap
);
hashMapList
.
add
(
annualHashMap
);
hashMapList
.
add
(
totalHashMap
);
hashMapPage
.
setRecords
(
hashMapList
);
return
hashMapPage
;
}
public
Page
<
SocialContributionDto
>
getSocialContributionDtoList
(
String
areaName
,
String
stationId
)
{
AtomicReference
<
Double
>
total
=
new
AtomicReference
<>(
0.0
);
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
String
requestUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_area_item_url
;
if
(!
ObjectUtils
.
isEmpty
(
stationId
))
{
stationBasicListAll
.
add
(
stationBasicMapper
.
selectById
(
stationId
));
}
else
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
if
(!
areaName
.
contains
(
Constants
.
areaChinese
))
{
areaName
=
areaName
+
Constants
.
areaChinese
;
}
requestUrl
=
requestUrl
+
"&areaName="
+
areaName
;
}
List
<
BuDunGenDto
>
buDunGenDtos
=
httpRequestUtil
.
getResPonse
(
requestUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunGenDto
.
class
);
if
(
buDunGenDtos
.
size
()
>
0
)
{
BuDunGenDto
buDunGenDto
=
buDunGenDtos
.
get
(
0
);
total
.
set
(
buDunGenDto
.
getYear
());
}
return
getSocialContributionDtoList
(
total
.
get
());
}
public
HashMap
<
String
,
String
>
getInstallCapityByAreaName
(
String
areaName
)
{
HashMap
<
String
,
String
>
hashMap
=
new
HashMap
<>();
List
<
StationCacheInfoDto
>
stationCacheInfoDtoList
=
this
.
getListStationCacheInfoDto
();
Double
total
=
0.0
;
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
stationCacheInfoDtoList
=
stationCacheInfoDtoList
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getBelongArea
().
equals
(
areaName
)).
collect
(
Collectors
.
toList
());
stationCacheInfoDtoList
=
stationCacheInfoDtoList
.
stream
().
filter
(
stationCacheInfoDto
->
stationCacheInfoDto
.
getBelongArea
().
equals
(
areaName
)).
collect
(
Collectors
.
toList
());
}
total
=
stationCacheInfoDtoList
.
stream
().
map
(
StationCacheInfoDto:
:
getInstalledCapacity
).
collect
(
Collectors
.
toList
()).
stream
().
mapToDouble
(
Double:
:
parseDouble
).
sum
();
hashMap
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
total
));
return
hashMap
;
}
public
Double
keepFourdecimalPlaces
(
Double
param
)
{
return
Double
.
valueOf
(
String
.
format
(
"%.4f"
,
param
));
}
...
...
@@ -526,4 +590,113 @@ public class MonitorServiceImpl implements MonitorService {
}
return
stationBasicListAll
;
}
public
Page
<
HashMap
<
String
,
String
>>
getPowerGenerationTrendsOfCompletionTopFive
(
String
areaName
)
{
Page
<
HashMap
<
String
,
String
>>
hashMapPage
=
new
Page
<>(
1
,
5
);
List
<
HashMap
<
String
,
String
>>
mapList
=
new
ArrayList
<>();
String
requestUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_month_top_url
+
"&topValue=5"
;
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
if
(
areaName
.
contains
(
Constants
.
areaChinese
)){
areaName
=
areaName
+
Constants
.
areaChinese
;
}
requestUrl
=
requestUrl
+
"&areaName="
+
areaName
;
}
List
<
BudunStationValueDto
>
budunStationValueDtoList
=
httpRequestUtil
.
getResPonse
(
requestUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BudunStationValueDto
.
class
);
HashMap
<
String
,
List
<
String
>>
hashMap
=
new
HashMap
<>();
budunStationValueDtoList
.
forEach
(
budunStationValueDto
->
{
HashMap
<
String
,
String
>
hashMap1
=
new
HashMap
<>();
hashMap1
.
put
(
"stationName"
,
budunStationValueDto
.
getStation_name
());
hashMap1
.
put
(
"value"
,
budunStationValueDto
.
getValue
()
+
"%"
);
hashMap1
.
put
(
"value1"
,
String
.
valueOf
(
budunStationValueDto
.
getValue
()));
mapList
.
add
(
hashMap1
);
});
hashMapPage
.
setRecords
(
mapList
);
return
hashMapPage
;
}
public
Page
<
SocialContributionDto
>
getSocialContributionDtoList
(
Double
totalSocialContribution
)
{
Page
<
SocialContributionDto
>
socialContributionDtoPage
=
new
Page
<
SocialContributionDto
>();
List
<
SocialContributionDto
>
socialContributionDtoList
=
new
ArrayList
<>();
//获取所有网关id不为空的数据
//二氧化碳贡献数
SocialContributionDto
co2
=
new
SocialContributionDto
();
//标准煤贡献度
SocialContributionDto
coal
=
new
SocialContributionDto
();
//碳粉尘计算公式
SocialContributionDto
toner
=
new
SocialContributionDto
();
//二氧化硫贡献度
SocialContributionDto
so2
=
new
SocialContributionDto
();
/** 社会贡献原始计算公式,后边的数据已经经过处理
发电量完成率=(月/年)发电量/(月/年)发电量指标
小时数完成率=(月/年)可利用小时/(月/年)可利用小时数指标
可利用小时(h)=(日/月/年)发电量(万kW·h)/装机容量(万kW)
二氧化碳减排量(万t)=发电量(万kW·h)*0.79
节约标准煤(万t)=发电量(万kW·h)*0.29
炭粉尘减排量(t)=发电量(万kW·h)*0.30
二氧化硫减排量(t)=发电量(万kW·h)*1.51
氮氧化物减排量(t)=发电量(万kW·h)*1.69
*/
co2
.
setUnit
(
CommonConstans
.
ER_YANG_HUA_TAN_JIANPAILIANG
);
co2
.
setTitle
(
String
.
format
(
"%.2f"
,
totalSocialContribution
*
CommonConstans
.
carbonDioxide
));
socialContributionDtoList
.
add
(
co2
);
coal
.
setUnit
(
CommonConstans
.
BIAO_ZHUN_MEI_JIANPAILIANG
);
coal
.
setTitle
(
String
.
format
(
"%.2f"
,
(
totalSocialContribution
*
CommonConstans
.
standardCoal
)));
socialContributionDtoList
.
add
(
coal
);
toner
.
setUnit
(
CommonConstans
.
TAN_FEN_CHEN_ZHUBIANDIYACE
);
toner
.
setTitle
(
String
.
format
(
"%.2f"
,
(
totalSocialContribution
*
CommonConstans
.
toner
)));
socialContributionDtoList
.
add
(
toner
);
so2
.
setUnit
(
CommonConstans
.
ER_YANG_HUA_LIU_ZHUBIANDIYACE
);
so2
.
setTitle
(
String
.
format
(
"%.2f"
,
(
totalSocialContribution
*
CommonConstans
.
sulfurDioxide
)));
socialContributionDtoList
.
add
(
so2
);
socialContributionDtoPage
.
setRecords
(
socialContributionDtoList
);
socialContributionDtoPage
.
setTotal
(
100
);
socialContributionDtoPage
.
setCurrent
(
1
);
return
socialContributionDtoPage
;
}
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
>
fdzList
=
new
ArrayList
<>();
List
<
StationBasic
>
gfdzlist
=
new
ArrayList
<>();
String
requestUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_hours_num_top
+
"&topValue=3&tabValue="
+
tabValue
;
if
(!
ObjectUtils
.
isEmpty
(
areaName
))
{
if
(
areaName
.
contains
(
Constants
.
areaChinese
)){
areaName
=
areaName
+
Constants
.
areaChinese
;
}
requestUrl
=
requestUrl
+
"&areaName="
+
areaName
;
}
List
<
BuDunPvFanDto
>
buDunPvFanDtos
=
httpRequestUtil
.
getResPonse
(
requestUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunPvFanDto
.
class
);
if
(
buDunPvFanDtos
.
size
()>
0
){
BuDunPvFanDto
buDunPvFanDto
=
buDunPvFanDtos
.
get
(
0
);
int
length
=
buDunPvFanDto
.
getFan
().
size
()>=
buDunPvFanDto
.
getPv
().
size
()?
buDunPvFanDto
.
getFan
().
size
():
buDunPvFanDto
.
getPv
().
size
();
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
HashMap
<
String
,
String
>
stringHashMap
=
new
HashMap
<>();
stringHashMap
.
put
(
"sortNumber"
,
String
.
valueOf
(
i
+
1
));
if
(
i
<
(
buDunPvFanDto
.
getFan
().
size
()))
{
BudunStationValueDto
budunStationValueDto
=
buDunPvFanDto
.
getFan
().
get
(
i
);
stringHashMap
.
put
(
"stationName1"
,
budunStationValueDto
.
getStation_name
());
stringHashMap
.
put
(
"hours1"
,
budunStationValueDto
.
getValue
()
+
"h"
);
}
else
{
stringHashMap
.
put
(
"stationName1"
,
""
);
stringHashMap
.
put
(
"hours1"
,
"0.00h"
);
}
if
(
i
<
(
buDunPvFanDto
.
getPv
().
size
()))
{
BudunStationValueDto
budunStationValueDto
=
buDunPvFanDto
.
getPv
().
get
(
i
);
stringHashMap
.
put
(
"stationName2"
,
budunStationValueDto
.
getStation_name
());
stringHashMap
.
put
(
"hours2"
,
budunStationValueDto
.
getValue
()
+
"h"
);
}
else
{
stringHashMap
.
put
(
"stationName2"
,
""
);
stringHashMap
.
put
(
"hours2"
,
"0.00h"
);
}
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