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
e99660e2
Commit
e99660e2
authored
Feb 08, 2023
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:消防资源概览bug修改
parent
a03458d2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
49 deletions
+29
-49
FireFightingSystemController.java
.../equipmanage/controller/FireFightingSystemController.java
+2
-2
IotFeign.java
...src/main/java/com/yeejoin/equipmanage/fegin/IotFeign.java
+11
-0
EmergencyServiceImpl.java
...eejoin/equipmanage/service/impl/EmergencyServiceImpl.java
+16
-47
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/controller/FireFightingSystemController.java
View file @
e99660e2
...
...
@@ -528,8 +528,8 @@ public class FireFightingSystemController extends AbstractBaseController {
equipmentCategory
=
equipmentCategoryService
.
getById
(
equipmentCategory
.
getParentId
());
}
}
return
fireFightingSystemService
.
getColaCategoryAmountEquList
(
inhierarchy
,
equipTypeAmountPage
.
getEquipmentClassificationCode
().
replaceAll
(
"0+$"
,
""
)
,
equipTypeAmountPage
);
String
classificationCode
=
equipTypeAmountPage
.
getEquipmentClassificationCode
().
replaceAll
(
"0+$"
,
""
);
return
fireFightingSystemService
.
getColaCategoryAmountEquList
(
inhierarchy
,
classificationCode
.
length
()
%
2
==
0
?
classificationCode
:
classificationCode
+
"0"
,
equipTypeAmountPage
);
}
else
{
if
(
null
!=
equipTypeAmountPage
.
getIsDefect
()
&&
1
==
equipTypeAmountPage
.
getIsDefect
())
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/fegin/IotFeign.java
View file @
e99660e2
...
...
@@ -51,6 +51,17 @@ public interface IotFeign {
@RequestParam
(
"FHS_PressurePump_Start"
)
String
key
,
@RequestParam
(
required
=
false
,
value
=
"fieldKey"
)
String
fieldKey
);
@RequestMapping
(
value
=
"v1/livedata/common/top/single-field"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
topSingleField
(
@RequestHeader
(
"appKey"
)
String
appKey
,
@RequestHeader
(
"product"
)
String
product
,
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"top"
)
String
top
,
@RequestParam
(
value
=
"productKey"
)
String
productKey
,
@RequestParam
(
required
=
false
,
value
=
"deviceName"
)
String
deviceName
,
@RequestParam
(
"FHS_PressurePump_Start"
)
String
key
,
@RequestParam
(
required
=
false
,
value
=
"fieldKey"
)
String
fieldKey
);
@RequestMapping
(
value
=
"v1/livedata/common/list"
,
method
=
RequestMethod
.
GET
,
consumes
=
"application/json"
)
ResponseModel
selectListNew
(
@RequestHeader
(
"appKey"
)
String
appKey
,
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EmergencyServiceImpl.java
View file @
e99660e2
...
...
@@ -341,66 +341,35 @@ public class EmergencyServiceImpl implements IEmergencyService {
}
}
}
ResponseModel
intervalResponseModel
=
iotFeign
.
selectOne
(
appKey
,
product
,
token
,
"1"
,
prefix
,
null
,
null
,
pressurePumpStart
);
String
intervalTime
=
nowStrLong
;
ResponseModel
intervalResponseModel
=
iotFeign
.
topSingleField
(
appKey
,
product
,
token
,
"10"
,
prefix
,
null
,
null
,
pressurePumpStart
);
String
intervalTime1
=
nowStrLong
;
String
intervalTime2
=
nowStrLong
;
String
durationTime
=
nowStrLong
;
if
(
200
==
intervalResponseModel
.
getStatus
())
{
String
json
=
JSON
.
toJSONString
(
intervalResponseModel
.
getResult
());
List
<
Map
<
String
,
String
>>
intervalDataList
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
json
);
if
(!
CollectionUtils
.
isEmpty
(
intervalDataList
))
{
String
value
=
intervalDataList
.
get
(
0
).
get
(
pressurePumpStart
);
List
<
Map
<
String
,
String
>>
falseDataList
=
intervalDataList
.
stream
().
filter
(
x
->
x
.
containsKey
(
"createdTime"
)
&&
"false"
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpStart
))).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
trueDataList
=
intervalDataList
.
stream
().
filter
(
x
->
x
.
containsKey
(
"createdTime"
)
&&
"true"
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpStart
))).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
falseDataList
)
&&
!
CollectionUtils
.
isEmpty
(
trueDataList
))
{
intervalTime1
=
falseDataList
.
get
(
0
).
get
(
"createdTime"
);
intervalTime2
=
trueDataList
.
get
(
0
).
get
(
"createdTime"
);
}
if
(
"true"
.
equalsIgnoreCase
(
value
))
{
ResponseModel
stopResponseModel
=
iotFeign
.
selectOne
(
appKey
,
product
,
token
,
"1"
,
prefix
,
null
,
"false"
,
pressurePumpStart
);
if
(
200
==
stopResponseModel
.
getStatus
())
{
String
stopJson
=
JSON
.
toJSONString
(
stopResponseModel
.
getResult
());
List
<
Map
<
String
,
String
>>
stopDataList
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
stopJson
);
List
<
Map
<
String
,
String
>>
collect
=
stopDataList
.
stream
().
filter
(
o
->
o
.
containsKey
(
"createdTime"
)).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
collect
))
{
intervalTime
=
collect
.
get
(
0
).
get
(
"createdTime"
).
substring
(
0
,
19
);
// 停泵前的前5分钟,判断管网压力状态
try
{
String
stop5BeforeTime
=
DateUtils
.
convertDateToString
(
DateUtils
.
dateAddMinutes
(
DateUtils
.
convertStrToDate
(
intervalTime
,
"yyyy-MM-dd HH:mm:ss"
),
-
5
),
"yyyy-MM-dd HH:mm:ss"
);
ResponseModel
pipeResponseModel
=
iotFeign
.
selectListNew
(
appKey
,
product
,
token
,
prefix
,
null
,
stop5BeforeTime
,
intervalTime
,
null
,
"FHS_PipePressureDetector_PipePressure"
);
if
(
200
==
pipeResponseModel
.
getStatus
())
{
String
pipeJson
=
JSON
.
toJSONString
(
pipeResponseModel
.
getResult
());
List
<
Map
<
String
,
String
>>
pipeDataList
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
pipeJson
);
List
<
Map
<
String
,
String
>>
collect1
=
pipeDataList
.
stream
().
filter
(
o
->
o
.
containsKey
(
"FHS_PipePressureDetector_PipePressure"
)).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
collect1
))
{
int
val1
=
Integer
.
parseInt
(
collect1
.
get
(
0
).
get
(
"FHS_PipePressureDetector_PipePressure"
));
int
val2
=
Integer
.
parseInt
(
collect1
.
get
(
pipeDataList
.
size
()
-
1
).
get
(
"FHS_PipePressureDetector_PipePressure"
));
pipeMap
.
put
(
"value"
,
(
val1
-
val2
)
>
0.05
?
"异常"
:
"正常"
);
}
}
}
catch
(
ParseException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
ResponseModel
startResponseModel
=
iotFeign
.
selectOne
(
appKey
,
product
,
token
,
"2"
,
prefix
,
null
,
"true"
,
pressurePumpStart
);
if
(
200
==
startResponseModel
.
getStatus
())
{
String
startJson
=
JSON
.
toJSONString
(
startResponseModel
.
getResult
());
List
<
Map
<
String
,
String
>>
startDataList
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
startJson
);
List
<
Map
<
String
,
String
>>
collect
=
startDataList
.
stream
().
filter
(
o
->
o
.
containsKey
(
"createdTime"
)).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
collect
)
&&
collect
.
size
()
>
1
)
{
durationTime
=
collect
.
get
(
1
).
get
(
"createdTime"
).
substring
(
0
,
19
).
replace
(
"T"
,
" "
);
}
if
(!
CollectionUtils
.
isEmpty
(
trueDataList
))
{
durationTime
=
intervalTime2
;
}
}
else
{
ResponseModel
startResponseModel
=
iotFeign
.
selectOne
(
appKey
,
product
,
token
,
"1"
,
prefix
,
null
,
"true"
,
pressurePumpStart
);
if
(
200
==
startResponseModel
.
getStatus
())
{
String
startJson
=
JSON
.
toJSONString
(
startResponseModel
.
getResult
());
List
<
Map
<
String
,
String
>>
startDataList
=
(
List
<
Map
<
String
,
String
>>)
JSONArray
.
parse
(
startJson
);
List
<
Map
<
String
,
String
>>
collect
=
startDataList
.
stream
().
filter
(
o
->
o
.
containsKey
(
"createdTime"
)).
collect
(
Collectors
.
toList
());
if
(!
CollectionUtils
.
isEmpty
(
collect
))
{
intervalTime
=
collect
.
get
(
0
).
get
(
"createdTime"
).
substring
(
0
,
19
);
durationTime
=
intervalTime
;
}
if
(!
CollectionUtils
.
isEmpty
(
falseDataList
)
&&
!
CollectionUtils
.
isEmpty
(
trueDataList
))
{
durationTime
=
trueDataList
.
get
(
0
).
get
(
"createdTime"
);
nowStrLong
=
falseDataList
.
get
(
0
).
get
(
"createdTime"
);
}
}
}
}
intervalMap
.
put
(
"value"
,
DateUtils
.
getDurationMinutes
(
intervalTime
,
nowStrLong
,
"yyyy-MM-dd HH:mm:ss"
));
durationlMap
.
put
(
"value"
,
DateUtils
.
getDurationMinutes
(
durationTime
,
nowStrLong
,
"yyyy-MM-dd HH:mm:ss"
));
intervalMap
.
put
(
"value"
,
Math
.
abs
(
DateUtils
.
getDurationMinutes
(
intervalTime1
,
intervalTime2
,
"yyyy-MM-dd HH:mm:ss"
)
));
durationlMap
.
put
(
"value"
,
Math
.
abs
(
DateUtils
.
getDurationMinutes
(
durationTime
,
nowStrLong
,
"yyyy-MM-dd HH:mm:ss"
)
));
}
else
{
intervalMap
.
put
(
"value"
,
0
);
durationlMap
.
put
(
"value"
,
0
);
...
...
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