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
249f7729
Commit
249f7729
authored
Feb 10, 2023
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:稳压泵启停状态图接口扩展天查询
parent
fea17ead
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
39 deletions
+60
-39
EmergencyServiceImpl.java
...eejoin/equipmanage/service/impl/EmergencyServiceImpl.java
+59
-38
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+1
-1
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EmergencyServiceImpl.java
View file @
249f7729
...
@@ -220,18 +220,16 @@ public class EmergencyServiceImpl implements IEmergencyService {
...
@@ -220,18 +220,16 @@ public class EmergencyServiceImpl implements IEmergencyService {
@Override
@Override
public
Map
<
String
,
Object
>
getPressurePumpStatusChart
(
String
equipmentCode
,
String
startTime
,
String
endTime
,
String
bizOrgCode
,
String
appKey
,
String
product
,
String
token
)
{
public
Map
<
String
,
Object
>
getPressurePumpStatusChart
(
String
equipmentCode
,
String
startTime
,
String
endTime
,
String
bizOrgCode
,
String
appKey
,
String
product
,
String
token
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
String
>
timeHourList
=
DateUtils
.
getTimeStrListByStartAndEnd
(
startTime
,
endTime
,
"MM-dd HH:mm"
);
Set
<
String
>
timeSet
=
new
LinkedHashSet
<>();
List
<
String
>
timeList
=
new
ArrayList
<>();
// 获取稳压泵
// 获取稳压泵
List
<
Map
<
String
,
Object
>>
list
=
equipmentSpecificSerivce
.
getListByEquipmentCode
(
equipmentCode
,
bizOrgCode
);
List
<
Map
<
String
,
Object
>>
list
=
equipmentSpecificSerivce
.
getListByEquipmentCode
(
equipmentCode
,
bizOrgCode
);
// 获取各稳压泵数据,及时间戳
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
// 获取查询时间范围内的时间戳
List
<
String
>
timeHourList
=
DateUtils
.
getTimeStrListByStartAndEnd
(
startTime
,
endTime
,
"MM-dd HH:mm"
);
Set
<
String
>
timeSet
=
new
LinkedHashSet
<>();
List
<
Map
<
String
,
Object
>>
yData
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
yData
=
new
ArrayList
<>();
LinkedHashMap
<
String
,
List
<
Map
<
String
,
String
>>>
dataListMap
=
new
LinkedHashMap
<>();
list
.
forEach
(
x
->
{
list
.
forEach
(
x
->
{
Map
<
String
,
Object
>
yMap
=
new
HashMap
<>();
List
<
Integer
>
yList
=
new
ArrayList
<>();
String
name
=
x
.
get
(
"name"
).
toString
();
yMap
.
put
(
"name"
,
name
);
Object
iotCode
=
x
.
get
(
"iotCode"
);
Object
iotCode
=
x
.
get
(
"iotCode"
);
String
prefix
=
null
;
String
prefix
=
null
;
if
(
x
.
get
(
"iotCode"
)
!=
null
&&
iotCode
.
toString
().
length
()
>
8
)
{
if
(
x
.
get
(
"iotCode"
)
!=
null
&&
iotCode
.
toString
().
length
()
>
8
)
{
...
@@ -242,44 +240,67 @@ public class EmergencyServiceImpl implements IEmergencyService {
...
@@ -242,44 +240,67 @@ public class EmergencyServiceImpl implements IEmergencyService {
String
json
=
JSON
.
toJSONString
(
responseModel
.
getResult
());
String
json
=
JSON
.
toJSONString
(
responseModel
.
getResult
());
List
<
Map
<
String
,
String
>>
dataList
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json
);
List
<
Map
<
String
,
String
>>
dataList
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json
);
if
(!
CollectionUtils
.
isEmpty
(
dataList
))
{
if
(!
CollectionUtils
.
isEmpty
(
dataList
))
{
Collections
.
reverse
(
dataList
);
dataList
.
stream
().
filter
(
y
->
y
.
containsKey
(
"createdTime"
)).
forEach
(
z
->
timeSet
.
add
(
z
.
get
(
"createdTime"
)));
Map
<
String
,
List
<
Map
<
String
,
String
>>>
dataMap
=
dataList
.
stream
().
filter
(
y
->
y
.
containsKey
(
"createdTime"
)).
collect
(
Collectors
.
groupingBy
(
e
->
e
.
get
(
"createdTime"
).
substring
(
5
,
16
)));
dataListMap
.
put
(
iotCode
.
toString
(),
dataList
);
List
<
Map
<
String
,
String
>>
yDataList
=
null
;
String
flag
=
"true"
;
for
(
String
t
:
timeHourList
)
{
List
<
Map
<
String
,
String
>>
data
=
dataMap
.
get
(
t
);
String
strTime
=
t
.
substring
(
0
,
t
.
length
()
-
3
);
if
(!
CollectionUtils
.
isEmpty
(
data
))
{
yDataList
=
data
.
stream
().
filter
(
o
->
"true"
.
equalsIgnoreCase
(
o
.
get
(
pressurePumpStart
))).
collect
(
Collectors
.
toList
());
yList
.
add
(!
CollectionUtils
.
isEmpty
(
yDataList
)
&&
"true"
.
equalsIgnoreCase
(
flag
)
?
1
:
0
);
flag
=
data
.
get
(
data
.
size
()
-
1
).
get
(
pressurePumpStart
);
timeList
.
add
(
t
);
}
else
{
if
(!
timeSet
.
contains
(
strTime
)
&&
!
timeList
.
contains
(
strTime
+
":00"
))
{
timeList
.
add
(
strTime
+
":00"
);
yList
.
add
(
0
);
}
}
timeSet
.
add
(
strTime
);
}
}
else
{
timeHourList
.
forEach
(
t
->
{
String
strTime
=
t
.
substring
(
0
,
t
.
length
()
-
3
);
if
(!
timeSet
.
contains
(
strTime
))
{
timeList
.
add
(
strTime
+
":00"
);
yList
.
add
(
0
);
}
timeSet
.
add
(
strTime
);
});
}
}
}
}
yMap
.
put
(
"data"
,
yList
);
yData
.
add
(
yMap
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
});
});
// 数据时间排序
List
<
String
>
sortTimeList
=
new
ArrayList
<>(
timeSet
);
Collections
.
sort
(
sortTimeList
);
// 数据时间截取,MM-dd HH:mm
List
<
String
>
sortTimeCollectList
=
sortTimeList
.
stream
().
map
(
x
->
x
.
substring
(
5
,
x
.
length
()
-
3
)).
collect
(
Collectors
.
toList
());
// 数据时间截取,MM-dd HH
List
<
String
>
sortTimeTmpCollectList
=
sortTimeList
.
stream
().
map
(
x
->
x
.
substring
(
5
,
x
.
length
()
-
6
)).
collect
(
Collectors
.
toList
());
// 组装x时间轴数据
List
<
String
>
timeList
=
new
ArrayList
<>();
timeHourList
.
forEach
(
t
->
{
String
strTime
=
t
.
substring
(
0
,
t
.
length
()
-
3
);
if
(
sortTimeCollectList
.
contains
(
t
))
{
timeList
.
add
(
t
);
}
else
if
(!
sortTimeTmpCollectList
.
contains
(
strTime
))
{
timeList
.
add
(
strTime
+
":00"
);
sortTimeTmpCollectList
.
add
(
strTime
);
}
});
// 遍历稳压泵,dataListMap获取各稳压泵数据,没有数据的进行补0
list
.
forEach
(
x
->
{
Map
<
String
,
Object
>
yMap
=
new
HashMap
<>();
List
<
Integer
>
yList
=
new
ArrayList
<>();
String
name
=
x
.
get
(
"name"
).
toString
();
yMap
.
put
(
"name"
,
name
);
Object
iotCode
=
x
.
get
(
"iotCode"
);
if
(
x
.
get
(
"iotCode"
)
!=
null
)
{
List
<
Map
<
String
,
String
>>
dataList
=
dataListMap
.
get
(
iotCode
.
toString
());
if
(!
CollectionUtils
.
isEmpty
(
dataList
))
{
Collections
.
reverse
(
dataList
);
Map
<
String
,
List
<
Map
<
String
,
String
>>>
dataMap
=
dataList
.
stream
().
filter
(
y
->
y
.
containsKey
(
"createdTime"
)).
collect
(
Collectors
.
groupingBy
(
e
->
e
.
get
(
"createdTime"
).
substring
(
5
,
16
)));
List
<
Map
<
String
,
String
>>
yDataList
=
null
;
String
flag
=
"true"
;
for
(
String
t
:
timeList
)
{
List
<
Map
<
String
,
String
>>
data
=
dataMap
.
get
(
t
);
if
(!
CollectionUtils
.
isEmpty
(
data
))
{
yDataList
=
data
.
stream
().
filter
(
o
->
"true"
.
equalsIgnoreCase
(
o
.
get
(
pressurePumpStart
))).
collect
(
Collectors
.
toList
());
yList
.
add
(!
CollectionUtils
.
isEmpty
(
yDataList
)
&&
"true"
.
equalsIgnoreCase
(
flag
)
?
1
:
0
);
flag
=
data
.
get
(
data
.
size
()
-
1
).
get
(
pressurePumpStart
);
}
else
{
yList
.
add
(
0
);
}
}
}
else
{
timeList
.
forEach
(
t
->
{
yList
.
add
(
0
);
});
}
yMap
.
put
(
"data"
,
yList
);
yData
.
add
(
yMap
);
}
});
map
.
put
(
"xData"
,
timeList
);
map
.
put
(
"xData"
,
timeList
);
map
.
put
(
"yData"
,
yData
);
map
.
put
(
"yData"
,
yData
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
249f7729
...
@@ -1001,7 +1001,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
...
@@ -1001,7 +1001,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
if
(
"正常"
.
equals
(
String
.
valueOf
(
m
.
get
(
"status"
))))
{
if
(
"正常"
.
equals
(
String
.
valueOf
(
m
.
get
(
"status"
))))
{
statusMap
.
put
(
"level"
,
"success"
);
statusMap
.
put
(
"level"
,
"success"
);
}
else
{
}
else
{
statusMap
.
put
(
"level"
,
"
warning
"
);
statusMap
.
put
(
"level"
,
"
error
"
);
}
}
list1
.
add
(
statusMap
);
list1
.
add
(
statusMap
);
map
.
put
(
"status"
,
list1
);
map
.
put
(
"status"
,
list1
);
...
...
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