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
b9d83fb6
Commit
b9d83fb6
authored
Jul 27, 2022
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:消防系统4小联调修改
parent
41f4ec76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
23 deletions
+26
-23
ConfigureController.java
...m/yeejoin/equipmanage/controller/ConfigureController.java
+1
-2
EquipmentSpecificAlarmServiceImpl.java
...anage/service/impl/EquipmentSpecificAlarmServiceImpl.java
+25
-21
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/ConfigureController.java
View file @
b9d83fb6
...
@@ -89,7 +89,7 @@ public class ConfigureController extends AbstractBaseController {
...
@@ -89,7 +89,7 @@ public class ConfigureController extends AbstractBaseController {
@RequestMapping
(
value
=
"/equipAlarmLine"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/equipAlarmLine"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"系统近一周告警趋势图"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"系统近一周告警趋势图"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"系统近一周告警趋势图"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"系统近一周告警趋势图"
)
public
ResponseModel
equip
StatusCount
(
@RequestParam
(
required
=
false
)
String
systemCode
,
@RequestParam
(
required
=
false
)
String
indexKeys
)
{
public
ResponseModel
equip
AlarmLine
(
@RequestParam
(
required
=
false
)
String
systemCode
,
@RequestParam
(
required
=
false
)
String
indexKeys
)
{
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
reginParams
=
getSelectedOrgInfo
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
ReginParams
.
PersonIdentity
personIdentity
=
reginParams
.
getPersonIdentity
();
...
@@ -108,7 +108,6 @@ public class ConfigureController extends AbstractBaseController {
...
@@ -108,7 +108,6 @@ public class ConfigureController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
equipmentSpecificAlarmService
.
equipAlarmLine
(
hashMap
));
return
CommonResponseUtil
.
success
(
equipmentSpecificAlarmService
.
equipAlarmLine
(
hashMap
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取系统告警信息"
)
@ApiOperation
(
value
=
"获取系统告警信息"
)
@GetMapping
(
"/getSystemAlarmInfo"
)
@GetMapping
(
"/getSystemAlarmInfo"
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificAlarmServiceImpl.java
View file @
b9d83fb6
...
@@ -670,38 +670,42 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
...
@@ -670,38 +670,42 @@ 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
<>();
List
<
Map
<
String
,
Object
>>
yAxis
=
new
ArrayList
<>();
List
<
Map
<
String
,
LinkedList
<
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
<
String
>
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
));
Map
<
String
,
List
<
EquipAlarmLineVo
>>
sortMap
=
new
TreeMap
<>((
o1
,
o2
)
->
o2
.
compareTo
(
o1
));
sortMap
.
putAll
(
dateCollect
);
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
>>>(
sortMap
.
entrySet
()).
listIterator
(
sortMap
.
size
())
;
String
date
=
null
;
while
(
i
.
hasPrevious
()
)
{
for
(
String
indexName
:
indexKNameSet
)
{
HashMap
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
HashMap
<
String
,
LinkedList
<
Object
>
>
dataMap
=
new
HashMap
<>();
LinkedList
<
Object
>
yData
=
new
LinkedList
<>();
LinkedList
<
Object
>
yData
=
new
LinkedList
<>();
// 解决迭代器遍历一次的问题
Map
.
Entry
<
String
,
List
<
EquipAlarmLineVo
>>
entry
=
i
.
previous
();
ListIterator
<
Map
.
Entry
<
String
,
List
<
EquipAlarmLineVo
>>>
i
=
new
ArrayList
<
Map
.
Entry
<
String
,
List
<
EquipAlarmLineVo
>>>(
sortMap
.
entrySet
()).
listIterator
(
sortMap
.
size
());
String
key
=
entry
.
getKey
();
while
(
i
.
hasPrevious
())
{
List
<
EquipAlarmLineVo
>
value
=
entry
.
getValue
();
Map
.
Entry
<
String
,
List
<
EquipAlarmLineVo
>>
entry
=
i
.
previous
();
String
key
=
entry
.
getKey
();
for
(
EquipAlarmLineVo
vo
:
value
)
{
List
<
EquipAlarmLineVo
>
value
=
entry
.
getValue
();
String
indexName
=
vo
.
getIndexName
();
if
(
indexKNameSet
.
contains
(
indexName
))
{
for
(
EquipAlarmLineVo
vo
:
value
)
{
yData
.
add
(
vo
.
getTotal
());
String
name
=
vo
.
getIndexName
();
}
else
{
if
(
key
.
equals
(
date
))
{
yData
.
add
(
0
);
yData
=
yAxis
.
get
(
i
.
previousIndex
()).
get
(
"data"
);
}
if
(
indexName
.
equals
(
name
))
{
yData
.
add
(
vo
.
getTotal
());
}
else
{
yData
.
add
(
0
);
}
}
}
xAxis
.
add
(
key
.
substring
(
5
));
date
=
key
;
}
}
dataMap
.
put
(
"data"
,
yData
);
dataMap
.
put
(
"data"
,
yData
);
yAxis
.
add
(
dataMap
);
yAxis
.
add
(
dataMap
);
xAxis
.
add
(
key
.
substring
(
5
));
}
}
resultMap
.
put
(
"legend"
,
indexKNameSet
);
resultMap
.
put
(
"legend"
,
indexKNameSet
);
resultMap
.
put
(
"axisData"
,
xAxis
);
resultMap
.
put
(
"axisData"
,
xAxis
);
...
...
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