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
9ca6f5bf
Commit
9ca6f5bf
authored
Sep 28, 2023
by
caotao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
f21cfcf3
2dad2cc8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
12 deletions
+71
-12
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+0
-0
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+33
-0
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+36
-10
MonitoringServiceImpl.java
.../module/jxiop/biz/service/impl/MonitoringServiceImpl.java
+2
-2
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 @
9ca6f5bf
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 @
9ca6f5bf
...
@@ -177,6 +177,39 @@ public class CommonServiceImpl {
...
@@ -177,6 +177,39 @@ public class CommonServiceImpl {
return
socialContributionDtoPage
;
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
()
{
public
List
<
StationCacheInfoDto
>
getListStationCacheInfoDto
()
{
List
<
StationCacheInfoDto
>
stationCacheInfoDtos
=
new
ArrayList
<>();
List
<
StationCacheInfoDto
>
stationCacheInfoDtos
=
new
ArrayList
<>();
List
<
Region
>
regionList
=
regionMapper
.
selectList
(
new
QueryWrapper
<
Region
>().
eq
(
"LEVEL"
,
1
));
List
<
Region
>
regionList
=
regionMapper
.
selectList
(
new
QueryWrapper
<
Region
>().
eq
(
"LEVEL"
,
1
));
...
...
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 @
9ca6f5bf
...
@@ -1922,18 +1922,40 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -1922,18 +1922,40 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public
Map
<
String
,
Object
>
generatingCapacity
(
String
gatewayId
,
String
query
){
public
Map
<
String
,
Object
>
generatingCapacity
(
String
gatewayId
,
String
query
){
String
querySql
=
" SELECT * FROM indicators_"
+
gatewayId
+
" WHERE equipmentIndexName=~/发电量/"
;
// String querySql = " SELECT * FROM indicators_"+gatewayId+" WHERE equipmentIndexName=~/发电量/";
if
(
null
!=
query
){
// if (null != query){
querySql
=
querySql
+
" "
+
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
<>();
Map
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
for
(
String
s
:
maps
.
keySet
())
{
hashMap
.
put
(
"日发电量"
,
powerOfDayFD
);
List
<
IndicatorsDto
>
indicatorsDtos
=
maps
.
get
(
s
);
hashMap
.
put
(
"月发电量"
,
powerOfMonthFD
);
Double
totalvalue
=
indicatorsDtos
.
stream
().
filter
(
obj
->
!
ObjectUtils
.
isEmpty
(
obj
.
getValue
())).
mapToDouble
(
l
->
Double
.
parseDouble
(
l
.
getValue
())).
sum
();
hashMap
.
put
(
"年发电量"
,
powerOfAnnualFD
);
hashMap
.
put
(
s
,
totalvalue
);
}
return
hashMap
;
return
hashMap
;
}
}
...
@@ -1952,6 +1974,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -1952,6 +1974,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
return
"0"
;
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 @
9ca6f5bf
...
@@ -819,8 +819,8 @@ public class MonitoringServiceImpl {
...
@@ -819,8 +819,8 @@ public class MonitoringServiceImpl {
//装机容量
//装机容量
HashMap
<
String
,
String
>
stringHashMap
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap
=
new
HashMap
<>();
BigDecimal
totalInstall
=
new
BigDecimal
(
getInstallCapity
(
stationBasicListAll
));
BigDecimal
totalInstall
=
new
BigDecimal
(
getInstallCapity
(
stationBasicListAll
));
stringHashMap
.
put
(
"title"
,
totalInstall
.
toString
());
//
stringHashMap.put("title", totalInstall.toString());
stringHashMap
.
put
(
"data"
,
""
);
//
stringHashMap.put("data", "");
// list.add(stringHashMap);
// list.add(stringHashMap);
//风电站
//风电站
HashMap
<
String
,
String
>
stringHashMap1
=
new
HashMap
<>();
HashMap
<
String
,
String
>
stringHashMap1
=
new
HashMap
<>();
...
...
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