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
535ff6ab
Commit
535ff6ab
authored
Jul 26, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:消防系统4小联调修改
parent
45c6b979
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
EquipmentSpecificAlarmServiceImpl.java
...anage/service/impl/EquipmentSpecificAlarmServiceImpl.java
+13
-6
EquipmentSpecificAlarmMapper.xml
...rc/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
+4
-3
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificAlarmServiceImpl.java
View file @
535ff6ab
...
@@ -670,15 +670,21 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
...
@@ -670,15 +670,21 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
List
<
EquipAlarmLineVo
>
list
=
equipmentSpecificAlarmMapper
.
equipAlarmLine
(
hashMap
);
List
<
EquipAlarmLineVo
>
list
=
equipmentSpecificAlarmMapper
.
equipAlarmLine
(
hashMap
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
LinkedHashSet
<
String
>
xAxis
=
new
LinkedHashSet
<>();
LinkedHashSet
<
String
>
xAxis
=
new
LinkedHashSet
<>();
LinkedHashMap
<
String
,
Object
>
yAxis
=
new
LinkedHashMap
<>();
List
<
Map
<
String
,
Object
>>
yAxis
=
new
ArrayList
<>();
// LinkedHashMap<String, Object> yAxis = new LinkedHashMap<>();
// 取出所有非空indexName
// 取出所有非空indexName
Set
<
Object
>
indexKNameSet
=
list
.
stream
().
map
(
EquipAlarmLineVo:
:
getIndexName
).
filter
(
StringUtils:
:
isNotBlank
).
collect
(
Collectors
.
toSet
());
Set
<
Object
>
indexKNameSet
=
list
.
stream
().
map
(
EquipAlarmLineVo:
:
getIndexName
).
filter
(
StringUtils:
:
isNotBlank
).
collect
(
Collectors
.
toSet
());
Map
<
String
,
List
<
EquipAlarmLineVo
>>
dateCollect
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
EquipAlarmLineVo:
:
getDate
));
Map
<
String
,
List
<
EquipAlarmLineVo
>>
dateCollect
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
EquipAlarmLineVo:
:
getDate
));
Map
<
String
,
List
<
EquipAlarmLineVo
>>
sortMap
=
new
TreeMap
<>((
o1
,
o2
)->
o2
.
compareTo
(
o1
));
sortMap
.
putAll
(
dateCollect
);
// Map<String, List<EquipAlarmLineVo>> dateCollect = list.stream().sorted(Comparator.comparing(EquipAlarmLineVo::getDate).reversed()).collect(Collectors.groupingBy(EquipAlarmLineVo::getDate));
// 迭代器倒序遍历map
// 迭代器倒序遍历map
ListIterator
<
Map
.
Entry
<
String
,
List
<
EquipAlarmLineVo
>>>
i
=
new
ArrayList
<
Map
.
Entry
<
String
,
List
<
EquipAlarmLineVo
>>>(
dateCollect
.
entrySet
()).
listIterator
(
dateCollect
.
size
());
ListIterator
<
Map
.
Entry
<
String
,
List
<
EquipAlarmLineVo
>>>
i
=
new
ArrayList
<
Map
.
Entry
<
String
,
List
<
EquipAlarmLineVo
>>>(
sortMap
.
entrySet
()).
listIterator
(
sortMap
.
size
());
while
(
i
.
hasPrevious
())
{
while
(
i
.
hasPrevious
())
{
HashMap
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
LinkedList
<
Object
>
yData
=
new
LinkedList
<>();
LinkedList
<
Object
>
yData
=
new
LinkedList
<>();
Map
.
Entry
<
String
,
List
<
EquipAlarmLineVo
>>
entry
=
i
.
previous
();
Map
.
Entry
<
String
,
List
<
EquipAlarmLineVo
>>
entry
=
i
.
previous
();
...
@@ -693,12 +699,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
...
@@ -693,12 +699,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
yData
.
add
(
0
);
yData
.
add
(
0
);
}
}
}
}
yAxis
.
put
(
key
,
yData
);
dataMap
.
put
(
"data"
,
yData
);
xAxis
.
add
(
key
);
yAxis
.
add
(
dataMap
);
xAxis
.
add
(
key
.
substring
(
5
));
}
}
resultMap
.
put
(
"legend"
,
indexKNameSet
);
resultMap
.
put
(
"legend"
,
indexKNameSet
);
resultMap
.
put
(
"
xAxis
"
,
xAxis
);
resultMap
.
put
(
"
axisData
"
,
xAxis
);
resultMap
.
put
(
"
yAxis
"
,
yAxis
);
resultMap
.
put
(
"
seriesData
"
,
yAxis
);
}
}
return
resultMap
;
return
resultMap
;
}
}
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificAlarmMapper.xml
View file @
535ff6ab
...
@@ -259,7 +259,7 @@
...
@@ -259,7 +259,7 @@
</select>
</select>
<select
id=
"pageQuery"
resultType=
"java.util.HashMap"
>
<select
id=
"pageQuery"
resultType=
"java.util.HashMap"
>
SELECT
SELECT
`wlesal`.`id` AS `id`,
`wlesal`.`
equipment_specific_alarm_
id` AS `id`,
`wles`.`code` AS `code`,
`wles`.`code` AS `code`,
`wlesal`.`equipment_specific_name` AS `specificName`,
`wlesal`.`equipment_specific_name` AS `specificName`,
`wlesal`.`equipment_specific_index_key` AS `indexKey`,
`wlesal`.`equipment_specific_index_key` AS `indexKey`,
...
@@ -268,7 +268,7 @@
...
@@ -268,7 +268,7 @@
IF
IF
( `wlesal`.`clean_time` IS NOT NULL, '已消除', '未消除' ) AS `cleanStatus`,
( `wlesal`.`clean_time` IS NOT NULL, '已消除', '未消除' ) AS `cleanStatus`,
`wlesal`.`iot_code` AS `iotCode`,
`wlesal`.`iot_code` AS `iotCode`,
`wlesal`.`create_date`
AS `createDate`
CONVERT ( `wlesal`.`create_date`, CHAR )
AS `createDate`
FROM
FROM
`wl_equipment_specific_alarm_log` `wlesal`
`wl_equipment_specific_alarm_log` `wlesal`
LEFT JOIN `wl_equipment_specific` `wles` ON `wlesal`.`equipment_specific_id` = `wles`.`id`
LEFT JOIN `wl_equipment_specific` `wles` ON `wlesal`.`equipment_specific_id` = `wles`.`id`
...
@@ -1238,6 +1238,6 @@
...
@@ -1238,6 +1238,6 @@
s.date,
s.date,
s1.equipment_specific_index_key
s1.equipment_specific_index_key
ORDER BY
ORDER BY
s.date
s.date
DESC
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
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