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
5ea327e8
Commit
5ea327e8
authored
Apr 08, 2024
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
ecb26a21
405e450b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
12 deletions
+66
-12
BudunStationValueDto.java
.../amos/boot/module/jxiop/api/dto/BudunStationValueDto.java
+1
-0
MonitorService.java
...in/amos/boot/module/jxiop/biz/service/MonitorService.java
+11
-2
MonitorServiceImpl.java
...oot/module/jxiop/biz/service/impl/MonitorServiceImpl.java
+54
-10
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/dto/BudunStationValueDto.java
View file @
5ea327e8
...
...
@@ -6,4 +6,5 @@ import lombok.Data;
public
class
BudunStationValueDto
{
private
String
station_name
;
private
Double
value
;
private
Double
genValue
;
}
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 @
5ea327e8
...
...
@@ -58,15 +58,24 @@ public interface MonitorService {
/**
* @Description 根据areaCode获取全国发电量趋势
* @param areaCode
* @param areaCode
区域code
* @return SeriesData
*/
SeriesData
getSeriesDataqy
(
String
areaCode
);
/**
* @Descripiton 根据入参动态获取社会贡献
* @param areaCode
* @param areaCode
区域code
* @return
*/
Page
<
HashMap
<
String
,
String
>>
socialContribution
(
String
areaCode
);
/**
* @Description 根据入参动态获取发电量排名
* @param day 参数类型用于判断是日发电小时数、月发电小时数、年发电小时数
* @param type 类型 风电或者光伏
* @param areaCode 区域code
* @return
*/
Page
<
Map
<
String
,
Object
>>
stationRanking
(
String
day
,
String
type
,
String
areaCode
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorServiceImpl.java
View file @
5ea327e8
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.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.api.Enum.StationType
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.BuDunGenDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.BudunDayGenTrendDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.BudunMonthTrendDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.BundunCompleteDto
;
import
com.yeejoin.amos.boot.module.jxiop.api.dto.*
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.MapRegion
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.Region
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
...
...
@@ -310,14 +308,14 @@ public class MonitorServiceImpl implements MonitorService {
MapRegion
mapRegion
=
mapRegionMapper
.
selectOne
(
new
QueryWrapper
<
MapRegion
>().
eq
(
"areaCode"
,
areaCode
));
String
areaName
=
""
;
if
(!
ObjectUtils
.
isEmpty
(
mapRegion
)
&&
!
ObjectUtils
.
isEmpty
(
mapRegion
.
getName
())
&&
!
mapRegion
.
getName
().
contains
(
Constants
.
areaChinese
))
{
areaName
=
mapRegion
.
getName
()
+
Constants
.
areaChinese
;
areaName
=
mapRegion
.
getName
()
+
Constants
.
areaChinese
;
}
String
requestUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_area_item_url
;
if
(
areaCode
!=
null
)
{
requestUrl
=
requestUrl
+
"&areaName="
+
areaName
;
String
requestUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_area_item_url
;
if
(
areaCode
!=
null
)
{
requestUrl
=
requestUrl
+
"&areaName="
+
areaName
;
}
List
<
BuDunGenDto
>
buDunGenDtos
=
httpRequestUtil
.
getResPonse
(
requestUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunGenDto
.
class
);
if
(
buDunGenDtos
.
size
()>
0
)
{
List
<
BuDunGenDto
>
buDunGenDtos
=
httpRequestUtil
.
getResPonse
(
requestUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunGenDto
.
class
);
if
(
buDunGenDtos
.
size
()
>
0
)
{
totalAnnual
=
buDunGenDtos
.
get
(
0
).
getYear
();
}
Page
<
HashMap
<
String
,
String
>>
page3
=
new
Page
<>(
1
,
10
);
...
...
@@ -341,4 +339,50 @@ public class MonitorServiceImpl implements MonitorService {
page3
.
setRecords
(
list3
);
return
page3
;
}
@Override
public
Page
<
Map
<
String
,
Object
>>
stationRanking
(
String
day
,
String
type
,
String
areaCode
)
{
String
areaName
=
""
;
String
requestUrl
=
Constants
.
BASE_URL
+
"?"
+
Constants
.
get_hours_num_top
+
"&topValue=5&tabValue="
+
day
;
if
(
areaCode
!=
null
)
{
MapRegion
mapRegion
=
mapRegionMapper
.
selectOne
(
new
QueryWrapper
<
MapRegion
>().
eq
(
"areaCode"
,
areaCode
));
if
(!
ObjectUtils
.
isEmpty
(
mapRegion
)
&&
!
ObjectUtils
.
isEmpty
(
mapRegion
.
getName
())
&&
!
mapRegion
.
getName
().
contains
(
Constants
.
areaChinese
))
{
areaName
=
mapRegion
.
getName
()
+
Constants
.
areaChinese
;
}
requestUrl
=
requestUrl
+
"&areaName="
+
areaName
;
}
List
<
BuDunPvFanDto
>
buDunPvFanDtos
=
httpRequestUtil
.
getResPonse
(
requestUrl
,
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
,
BuDunPvFanDto
.
class
);
List
<
BudunStationValueDto
>
pvList
=
new
ArrayList
<>();
List
<
BudunStationValueDto
>
fanList
=
new
ArrayList
<>();
if
(
buDunPvFanDtos
.
size
()
>
0
)
{
BuDunPvFanDto
buDunPvFanDto
=
buDunPvFanDtos
.
get
(
0
);
pvList
=
buDunPvFanDtos
.
get
(
0
).
getPv
();
fanList
=
buDunPvFanDtos
.
get
(
0
).
getFan
();
}
List
<
Map
<
String
,
Object
>>
dayDataFan
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
dayDataPV
=
new
ArrayList
<>();
fanList
.
stream
().
forEach
(
fan
->{
Map
<
String
,
Object
>
dayMap
=
new
HashMap
<>();
dayMap
.
put
(
"name"
,
fan
.
getStation_name
());
dayMap
.
put
(
"value"
,
fan
.
getGenValue
());
dayDataFan
.
add
(
dayMap
);
});
pvList
.
stream
().
forEach
(
pv
->{
Map
<
String
,
Object
>
dayMap
=
new
HashMap
<>();
dayMap
.
put
(
"name"
,
pv
.
getStation_name
());
dayMap
.
put
(
"value"
,
pv
.
getGenValue
());
dayDataPV
.
add
(
dayMap
);
});
Page
<
Map
<
String
,
Object
>>
socialContributionDtoPage
=
new
Page
<
Map
<
String
,
Object
>>();
socialContributionDtoPage
.
setCurrent
(
1
);
socialContributionDtoPage
.
setTotal
(
100
);
if
(
"gf"
.
equals
(
type
))
{
socialContributionDtoPage
.
setRecords
(
dayDataPV
);
}
else
{
socialContributionDtoPage
.
setRecords
(
dayDataFan
);
}
return
socialContributionDtoPage
;
}
}
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