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
1260a048
Commit
1260a048
authored
Jan 05, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 液位详情接口开发
parent
08f3c893
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
0 deletions
+63
-0
SupervisionConfigureController.java
...quipmanage/controller/SupervisionConfigureController.java
+60
-0
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+3
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/SupervisionConfigureController.java
View file @
1260a048
...
...
@@ -543,6 +543,66 @@ public class SupervisionConfigureController extends AbstractBaseController {
return
CommonResponseUtil
.
success
(
resMap
);
}
@PersonIdentify
@RequestMapping
(
value
=
"/selectWaterLevelDetail"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"水池液位详情"
,
produces
=
"application/json;charset=UTF-8"
,
notes
=
"水池液位详情"
)
public
ResponseModel
selectWaterLevelDetail
(
@RequestParam
(
value
=
"equipmentSpecificId"
)
String
equipmentSpecificId
,
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
String
startTime
,
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
String
endTime
)
throws
ParseException
{
if
(!
StringUtil
.
isNotEmpty
(
equipmentSpecificId
))
{
return
CommonResponseUtil
.
success
();
}
Map
<
String
,
Object
>
map
=
fireFightingSystemMapper
.
selectEquipmentSpecificById
(
equipmentSpecificId
);
if
(
ObjectUtils
.
isEmpty
(
map
)
||
ObjectUtils
.
isEmpty
(
map
.
get
(
"iot_code"
)))
{
return
CommonResponseUtil
.
success
(
null
);
}
String
iotCode
=
map
.
get
(
"iot_code"
).
toString
();
String
prefix
,
suffix
;
if
(
iotCode
.
length
()
>
8
)
{
prefix
=
iotCode
.
substring
(
0
,
8
);
suffix
=
iotCode
.
substring
(
8
);
}
else
{
throw
new
BadRequest
(
"装备物联编码错误,请确认!"
);
}
ResponseModel
mounthEntity
;
try
{
mounthEntity
=
iotFeign
.
selectList
(
getAppKey
(),
getProduct
(),
getToken
(),
startTime
,
endTime
,
prefix
,
suffix
,
"FHS_FirePoolDevice_WaterLevel"
);
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"请求物联平台失败,请稍后重试!"
);
}
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
assert
mounthEntity
!=
null
;
if
(
200
==
mounthEntity
.
getStatus
())
{
String
json
=
JSON
.
toJSONString
(
mounthEntity
.
getResult
());
List
<
Map
<
String
,
String
>>
list
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json
);
Collections
.
reverse
(
list
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
result
.
addAll
(
list
);
}
}
List
<
Map
<
String
,
String
>>
res
=
new
ArrayList
<>();
for
(
Map
<
String
,
String
>
m
:
result
)
{
Map
<
String
,
String
>
item
=
new
HashMap
<>();
item
.
put
(
"time"
,
change
(
String
.
valueOf
(
m
.
get
(
"time"
))));
for
(
String
s
:
m
.
keySet
())
{
if
(!
s
.
equals
(
"time"
))
{
item
.
put
(
"value"
,
m
.
get
(
s
));
item
.
remove
(
s
);
}
}
res
.
add
(
item
);
}
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
map1
.
put
(
"name"
,
"水池液位"
);
map1
.
put
(
"xData"
,
res
.
stream
().
map
(
x
->
x
.
get
(
"time"
)).
collect
(
Collectors
.
toList
()));
map1
.
put
(
"yData"
,
res
.
stream
().
map
(
x
->
x
.
get
(
"value"
)).
collect
(
Collectors
.
toList
()));
Map
<
String
,
Object
>
resMap
=
new
HashMap
<>();
resMap
.
put
(
"scyw"
,
map1
);
return
CommonResponseUtil
.
success
(
resMap
);
}
private
String
change
(
String
time
)
throws
ParseException
{
//进行转化时区
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss.SSSZ"
,
Locale
.
US
);
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
1260a048
...
...
@@ -4907,6 +4907,7 @@
from (
(SELECT
r.`name`,
wes.id as equipmentSpecificId,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
-- IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel,
...
...
@@ -4942,6 +4943,7 @@
(
SELECT
a.`name`,
a.equipmentSpecificId,
a.minLevel,
a.maxLevel,
IFNULL( a.nowLevel, '--' ) nowLevel,
...
...
@@ -4955,6 +4957,7 @@
(
SELECT
r.`name`,
wes.id as equipmentSpecificId,
IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel,
(select
...
...
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