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
ba5d6b6b
Commit
ba5d6b6b
authored
Oct 11, 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
f29da542
f380f2df
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
12 deletions
+57
-12
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+49
-11
LargeScreenImpl.java
...s/boot/module/jxiop/biz/service/impl/LargeScreenImpl.java
+8
-1
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 @
ba5d6b6b
...
...
@@ -26,6 +26,7 @@ import org.apache.commons.collections.CollectionUtils;
import
org.apache.commons.io.IOUtils
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
import
org.elasticsearch.index.query.BoolQueryBuilder
;
import
org.elasticsearch.index.query.MatchPhraseQueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilder
;
import
org.elasticsearch.index.query.QueryBuilders
;
import
org.elasticsearch.search.aggregations.Aggregation
;
...
...
@@ -121,7 +122,7 @@ public class MonitorFanIdxController extends BaseController {
list
.
add
(
date1
);
Map
<
String
,
Object
>
queryCondtion
=
new
HashMap
<>();
queryCondtion
.
put
(
"color"
,
stationBasic
.
getQrcodeColor
());
queryCondtion
.
put
(
"dat
e
"
,
list
);
queryCondtion
.
put
(
"dat
a
"
,
list
);
return
ResponseHelper
.
buildResponse
(
queryCondtion
);
}
...
...
@@ -1083,7 +1084,13 @@ public class MonitorFanIdxController extends BaseController {
List
<
String
>
list
=
Arrays
.
asList
(
keys
);
BoolQueryBuilder
boolQueryBuilder
=
QueryBuilders
.
boolQuery
();
if
(!
stationBasic
.
getStationType
().
equals
(
"FDZ"
))
{
boolQueryBuilder
.
must
((
QueryBuilders
.
termsQuery
(
"equipmentIndexName.keyword"
,
CommonConstans
.
taiHeGenIndicator
))).
must
(
QueryBuilders
.
matchQuery
(
"gatewayId.keyword"
,
stationBasic
.
getBoosterGatewayId
()));
MatchPhraseQueryBuilder
queryBuilder1
=
QueryBuilders
.
matchPhraseQuery
(
CommonConstans
.
QueryStringFrontMoudleNotKeyWord
,
"*逆变器*"
);
boolQueryBuilder
.
must
((
QueryBuilders
.
termsQuery
(
"equipmentIndexName.keyword"
,
list
))
).
must
(
QueryBuilders
.
matchQuery
(
"gatewayId.keyword"
,
stationBasic
.
getFanGatewayId
()));
boolQueryBuilder
.
must
(
queryBuilder1
);
}
else
{
boolQueryBuilder
.
must
((
QueryBuilders
.
termsQuery
(
"equipmentIndexName.keyword"
,
list
))).
must
(
QueryBuilders
.
matchQuery
(
"gatewayId.keyword"
,
gatewayId
));
...
...
@@ -1117,33 +1124,56 @@ public class MonitorFanIdxController extends BaseController {
map
.
put
(
"num"
,
key
);
for
(
ESEquipments
equip
:
resultMap
.
get
(
key
))
{
String
value
=
String
.
format
(
"%.4f"
,
equip
.
getValueF
());
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
))
{
map
.
put
(
"name"
,
equip
.
getEquipmentSpecificName
().
substring
(
0
,
equip
.
getEquipmentSpecificName
().
indexOf
(
"#"
))+
"/"
+
key
);
}
else
{
map
.
put
(
"name"
,
key
);
}
if
(!
stationBasic
.
getStationType
().
equals
(
"FDZ"
))
{
switch
(
equip
.
getEquipmentIndexName
())
{
case
"日发电量"
:
map
.
put
(
"dayNum"
,
value
);
map
.
put
(
"dayNum"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
Double
.
valueOf
(
value
)
*
CommonConstans
.
pvGenPoweActor
*
CommonConstans
.
pvGenPoweActorDay
)
);
break
;
case
"月发电量"
:
map
.
put
(
"monthNum"
,
value
);
map
.
put
(
"monthNum"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
Double
.
valueOf
(
value
)
*
CommonConstans
.
pvGenPoweActorCurrentData
)
);
break
;
case
"年发电量"
:
map
.
put
(
"yearNum"
,
value
);
case
CommonConstans
.
taiHeGenIndicatorDay
:
map
.
put
(
"yearNum"
,
String
.
format
(
CommonConstans
.
Fourdecimalplaces
,
Double
.
valueOf
(
value
)
*
CommonConstans
.
pvGenPoweActorCurrentData
));
}
}
else
{
switch
(
equip
.
getEquipmentIndexName
())
{
case
"日发电量"
:
map
.
put
(
"dayNum"
,
value
);
break
;
case
CommonConstans
.
taiHeGenIndicatorMonth
:
case
"月发电量"
:
map
.
put
(
"monthNum"
,
value
);
break
;
case
CommonConstans
.
taiHeGenIndicatorYear
:
case
"年发电量"
:
map
.
put
(
"yearNum"
,
value
);
break
;
// case CommonConstans.taiHeGenIndicatorDay:
// map.put("dayNum", value);
// break;
// case CommonConstans.taiHeGenIndicatorMonth:
// map.put("monthNum", value);
// break;
// case CommonConstans.taiHeGenIndicatorYear:
// map.put("yearNum", value);
// break;
}
}
}
esEquipmentsMap
.
add
(
map
);
}
if
(
stationBasic
.
getStationType
().
equals
(
"FDZ"
))
{
this
.
sortByFeild
(
esEquipmentsMap
,
"num"
);
}
else
{
this
.
sortByFeildString
(
esEquipmentsMap
,
"num"
);
this
.
sortByFeild
(
esEquipmentsMap
,
"num"
);
}
IPage
<
Map
<
String
,
Object
>>
page
=
new
Page
<>();
page
.
setTotal
(
esEquipmentsMap
.
size
());
page
.
setSize
(
999
);
...
...
@@ -1172,6 +1202,14 @@ public class MonitorFanIdxController extends BaseController {
return
list
;
}
public
static
List
<
Map
<
String
,
Object
>>
sortByFeildString
(
List
<
Map
<
String
,
Object
>>
list
,
String
feild
)
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
Collections
.
sort
(
list
,
(
m1
,
m2
)->
String
.
valueOf
(
m1
.
get
(
feild
).
toString
()).
compareTo
(
String
.
valueOf
(
m2
.
get
(
feild
).
toString
())));
}
return
list
;
}
//@Scheduled(cron = "0/10 * * * * ? ")
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/LargeScreenImpl.java
View file @
ba5d6b6b
...
...
@@ -217,8 +217,15 @@ public class LargeScreenImpl {
mapdta
.
put
(
"NJHWC"
,
0
d
);
//平均数
List
<
String
>
value
=
new
ArrayList
<>();
List
<
String
>
ids
=
new
ArrayList
<>();
for
(
StationCacheInfoDto
stationCacheInfoDto
:
gatewayId
)
{
ids
.
add
(
stationCacheInfoDto
.
getFanGatewayId
());
ids
.
add
(
stationCacheInfoDto
.
getBoosterGatewayId
());
}
// List<String> ids = gatewayId.stream().map(StationCacheInfoDto::getFanGatewayId).collect(Collectors.toList());
List
<
String
>
ids
=
gatewayId
.
stream
().
map
(
StationCacheInfoDto:
:
getFanGatewayId
).
collect
(
Collectors
.
toList
());
value
.
add
(
SS
);
value
.
add
(
ZFS
);
value
.
add
(
ZFSLJ
);
...
...
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