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
675f68aa
Commit
675f68aa
authored
Sep 28, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
90171a85
bf4c4b37
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
21 deletions
+82
-21
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+1
-1
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+35
-2
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+36
-10
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+1
-1
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+9
-7
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/MonitorFanIdxController.java
View file @
675f68aa
...
...
@@ -651,7 +651,7 @@ public class MonitorFanIdxController extends BaseController {
List
<
Map
<
String
,
Object
>>
mapList
;
for
(
String
column
:
columnList
)
{
Double
result
=
commonServiceImpl
.
getTotalByIndicatiorByGF
(
gatewayId
,
column
);
Double
result
=
commonServiceImpl
.
getTotalByIndicatiorByGF
(
gatewayId
,
column
);
if
(
column
.
equals
(
"日发电量"
))
{
columnMap
.
put
(
column
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
result
*
CommonConstans
.
pvGenPoweActorDay
));
}
else
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
675f68aa
...
...
@@ -177,6 +177,39 @@ public class CommonServiceImpl {
return
socialContributionDtoPage
;
}
public
<
T
>
List
<
T
>
getListDataByCondtion
(
Map
<
String
,
List
<
String
>>
mustQuerCondtion
,
Map
<
String
,
String
>
shouldQuerCondtion
,
Class
<
T
>
tClass
,
Map
<
String
,
String
>
likeQuerCondtion
)
{
BoolQueryBuilder
queryBuilder
=
QueryBuilders
.
boolQuery
();
if
(!
ObjectUtils
.
isEmpty
(
mustQuerCondtion
))
{
for
(
String
key
:
mustQuerCondtion
.
keySet
())
{
List
<
String
>
va
=
mustQuerCondtion
.
get
(
key
);
queryBuilder
.
must
(
QueryBuilders
.
termsQuery
(
key
,
va
));
}
}
if
(!
ObjectUtils
.
isEmpty
(
shouldQuerCondtion
))
{
for
(
String
key
:
shouldQuerCondtion
.
keySet
())
{
queryBuilder
.
should
(
QueryBuilders
.
wildcardQuery
(
key
,
shouldQuerCondtion
.
get
(
key
)));
}
}
if
(!
ObjectUtils
.
isEmpty
(
likeQuerCondtion
))
{
for
(
String
key
:
likeQuerCondtion
.
keySet
())
{
queryBuilder
.
must
(
QueryBuilders
.
wildcardQuery
(
key
,
"*"
+
likeQuerCondtion
.
get
(
key
)
+
"*"
));
}
}
Query
query
=
new
NativeSearchQueryBuilder
()
.
withQuery
(
queryBuilder
)
.
build
();
query
.
setTrackTotalHits
(
true
);
SearchHits
search
=
elasticsearchTemplate
.
search
(
query
,
tClass
);
if
(
search
.
hasSearchHits
())
{
List
<
SearchHit
<
T
>>
searchHitList
=
search
.
getSearchHits
();
List
<
T
>
list
=
searchHitList
.
stream
().
map
(
hit
->
hit
.
getContent
()).
collect
(
Collectors
.
toList
());
return
list
;
}
return
null
;
}
public
List
<
StationCacheInfoDto
>
getListStationCacheInfoDto
()
{
List
<
StationCacheInfoDto
>
stationCacheInfoDtos
=
new
ArrayList
<>();
List
<
Region
>
regionList
=
regionMapper
.
selectList
(
new
QueryWrapper
<
Region
>().
eq
(
"LEVEL"
,
1
));
...
...
@@ -213,7 +246,7 @@ public class CommonServiceImpl {
queryBuilder
.
must
(
QueryBuilders
.
termsQuery
(
key
,
va
));
}
TermsAggregationBuilder
tb1
=
AggregationBuilders
.
terms
(
"groupKey"
).
field
(
groupKey
);
TermsAggregationBuilder
tb1
=
AggregationBuilders
.
terms
(
"groupKey"
).
field
(
groupKey
)
.
size
(
1000
)
;
SumAggregationBuilder
buyCountSum
=
AggregationBuilders
.
sum
(
"buyCountSum"
).
field
(
keyavg
);
tb1
.
subAggregation
(
buyCountSum
);
// 通过typeId字段分组统计总数
Query
query
=
new
NativeSearchQueryBuilder
()
...
...
@@ -262,7 +295,7 @@ public class CommonServiceImpl {
queryBuilder
.
must
(
QueryBuilders
.
termsQuery
(
key
,
va
));
}
TermsAggregationBuilder
tb1
=
AggregationBuilders
.
terms
(
"groupKey"
).
field
(
groupKey
);
TermsAggregationBuilder
tb1
=
AggregationBuilders
.
terms
(
"groupKey"
).
field
(
groupKey
)
.
size
(
1000
)
;
AvgAggregationBuilder
buyCountAvg
=
AggregationBuilders
.
avg
(
"buyCountAvg"
).
field
(
keyavg
);
tb1
.
subAggregation
(
buyCountAvg
);
// 通过typeId字段分组统计总数
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
675f68aa
...
...
@@ -1922,18 +1922,40 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public
Map
<
String
,
Object
>
generatingCapacity
(
String
gatewayId
,
String
query
){
String
querySql
=
" SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentIndexName=~/发电量/"
;
if
(
null
!=
query
){
querySql
=
querySql
+
" "
+
query
;
// String querySql = " SELECT * FROM indicators_"+gatewayId+" WHERE equipmentIndexName=~/发电量/";
// if (null != query){
// querySql = querySql + " "+ query;
// }
// List<IndicatorsDto> queryList = influxDButils.getListData(querySql,IndicatorsDto.class);
// Map<String, List<IndicatorsDto>> maps = queryList.stream().collect(Collectors.groupingBy(IndicatorsDto::getEquipmentIndexName));
// Map<String, Object> hashMap = new HashMap<>();
// for (String s : maps.keySet()) {
// List<IndicatorsDto> indicatorsDtos = maps.get(s);
// Double totalvalue =indicatorsDtos.stream().filter(obj -> !ObjectUtils.isEmpty(obj.getValue())).mapToDouble(l->Double.parseDouble(l.getValue())).sum();
// hashMap.put(s,totalvalue);
// }
// return hashMap;
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
,
"年发电量"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
gatewayId
));
Map
<
String
,
String
>
likeQuerCondtion
=
new
HashMap
<>();
if
(
query
!=
null
){
likeQuerCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
}
List
<
IndicatorsDto
>
queryList
=
influxDButils
.
getListData
(
querySql
,
IndicatorsDto
.
class
);
Map
<
String
,
List
<
IndicatorsDto
>>
maps
=
queryList
.
stream
().
collect
(
Collectors
.
groupingBy
(
IndicatorsDto:
:
getEquipmentIndexName
));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeQuerCondtion
);
Double
powerOfDayFD
=
0.0000
;
Double
powerOfMonthFD
=
0.0000
;
Double
powerOfAnnualFD
=
0.0000
;
powerOfDayFD
=
powerOfDayFD
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
));
powerOfMonthFD
=
powerOfMonthFD
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
));
powerOfAnnualFD
=
powerOfAnnualFD
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
));
Map
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
for
(
String
s
:
maps
.
keySet
())
{
List
<
IndicatorsDto
>
indicatorsDtos
=
maps
.
get
(
s
);
Double
totalvalue
=
indicatorsDtos
.
stream
().
filter
(
obj
->
!
ObjectUtils
.
isEmpty
(
obj
.
getValue
())).
mapToDouble
(
l
->
Double
.
parseDouble
(
l
.
getValue
())).
sum
();
hashMap
.
put
(
s
,
totalvalue
);
}
hashMap
.
put
(
"日发电量"
,
powerOfDayFD
);
hashMap
.
put
(
"月发电量"
,
powerOfMonthFD
);
hashMap
.
put
(
"年发电量"
,
powerOfAnnualFD
);
return
hashMap
;
}
...
...
@@ -1952,6 +1974,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return
"0"
;
}
public
Double
keepFourdecimalPlaces
(
Double
param
)
{
return
Double
.
valueOf
(
String
.
format
(
"%.4f"
,
param
));
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitoringServiceImpl.java
View file @
675f68aa
...
...
@@ -868,7 +868,7 @@ public class MonitoringServiceImpl {
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
Like
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
powerOfDayGF
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
));
powerOfMonthGF
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
));
powerOfAnnualGF
.
updateAndGet
(
v
->
v
+
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
));
...
...
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 @
675f68aa
...
...
@@ -205,7 +205,7 @@ public class MonitoringServiceImpl {
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationCacheInfoDto
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
completionOfPowerIndicatorsDto
.
setWindSpeedOrIrradiance
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getAvagerByEquipmentIndxName
(
result
,
"30秒平均风速"
)));
completionOfPowerIndicatorsDto
.
setActivePower
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"
)
/
1000
)));
completionOfPowerIndicatorsDto
.
setActivePower
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"
))));
completionOfPowerIndicatorsDto
.
setDailyPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)));
completionOfPowerIndicatorsDto
.
setMonthlyPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)));
completionOfPowerIndicatorsDto
.
setAnnualPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)));
...
...
@@ -221,7 +221,7 @@ public class MonitoringServiceImpl {
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeQuerCondtion
);
List
<
ESEquipments
>
result1
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion1
,
null
,
ESEquipments
.
class
);
completionOfPowerIndicatorsDto
.
setWindSpeedOrIrradiance
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"WTX-801_25_WTX-801_总辐射"
)));
completionOfPowerIndicatorsDto
.
setActivePower
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"南瑞光差保护_313P"
)
*
CommonConstans
.
kwToMv
));
completionOfPowerIndicatorsDto
.
setActivePower
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result1
,
"南瑞光差保护_313P"
)));
completionOfPowerIndicatorsDto
.
setDailyPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
completionOfPowerIndicatorsDto
.
setMonthlyPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
completionOfPowerIndicatorsDto
.
setAnnualPower
(
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
...
...
@@ -286,7 +286,9 @@ public class MonitoringServiceImpl {
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
"日发电量"
,
"月发电量"
,
"年发电量"
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationCacheInfoDto
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
Map
<
String
,
String
>
likeQuerCondtion
=
new
HashMap
<>();
likeQuerCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
likeQuerCondtion
);
dailyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"日发电量"
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
));
monthlyPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"月发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
annualPower
.
updateAndGet
(
v
->
v
+
keepFourdecimalPlaces
(
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
"年发电量"
)
*
CommonConstans
.
pvGenPoweActor
));
...
...
@@ -588,7 +590,7 @@ public class MonitoringServiceImpl {
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
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
eq
(
"station_type"
,
"FDZ"
).
isNotNull
(
"fan_gateway_id"
));
List
<
StationBasic
>
stationBasicList
=
stationBasicMapper
.
selectList
(
new
QueryWrapper
<
StationBasic
>().
isNotNull
(
"fan_gateway_id"
));
//日发电量
AtomicReference
<
Double
>
dailyPower
=
new
AtomicReference
<>(
0.0
);
//月发电量
...
...
@@ -777,14 +779,14 @@ public class MonitoringServiceImpl {
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
Map
<
String
,
String
>
shouldQueryCondtion
=
new
HashMap
<>();
shouldQueryCondtion
.
put
(
CommonConstans
.
QueryStringFrontMoudle
,
"逆变器"
);
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
shouldQueryCondtion
,
ESEquipments
.
class
);
total
=
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
;
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
,
shouldQueryCondtion
);
total
=
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
;
}
else
{
Map
<
String
,
List
<
String
>>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
CommonConstans
.
QueryStringEquipmentIndexName
,
Arrays
.
asList
(
finalIndicator
));
queryCondtion
.
put
(
CommonConstans
.
QueryStringGateWayId
,
Arrays
.
asList
(
stationBasic
.
getFanGatewayId
()));
List
<
ESEquipments
>
result
=
commonServiceImpl
.
getListDataByCondtions
(
queryCondtion
,
null
,
ESEquipments
.
class
);
total
=
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
)
*
CommonConstans
.
pvGenPoweActor
;
total
=
commonServiceImpl
.
getSumByEquipmentIndxName
(
result
,
finalIndicator
);
}
stationBasic
.
setAddress
(
String
.
format
(
CommonConstans
.
Twodecimalplaces
,
(
total
*
10
)
/
install
));
if
(
stationBasic
.
getAddress
().
equals
(
"NaN"
))
{
...
...
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