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
4f5e54a7
Commit
4f5e54a7
authored
Feb 20, 2023
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:稳压泵冗余业务优化
parent
38801459
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
20 deletions
+14
-20
IPressurePumpService.java
...com/yeejoin/equipmanage/service/IPressurePumpService.java
+7
-13
PressurePumpServiceImpl.java
...oin/equipmanage/service/impl/PressurePumpServiceImpl.java
+7
-7
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IPressurePumpService.java
View file @
4f5e54a7
...
...
@@ -32,46 +32,43 @@ public interface IPressurePumpService {
/**
* 获取指标配置JSON信息集合
* @
return
* @
param code
*/
List
<
Map
>
getNameKeyInfoList
(
String
code
);
/**
* 获取所有稳压泵最近一次启停间隔,min
* @return
* @param redisDataList
* @param iotDataList
* @param nowStrLong
* @param bizOrgCode
*/
long
getAllPressurePumpStartStopInterval
(
List
<
IotDataVO
>
redisDataList
,
List
<
Map
<
String
,
String
>>
iotDataList
,
String
nowStrLong
,
String
bizOrgCode
);
/**
* 获取稳压泵一定时间内启动频率或次数
*
* @param hour
* @param dateNow
* @return
*/
int
getAllPressurePumpStartFrequency
(
double
hour
,
Date
dateNow
);
/**
* 获取稳压泵最近一次启停时长,min
*
* @param redisDataList
* @param iotDataList
* @param nowStrLong
* @param bizOrgCode
* @return
*/
long
getAllPressurePumpStartStopDuration
(
List
<
IotDataVO
>
redisDataList
,
List
<
Map
<
String
,
String
>>
iotDataList
,
String
nowStrLong
,
String
bizOrgCode
);
/**
* 获取稳压泵指定启泵前 minutes 分钟,管网压力差绝对值
*
* @param redisDataList
* @param redisDataPipeList
* @param iotDataList
* @param iotDataPipeList
* @param nowStrLong
* @param minutes
* @return
*/
double
getAllPressurePumpPipePressureDiff
(
List
<
IotDataVO
>
redisDataList
,
List
<
IotDataVO
>
redisDataPipeList
,
List
<
Map
<
String
,
String
>>
iotDataList
,
List
<
Map
<
String
,
String
>>
iotDataPipeList
,
String
nowStrLong
,
String
minutes
);
...
...
@@ -82,7 +79,6 @@ public interface IPressurePumpService {
* @param deviceName
* @param key
* @param fieldKey
* @return
*/
List
<
Map
<
String
,
String
>>
getIotTopSingleField
(
String
top
,
String
productKey
,
String
deviceName
,
String
key
,
String
fieldKey
);
...
...
@@ -93,7 +89,6 @@ public interface IPressurePumpService {
* @param iotCode
* @param startDate
* @param endDate
* @return
*/
List
<
IotDataVO
>
getDataToRedisByDateBetween
(
String
infoCode
,
String
nameKey
,
String
iotCode
,
Date
startDate
,
Date
endDate
);
...
...
@@ -103,9 +98,8 @@ public interface IPressurePumpService {
* @param endTime
* @param prefix
* @param suffix
* @param o
* @param pressurePumpStart
* @return
* @param key
* @param fieldKey
*/
List
<
Map
<
String
,
String
>>
getIotCommonListData
(
String
startTime
,
String
endTime
,
String
prefix
,
String
suffix
,
String
key
,
String
fieldKey
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/PressurePumpServiceImpl.java
View file @
4f5e54a7
...
...
@@ -164,8 +164,8 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
if
(
CollectionUtils
.
isNotEmpty
(
iotDataList
))
{
String
value
=
iotDataList
.
get
(
0
).
get
(
pressurePumpStart
);
String
createdTime
=
iotDataList
.
get
(
0
).
get
(
PressurePumpRelateEnum
.
CREATED_TIME
.
getValue
());
List
<
Map
<
String
,
String
>>
falseDataList
=
iotDataList
.
stream
().
filter
(
x
->
x
.
containsKey
(
PressurePumpRelateEnum
.
CREATED_TIME
.
getValue
())
&&
"false"
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpStart
))).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
trueDataList
=
iotDataList
.
stream
().
filter
(
x
->
x
.
containsKey
(
PressurePumpRelateEnum
.
CREATED_TIME
.
getValue
())
&&
"true"
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpStart
))).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
falseDataList
=
getIotDataFilterList
(
iotDataList
,
PressurePumpRelateEnum
.
IOT_INDEX_VALUE_FALSE
.
getValue
());
List
<
Map
<
String
,
String
>>
trueDataList
=
getIotDataFilterList
(
iotDataList
,
PressurePumpRelateEnum
.
IOT_INDEX_VALUE_TRUE
.
getValue
());
if
(
PressurePumpRelateEnum
.
IOT_INDEX_VALUE_TRUE
.
getValue
().
equalsIgnoreCase
(
value
))
{
intervalTime1
=
createdTime
;
if
(
CollectionUtils
.
isNotEmpty
(
falseDataList
))
{
...
...
@@ -194,7 +194,7 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
}
private
List
<
Map
<
String
,
String
>>
getIotDataFilterList
(
List
<
Map
<
String
,
String
>>
iotDataList
,
String
value
)
{
return
iotDataList
.
stream
().
filter
(
x
->
value
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpStart
))).
collect
(
Collectors
.
toList
());
return
iotDataList
.
stream
().
filter
(
x
->
x
.
containsKey
(
PressurePumpRelateEnum
.
CREATED_TIME
.
getValue
())
&&
value
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpStart
))).
collect
(
Collectors
.
toList
());
}
private
List
<
IotDataVO
>
getRedisDataFilterList
(
List
<
IotDataVO
>
redisDataList
,
String
value
,
Date
beforeDate
)
{
...
...
@@ -206,9 +206,9 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
private
List
<
Map
<
String
,
String
>>
getIotDataFilterList
(
List
<
Map
<
String
,
String
>>
iotDataList
,
String
value
,
Date
beforeDate
)
{
if
(
beforeDate
!=
null
)
{
return
iotDataList
.
stream
().
filter
(
x
->
DateUtils
.
dateCompare
(
DateUtils
.
longStr2Date
(
x
.
get
(
PressurePumpRelateEnum
.
CREATED_TIME
.
getValue
())),
beforeDate
)
>=
0
&&
value
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpPipePressure
))).
collect
(
Collectors
.
toList
());
return
iotDataList
.
stream
().
filter
(
x
->
x
.
containsKey
(
PressurePumpRelateEnum
.
CREATED_TIME
.
getValue
())
&&
DateUtils
.
dateCompare
(
DateUtils
.
longStr2Date
(
x
.
get
(
PressurePumpRelateEnum
.
CREATED_TIME
.
getValue
())),
beforeDate
)
>=
0
&&
value
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpPipePressure
))).
collect
(
Collectors
.
toList
());
}
return
iotDataList
.
stream
().
filter
(
x
->
value
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpPipePressure
))).
collect
(
Collectors
.
toList
());
return
iotDataList
.
stream
().
filter
(
x
->
x
.
containsKey
(
PressurePumpRelateEnum
.
CREATED_TIME
.
getValue
())
&&
value
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpPipePressure
))).
collect
(
Collectors
.
toList
());
}
@Override
...
...
@@ -257,8 +257,8 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
String
durationTime
=
nowStrLong
;
if
(
CollectionUtils
.
isNotEmpty
(
iotDataList
))
{
String
value
=
iotDataList
.
get
(
0
).
get
(
pressurePumpStart
);
List
<
Map
<
String
,
String
>>
falseDataList
=
iotDataList
.
stream
().
filter
(
x
->
x
.
containsKey
(
PressurePumpRelateEnum
.
CREATED_TIME
.
getValue
())
&&
"false"
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpStart
))).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
trueDataList
=
iotDataList
.
stream
().
filter
(
x
->
x
.
containsKey
(
PressurePumpRelateEnum
.
CREATED_TIME
.
getValue
())
&&
"true"
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpStart
))).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
falseDataList
=
getIotDataFilterList
(
iotDataList
,
PressurePumpRelateEnum
.
IOT_INDEX_VALUE_FALSE
.
getValue
());
List
<
Map
<
String
,
String
>>
trueDataList
=
getIotDataFilterList
(
iotDataList
,
PressurePumpRelateEnum
.
IOT_INDEX_VALUE_TRUE
.
getValue
());
if
(
PressurePumpRelateEnum
.
IOT_INDEX_VALUE_TRUE
.
getValue
().
equalsIgnoreCase
(
value
))
{
durationTime
=
iotDataList
.
get
(
0
).
get
(
PressurePumpRelateEnum
.
CREATED_TIME
.
getValue
());
}
else
{
...
...
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