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
23f55cc2
Commit
23f55cc2
authored
Oct 10, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改风机型号,以及风机信息按编号排序
parent
7d94387f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
MonitorFanIdxController.java
.../module/jxiop/biz/controller/MonitorFanIdxController.java
+18
-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 @
23f55cc2
...
...
@@ -22,6 +22,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitorFanIndicatorIm
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.MonitoringServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
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
;
...
...
@@ -1113,9 +1114,11 @@ public class MonitorFanIdxController extends BaseController {
Map
<
String
,
List
<
ESEquipments
>>
resultMap
=
equipments
.
stream
().
collect
(
Collectors
.
groupingBy
(
ESEquipments:
:
getEquipmentNumber
));
for
(
String
key
:
resultMap
.
keySet
())
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"n
ame
"
,
key
);
map
.
put
(
"n
um
"
,
key
);
for
(
ESEquipments
equip
:
resultMap
.
get
(
key
))
{
String
value
=
String
.
format
(
"%.4f"
,
equip
.
getValueF
());
map
.
put
(
"name"
,
equip
.
getEquipmentSpecificName
().
substring
(
0
,
equip
.
getEquipmentSpecificName
().
indexOf
(
"#"
))+
"/"
+
key
);
switch
(
equip
.
getEquipmentIndexName
())
{
case
"日发电量"
:
map
.
put
(
"dayNum"
,
value
);
...
...
@@ -1138,6 +1141,9 @@ public class MonitorFanIdxController extends BaseController {
}
esEquipmentsMap
.
add
(
map
);
}
this
.
sortByFeild
(
esEquipmentsMap
,
"num"
);
IPage
<
Map
<
String
,
Object
>>
page
=
new
Page
<>();
page
.
setTotal
(
esEquipmentsMap
.
size
());
page
.
setSize
(
999
);
...
...
@@ -1157,6 +1163,17 @@ public class MonitorFanIdxController extends BaseController {
}
public
static
List
<
Map
<
String
,
Object
>>
sortByFeild
(
List
<
Map
<
String
,
Object
>>
list
,
String
feild
)
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
Collections
.
sort
(
list
,
(
m1
,
m2
)->
Integer
.
valueOf
(
m1
.
get
(
feild
).
toString
()).
compareTo
(
Integer
.
valueOf
(
m2
.
get
(
feild
).
toString
())));
}
return
list
;
}
//@Scheduled(cron = "0/10 * * * * ? ")
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"测试方法 "
)
...
...
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