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
469660a6
Commit
469660a6
authored
Nov 04, 2024
by
张森
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
31968 站端设备平台v5>关键数据>稳压泵,稳压泵启停间隔时间不正确 来源Bug-24725
parent
9926c449
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
19 deletions
+20
-19
PressurePumpServiceImpl.java
...oin/equipmanage/service/impl/PressurePumpServiceImpl.java
+4
-3
SupervisionVideoServiceImpl.java
...equipmanage/service/impl/SupervisionVideoServiceImpl.java
+16
-16
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/PressurePumpServiceImpl.java
View file @
469660a6
...
...
@@ -174,10 +174,11 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
public
long
getAllPressurePumpStartStopInterval
(
List
<
IotDataVO
>
dataList
,
List
<
IotDataVO
>
dataListFilterTrue
,
List
<
IotDataVO
>
dataListFilterFalse
,
String
nowStrLong
)
{
String
intervalTime1
=
nowStrLong
;
String
intervalTime2
=
nowStrLong
;
if
(!
ObjectUtils
.
isEmpty
(
dataListFilterTrue
)
&&
dataListFilterTrue
.
size
()
>
1
)
{
dataList
=
dataList
.
stream
().
filter
(
item
->
item
.
getValue
().
equals
(
"true"
)).
sorted
(
Comparator
.
comparing
(
IotDataVO:
:
getCreatedTime
).
reversed
()).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
dataList
)
&&
dataList
.
size
()
>
1
)
{
//获取启动列表中
intervalTime1
=
dataList
FilterTrue
.
get
(
0
).
getCreatedTime
();
intervalTime2
=
dataList
FilterTrue
.
get
(
1
).
getCreatedTime
();
intervalTime1
=
dataList
.
get
(
0
).
getCreatedTime
();
intervalTime2
=
dataList
.
get
(
1
).
getCreatedTime
();
}
// 结果向上取整
double
ceil
=
Math
.
ceil
(
Math
.
abs
(
DateUtils
.
getDurationSeconds
(
intervalTime1
,
intervalTime2
,
DateUtils
.
DATE_TIME_PATTERN
))
*
1.0
/
Double
.
parseDouble
(
PressurePumpRelateEnum
.
ONE_HOUR_MINUTE
.
getValue
()));
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/SupervisionVideoServiceImpl.java
View file @
469660a6
...
...
@@ -150,6 +150,9 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
String
dayAvgStartNum
=
dayAvgCount
==
0
?
"0"
:
df
.
format
(
dayAvgCount
/
(
double
)
Math
.
abs
(
Integer
.
parseInt
(
PressurePumpRelateEnum
.
DAY_AVG
.
getValue
())));
pressurePumpInfo
=
fireFightingSystemMapper
.
getPressurePumpInfo
(
page
,
bizOrgCode
,
null
);
String
prefix
=
null
;
// 获取redis稳压泵缓存数据,默认JSON配置最近4小时
List
<
IotDataVO
>
DataList
=
pressurePumpService
.
getDataToRedis
(
PressurePumpRelateEnum
.
PRESSURE_PUMP
.
getValue
(),
pressurePumpStart
,
null
,
bizOrgCode
);
List
<
IotDataVO
>
dateList2
=
new
ArrayList
<>();
for
(
Map
<
String
,
Object
>
item
:
pressurePumpInfo
.
getRecords
())
{
String
suffix
=
null
;
String
iotCode
=
item
.
get
(
"iot_code"
).
toString
();
...
...
@@ -209,25 +212,22 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
item
.
put
(
"equipment_index_name"
,
"无信号"
);
item
.
put
(
"update_time"
,
false
);
}
if
(
CollectionUtils
.
isEmpty
(
DataList
)){
//从influxdb中获取最近一次启停间隔
List
<
Map
<
String
,
String
>>
iotDataList
=
pressurePumpService
.
getIotTopSingleField
(
top
,
prefix
,
null
,
null
,
pressurePumpStart
);
iotDataList
.
forEach
(
e
->
{
try
{
IotDataVO
iotDataVO
=
(
IotDataVO
)
pressurePumpService
.
mapToObject
(
e
,
IotDataVO
.
class
,
pressurePumpStart
);
dateList2
.
add
(
iotDataVO
);
}
catch
(
Exception
el
)
{
throw
new
RuntimeException
();
}
});
}
//稳压泵当前状态 无告警并且启动时长小于5分钟为正常
// item.put("stateDesc", Integer.parseInt(String.valueOf(item.get("isAlarm"))) == 0 && time ? PressurePumpRelateEnum.PIPE_PRESSURE_NORMAL_STATUS.getValue() : PressurePumpRelateEnum.PIPE_PRESSURE_ABNORMAL_STATUS.getValue());
}
// 获取redis稳压泵缓存数据,默认JSON配置最近4小时
List
<
IotDataVO
>
DataList
=
pressurePumpService
.
getDataToRedis
(
PressurePumpRelateEnum
.
PRESSURE_PUMP
.
getValue
(),
pressurePumpStart
,
null
,
bizOrgCode
);
if
(
CollectionUtils
.
isEmpty
(
DataList
)){
//从influxdb中获取最近一次启停间隔
List
<
Map
<
String
,
String
>>
iotDataList
=
pressurePumpService
.
getIotTopSingleField
(
top
,
prefix
,
null
,
null
,
pressurePumpStart
);
iotDataList
.
forEach
(
e
->
{
try
{
IotDataVO
iotDataVO
=
(
IotDataVO
)
pressurePumpService
.
mapToObject
(
e
,
IotDataVO
.
class
,
pressurePumpStart
);
DataList
.
add
(
iotDataVO
);
}
catch
(
Exception
el
)
{
throw
new
RuntimeException
();
}
});
}
interval
=
pressurePumpService
.
getAllPressurePumpStartStopInterval
(
DataList
,
dataListFilterTrue
,
dataListFilterFalse
,
nowStrLong
);
interval
=
pressurePumpService
.
getAllPressurePumpStartStopInterval
(
dateList2
,
dataListFilterTrue
,
dataListFilterFalse
,
nowStrLong
);
double
finalDiffMinute
=
(
double
)
interval
;
pressurePumpInfo
.
getRecords
().
stream
(
).
map
(
item
->
{
...
...
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