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
cf97c5f6
Commit
cf97c5f6
authored
Apr 02, 2024
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.监盘首页运维概况使用新数据源编写。
parent
134cd187
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
5 deletions
+75
-5
StationBasic.java
...ejoin/amos/boot/module/jxiop/api/entity/StationBasic.java
+1
-1
StationCacheInfoDto.java
...n/amos/boot/module/jxiop/biz/dto/StationCacheInfoDto.java
+4
-4
MonitorService.java
...in/amos/boot/module/jxiop/biz/service/MonitorService.java
+26
-0
MonitorServiceImpl.java
...oot/module/jxiop/biz/service/impl/MonitorServiceImpl.java
+44
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/entity/StationBasic.java
View file @
cf97c5f6
...
...
@@ -173,5 +173,5 @@ public class StationBasic extends BaseEntity {
* 装机容量
*/
@TableField
(
"installed_capacity"
)
private
Double
installedCapacity
;
private
Double
installedCapacity
=
0.0
;
}
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 @
cf97c5f6
...
...
@@ -21,7 +21,7 @@ public class StationCacheInfoDto implements Serializable {
//所属片区
private
String
belongArea
;
//装机容量
private
String
installedCapacity
;
private
String
installedCapacity
=
"0.0"
;
//设备数量
private
String
equipmentNumbers
;
//风机网关
...
...
@@ -30,10 +30,10 @@ public class StationCacheInfoDto implements Serializable {
private
String
boosterGatewayId
;
//片区code
private
String
areaCode
;
//
//
address
private
String
address
;
//core服务配置的场站名称
private
String
stationCoreName
;
//core服务配置的升压站名称
private
String
boosterCoreName
;
}
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 @
cf97c5f6
...
...
@@ -3,10 +3,36 @@ package com.yeejoin.amos.boot.module.jxiop.biz.service;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.RegionNationWideDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.ResultsData
;
import
java.util.HashMap
;
import
java.util.List
;
public
interface
MonitorService
{
/**
* @description 获取运行监盘全国屏总数数据
*/
public
void
getTotalData
();
/**
* @description 根据省份名称、type字段等判断动态获取地图图钉数据
* @param provinceName 省份名称
* @param type gis、station
* @return 地图图钉数据列表
*/
public
List
<
RegionNationWideDto
>
getNationWideInfo
(
String
provinceName
,
String
type
);
/**
* @description 根据省份名称获取动态表格数据
* @param current 当前页
* @param size 分页大小
* @param provinceName 省份名称
* @return 动态表格数据
*/
public
ResultsData
getCompletionOfPowerIndicatorsByProvinceName
(
int
current
,
int
size
,
String
provinceName
);
/**
* @description 根据地区名称获取有功功率数据
* @param areaName
* @return 有功功率
*/
public
HashMap
<
String
,
String
>
getActivePowerByAreaName
(
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 @
cf97c5f6
...
...
@@ -23,6 +23,8 @@ 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
...
...
@@ -432,8 +434,50 @@ 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
);
HashMap
<
String
,
String
>
hashMap
=
new
HashMap
<>();
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
());
}
total
=
coreCommonService
.
getSumOfByPointName
(
coreValuesDtos
,
CommonConstans
.
ACTIVE_POWER
);
//有功功率换算
hashMap
.
put
(
"title"
,
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
total
));
return
hashMap
;
}
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
());
}
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
));
}
public
List
<
StationBasic
>
getListOfStationBasicByAreaName
(
String
areaName
)
{
List
<
StationBasic
>
stationBasicListAll
=
new
ArrayList
<>();
MapRegion
mapRegion
=
mapRegionMapper
.
selectOne
(
new
QueryWrapper
<
MapRegion
>().
eq
(
"name"
,
areaName
));
//获取片区下的省份名称
ArrayList
<
String
>
stringArrayList
=
mapRegion
.
getProvince
();
//变量获取所有的场站信息
for
(
int
i
=
0
;
i
<
stringArrayList
.
size
();
i
++)
{
Region
region
=
regionMapper
.
selectOne
(
new
QueryWrapper
<
Region
>().
eq
(
"LEVEL"
,
1
).
like
(
"REGION_NAME"
,
stringArrayList
.
get
(
i
)));
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
like
(
"belong_area"
,
region
.
getRegionCode
()));
stationBasicListAll
.
addAll
(
stationBasicList
);
}
return
stationBasicListAll
;
}
}
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