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
647894ad
Commit
647894ad
authored
Feb 24, 2023
by
高建强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item:调整稳压泵近3日统计数据,兼容柱状图数据存储结构
parent
c2c21787
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
61 deletions
+86
-61
DateUtils.java
...ava/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
+1
-1
IPressurePumpService.java
...com/yeejoin/equipmanage/service/IPressurePumpService.java
+26
-2
EmergencyServiceImpl.java
...eejoin/equipmanage/service/impl/EmergencyServiceImpl.java
+18
-7
PressurePumpServiceImpl.java
...oin/equipmanage/service/impl/PressurePumpServiceImpl.java
+27
-48
SupervisionVideoServiceImpl.java
...equipmanage/service/impl/SupervisionVideoServiceImpl.java
+14
-3
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
View file @
647894ad
...
...
@@ -912,7 +912,7 @@ public class DateUtils {
while
(
true
)
{
if
(
MONTH_DAY_HOUR_PATTERN
.
equals
(
pattern
))
{
date
=
dateAddMinutes
(
date
,
60
);
}
else
if
(
MONTH_DAY_PATTERN
.
equals
(
pattern
))
{
}
else
if
(
DATE_PATTERN
.
equals
(
pattern
)
||
MONTH_DAY_PATTERN
.
equals
(
pattern
))
{
date
=
dateAddDays
(
date
,
1
);
}
else
{
date
=
dateAddMinutes
(
date
,
1
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/IPressurePumpService.java
View file @
647894ad
...
...
@@ -134,9 +134,33 @@ public interface IPressurePumpService {
*/
Object
mapToObject
(
Map
<
String
,
String
>
map
,
Class
<?>
aClass
,
String
indexKey
)
throws
IllegalAccessException
,
InstantiationException
;
List
<
PressurePumpCountVo
>
getDayAvgDataList
(
List
<
Map
<
String
,
Object
>>
pumpInfoList
,
String
infoCode
,
String
countRedisKey
,
String
equipmentCode
,
String
nameKey
,
String
bizOrgCode
,
long
countExpire
);
/**
* 获取iot指标统计数据
* @param startTime
* @param endTime
* @param infoCode
* @param countRedisKey
* @param prefix
* @param suffix
* @param key
* @param fieldKey
* @param expire
* @return
*/
List
<
PressurePumpCountVo
>
getIotCountData
(
String
startTime
,
String
endTime
,
String
infoCode
,
String
countRedisKey
,
String
prefix
,
String
suffix
,
String
key
,
String
fieldKey
,
long
expire
);
/**
* 获取稳压泵时间范围统计数据
* @param pumpInfoList
* @param startTime
* @param endTime
* @param infoCode
* @param countRedisKey
* @param equipmentCode
* @param nameKey
* @param countExpire
* @param bizOrgCode
* @return
*/
Map
<
String
,
List
<
PressurePumpCountVo
>>
getDateRangeCountList
(
List
<
Map
<
String
,
Object
>>
pumpInfoList
,
String
startTime
,
String
endTime
,
String
infoCode
,
String
countRedisKey
,
String
equipmentCode
,
String
nameKey
,
long
countExpire
,
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EmergencyServiceImpl.java
View file @
647894ad
...
...
@@ -232,6 +232,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
@Override
public
List
<
Map
<
String
,
Object
>>
getPressurePumpDiagnosticAnalysis
(
String
bizOrgCode
)
{
try
{
// 从 json 配置文件获取配置信息
List
<
Map
>
infoList
=
pressurePumpService
.
getNameKeyInfoList
(
PressurePumpRelateEnum
.
PRESSURE_PUMP
.
getValue
());
if
(!
CollectionUtils
.
isEmpty
(
infoList
))
{
...
...
@@ -267,16 +268,26 @@ public class EmergencyServiceImpl implements IEmergencyService {
PressurePumpAnalysisEnum
.
PRESSURE_PUMP_HALF
.
setValue
(
halfFrequency
);
// 5. 今日启动次数,前3天启动次数的均值
// 获取稳压泵数据,redis没有,从iot取
List
<
PressurePumpCountVo
>
dayAvgDataList
=
pressurePumpService
.
getDayAvgDataList
(
pumpInfoList
,
PressurePumpRelateEnum
.
PRESSURE_PUMP
.
getValue
(),
countRedisKey
,
equipmentCode
,
pressurePumpStart
,
bizOrgCode
,
countExpire
);
Date
startDate
=
DateUtils
.
dateAddDays
(
dateNow
,
Integer
.
parseInt
(
PressurePumpRelateEnum
.
DAY_AVG
.
getValue
()));
String
startTime
=
String
.
join
(
" "
,
DateUtils
.
dateFormat
(
startDate
,
DateUtils
.
DATE_PATTERN
),
"00:00:00"
);
String
endTime
=
String
.
join
(
" "
,
DateUtils
.
dateFormat
(
dateNow
,
DateUtils
.
DATE_PATTERN
),
"00:00:00"
);
Map
<
String
,
List
<
PressurePumpCountVo
>>
dayAvgDataMap
=
pressurePumpService
.
getDateRangeCountList
(
pumpInfoList
,
startTime
,
endTime
,
PressurePumpRelateEnum
.
PRESSURE_PUMP
.
getValue
(),
countRedisKey
,
equipmentCode
,
pressurePumpStart
,
countExpire
,
bizOrgCode
);
AtomicInteger
dayAvgFrequency
=
new
AtomicInteger
();
if
(!
CollectionUtils
.
isEmpty
(
dayAvgDataList
))
{
dayAvgDataList
.
forEach
(
x
->
dayAvgFrequency
.
addAndGet
(
x
.
getValue
()));
if
(!
CollectionUtils
.
isEmpty
(
dayAvgDataMap
))
{
for
(
List
<
PressurePumpCountVo
>
voList
:
dayAvgDataMap
.
values
())
{
if
(!
CollectionUtils
.
isEmpty
(
voList
))
{
voList
.
forEach
(
x
->
dayAvgFrequency
.
addAndGet
(
x
.
getValue
()));
}
}
}
PressurePumpAnalysisEnum
.
PRESSURE_PUMP_DAY_AVG
.
setValue
(
Math
.
round
(
dayAvgFrequency
.
get
()
/
Math
.
abs
(
Integer
.
parseInt
(
PressurePumpRelateEnum
.
DAY_AVG
.
getValue
()))));
// 6. 管网压力状态
double
pressureDiff
=
pressurePumpService
.
getAllPressurePumpPipePressureDiff
(
dataList
,
dataPipeList
,
PressurePumpRelateEnum
.
PRESSURE_PUMP_START_BEFORE_MINUTE
.
getValue
());
PressurePumpAnalysisEnum
.
PRESSURE_PUMP_PIPE
.
setValue
(
pressureDiff
>
Double
.
parseDouble
(
PressurePumpRelateEnum
.
PIPE_PRESSURE_DIFF
.
getValue
())
?
PressurePumpRelateEnum
.
PIPE_PRESSURE_ABNORMAL_STATUS
.
getValue
()
:
PressurePumpRelateEnum
.
PIPE_PRESSURE_NORMAL_STATUS
.
getValue
());
}
}
catch
(
ParseException
e
)
{
log
.
error
(
"getPressurePumpDiagnosticAnalysis-->获取稳压泵诊断与分析失败:{}"
,
e
.
getMessage
());
}
return
PressurePumpAnalysisEnum
.
getList
();
}
...
...
@@ -296,7 +307,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
// 从redis获取日期范围数据,没有从iot获取。redis存储数据并返回
Map
<
String
,
List
<
PressurePumpCountVo
>>
dateRangeCountMap
=
pressurePumpService
.
getDateRangeCountList
(
pumpInfoList
,
startTime
,
endTime
,
PressurePumpRelateEnum
.
PRESSURE_PUMP
.
getValue
(),
countRedisKey
,
equipmentCode
,
pressurePumpStart
,
countExpire
,
bizOrgCode
);
if
(!
CollectionUtils
.
isEmpty
(
pumpInfoList
))
{
List
<
String
>
timeList
=
DateUtils
.
getTimeStrListByStartAndEnd
(
startTime
,
endTime
,
DateUtils
.
MONTH_DAY
_PATTERN
);
List
<
String
>
timeList
=
DateUtils
.
getTimeStrListByStartAndEnd
(
startTime
,
endTime
,
DateUtils
.
DATE
_PATTERN
);
List
<
Map
<
String
,
Object
>>
yDataList
=
new
ArrayList
<>();
for
(
Map
<
String
,
Object
>
pumpMap
:
pumpInfoList
)
{
Object
iotCode
=
pumpMap
.
get
(
"iotCode"
);
...
...
@@ -307,7 +318,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
String
iotCodeStr
=
iotCode
.
toString
();
List
<
PressurePumpCountVo
>
countVoList
=
dateRangeCountMap
.
get
(
iotCodeStr
);
Map
<
String
,
List
<
PressurePumpCountVo
>>
collect
=
countVoList
.
stream
().
collect
(
Collectors
.
groupingBy
(
PressurePumpCountVo:
:
getTime
));
List
<
PressurePumpCountVo
>
data
=
collect
.
get
(
"2023-"
+
time
);
List
<
PressurePumpCountVo
>
data
=
collect
.
get
(
time
);
dataList
.
add
(
CollectionUtils
.
isEmpty
(
data
)
?
0
:
data
.
get
(
0
).
getValue
());
}
else
{
dataList
.
add
(
0
);
...
...
@@ -317,7 +328,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
dataMap
.
put
(
"data"
,
dataList
);
yDataList
.
add
(
dataMap
);
}
map
.
put
(
"xData"
,
timeList
);
List
<
String
>
collect
=
timeList
.
stream
().
map
(
x
->
x
.
substring
(
4
)).
collect
(
Collectors
.
toList
());
map
.
put
(
"xData"
,
collect
);
map
.
put
(
"yData"
,
yDataList
);
}
}
...
...
@@ -380,7 +392,6 @@ public class EmergencyServiceImpl implements IEmergencyService {
List
<
String
>
sortTimeList
=
new
ArrayList
<>(
timeSet
);
Collections
.
sort
(
sortTimeList
);
// 数据时间截取,MM-dd HH:mm
// List<String> sortTimeCollectList = sortTimeList.stream().map(x -> DateUtils.dateFormat(DateUtils.convertStrToDate(x, DateUtils.DATE_TIME_PATTERN),DateUtils.MONTH_DAY_HOUR_MINUTE_PATTERN)).collect(Collectors.toList());
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
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/PressurePumpServiceImpl.java
View file @
647894ad
...
...
@@ -274,24 +274,32 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
}
@Override
public
List
<
PressurePumpCountVo
>
getDayAvgDataList
(
List
<
Map
<
String
,
Object
>>
pumpInfoList
,
String
infoCode
,
String
countRedisKey
,
String
equipmentCode
,
String
nameKey
,
String
bizOrgCode
,
long
countExpire
)
{
public
Map
<
String
,
List
<
PressurePumpCountVo
>>
getDateRangeCountList
(
List
<
Map
<
String
,
Object
>>
pumpInfoList
,
String
startTime
,
String
endTime
,
String
infoCode
,
String
countRedisKey
,
String
equipmentCode
,
String
nameKey
,
long
countExpire
,
String
bizOrgCode
)
{
Map
<
String
,
List
<
PressurePumpCountVo
>>
dataMap
=
new
HashMap
<>();
try
{
Date
dateNow
=
DateUtils
.
convertStrToDate
(
DateUtils
.
getDateNowString
(),
DateUtils
.
DATE_PATTERN
);
Date
beforeDate
=
DateUtils
.
dateAddDays
(
dateNow
,
Integer
.
parseInt
(
PressurePumpRelateEnum
.
DAY_AVG
.
getValue
()));
List
<
PressurePumpCountVo
>
dataList
=
getCountDataToRedisByDateBetween
(
PressurePumpRelateEnum
.
PRESSURE_PUMP
.
getValue
(),
countRedisKey
,
nameKey
,
null
,
beforeDate
,
dateNow
);
if
(
CollectionUtils
.
isNotEmpty
(
pumpInfoList
)
&&
(
CollectionUtils
.
isEmpty
(
dataList
)
||
dataList
.
size
()
<
Math
.
abs
(
Integer
.
parseInt
(
PressurePumpRelateEnum
.
DAY_AVG
.
getValue
()))))
{
if
(
CollectionUtils
.
isNotEmpty
(
pumpInfoList
))
{
for
(
Map
<
String
,
Object
>
map
:
pumpInfoList
)
{
// iot获取数据,返回并存储redis
String
startTime
=
DateUtils
.
convertDateToString
(
beforeDate
,
DateUtils
.
DATE_TIME_PATTERN
);
String
endTime
=
DateUtils
.
convertDateToString
(
dateNow
,
DateUtils
.
DATE_TIME_PATTERN
);
Object
iotCode
=
pumpInfoList
.
get
(
0
).
get
(
"iotCode"
);
String
prefix
=
ObjectUtils
.
isEmpty
(
iotCode
)
?
""
:
iotCode
.
toString
().
substring
(
0
,
8
);
dataList
=
getIotCountData
(
startTime
,
endTime
,
infoCode
,
countRedisKey
,
prefix
,
null
,
PressurePumpRelateEnum
.
IOT_INDEX_VALUE_TRUE
.
getValue
(),
nameKey
,
countExpire
);
Object
iotCode
=
map
.
get
(
"iotCode"
);
if
(!
ObjectUtils
.
isEmpty
(
iotCode
))
{
String
iotCodeStr
=
iotCode
.
toString
();
Date
startDate
=
DateUtils
.
convertStrToDate
(
startTime
,
DateUtils
.
DATE_PATTERN
);
Date
endDate
=
DateUtils
.
convertStrToDate
(
endTime
,
DateUtils
.
DATE_PATTERN
);
List
<
PressurePumpCountVo
>
dataList
=
getCountDataToRedisByDateBetween
(
PressurePumpRelateEnum
.
PRESSURE_PUMP
.
getValue
(),
countRedisKey
,
nameKey
,
iotCodeStr
,
startDate
,
endDate
);
Long
days
=
DateUtils
.
getDurationDays
(
startTime
,
endTime
,
DateUtils
.
DATE_TIME_PATTERN
);
if
(
CollectionUtils
.
isEmpty
(
dataList
)
||
(
CollectionUtils
.
isNotEmpty
(
dataList
)
&&
dataList
.
size
()
<
days
))
{
String
prefix
=
ObjectUtils
.
isEmpty
(
iotCode
)
?
""
:
iotCodeStr
.
substring
(
0
,
8
);
String
suffix
=
ObjectUtils
.
isEmpty
(
iotCode
)
?
""
:
iotCodeStr
.
substring
(
8
);
dataList
=
getIotCountData
(
startTime
,
endTime
,
infoCode
,
countRedisKey
,
prefix
,
suffix
,
PressurePumpRelateEnum
.
IOT_INDEX_VALUE_TRUE
.
getValue
(),
nameKey
,
countExpire
);
}
dataMap
.
put
(
iotCodeStr
,
dataList
);
}
}
}
return
dataList
;
}
catch
(
ParseException
e
)
{
log
.
error
(
"获取稳压泵
天启动次数
失败:{}"
,
e
.
getMessage
());
log
.
error
(
"获取稳压泵
范围启动统计
失败:{}"
,
e
.
getMessage
());
}
return
Collections
.
emptyList
()
;
return
dataMap
;
}
@Override
...
...
@@ -318,35 +326,6 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
return
Collections
.
emptyList
();
}
@Override
public
Map
<
String
,
List
<
PressurePumpCountVo
>>
getDateRangeCountList
(
List
<
Map
<
String
,
Object
>>
pumpInfoList
,
String
startTime
,
String
endTime
,
String
infoCode
,
String
countRedisKey
,
String
equipmentCode
,
String
nameKey
,
long
countExpire
,
String
bizOrgCode
)
{
Map
<
String
,
List
<
PressurePumpCountVo
>>
dataMap
=
new
HashMap
<>();
try
{
if
(
CollectionUtils
.
isNotEmpty
(
pumpInfoList
))
{
for
(
Map
<
String
,
Object
>
map
:
pumpInfoList
)
{
// iot获取数据,返回并存储redis
Object
iotCode
=
map
.
get
(
"iotCode"
);
if
(!
ObjectUtils
.
isEmpty
(
iotCode
))
{
String
iotCodeStr
=
iotCode
.
toString
();
Date
startDate
=
DateUtils
.
convertStrToDate
(
startTime
,
DateUtils
.
DATE_PATTERN
);
Date
endDate
=
DateUtils
.
convertStrToDate
(
endTime
,
DateUtils
.
DATE_PATTERN
);
List
<
PressurePumpCountVo
>
dataList
=
getCountDataToRedisByDateBetween
(
PressurePumpRelateEnum
.
PRESSURE_PUMP
.
getValue
(),
countRedisKey
,
nameKey
,
iotCodeStr
,
startDate
,
endDate
);
Long
days
=
DateUtils
.
getDurationDays
(
startTime
,
endTime
,
DateUtils
.
DATE_TIME_PATTERN
);
if
(
CollectionUtils
.
isEmpty
(
dataList
)
||
(
CollectionUtils
.
isNotEmpty
(
dataList
)
&&
dataList
.
size
()
<
days
))
{
String
prefix
=
ObjectUtils
.
isEmpty
(
iotCode
)
?
""
:
iotCodeStr
.
substring
(
0
,
8
);
String
suffix
=
ObjectUtils
.
isEmpty
(
iotCode
)
?
""
:
iotCodeStr
.
substring
(
8
);
dataList
=
getIotCountData
(
startTime
,
endTime
,
infoCode
,
countRedisKey
,
prefix
,
suffix
,
PressurePumpRelateEnum
.
IOT_INDEX_VALUE_TRUE
.
getValue
(),
nameKey
,
countExpire
);
dataMap
.
put
(
iotCodeStr
,
dataList
);
}
}
}
}
}
catch
(
ParseException
e
)
{
log
.
error
(
"获取稳压泵范围启动统计失败:{}"
,
e
.
getMessage
());
}
return
dataMap
;
}
// private List<Map<String, String>> getIotDataFilterList(List<Map<String, String>> iotDataList, String value) {
// return iotDataList.stream().filter(x -> x.containsKey(PressurePumpRelateEnum.CREATED_TIME.getValue()) && value.equalsIgnoreCase(x.get(pressurePumpStart))).collect(Collectors.toList());
// }
...
...
@@ -365,12 +344,12 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
return
dataList
;
}
private
List
<
Map
<
String
,
String
>>
getIotDataFilterList
(
List
<
Map
<
String
,
String
>>
iotDataList
,
String
value
,
Date
beforeDate
)
{
if
(
beforeDate
!=
null
)
{
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
->
x
.
containsKey
(
PressurePumpRelateEnum
.
CREATED_TIME
.
getValue
())
&&
value
.
equalsIgnoreCase
(
x
.
get
(
pressurePumpPipePressure
))).
collect
(
Collectors
.
toList
());
}
//
private List<Map<String, String>> getIotDataFilterList(List<Map<String, String>> iotDataList, String value, Date beforeDate) {
//
if (beforeDate != null) {
//
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 -> x.containsKey(PressurePumpRelateEnum.CREATED_TIME.getValue()) && value.equalsIgnoreCase(x.get(pressurePumpPipePressure))).collect(Collectors.toList());
//
}
@Override
public
int
getAllPressurePumpStartFrequency
(
double
hour
,
List
<
IotDataVO
>
dataList
,
Date
dateNow
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/SupervisionVideoServiceImpl.java
View file @
647894ad
...
...
@@ -112,10 +112,21 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
int
twoHourStartNum
=
pressurePumpService
.
getAllPressurePumpStartFrequency
(
Double
.
parseDouble
(
PressurePumpRelateEnum
.
TWO_HOUR
.
getValue
()),
dataListFilterTrue
,
dateNow
);
int
fourHourStartNum
=
pressurePumpService
.
getAllPressurePumpStartFrequency
(
Double
.
parseDouble
(
PressurePumpRelateEnum
.
FOUR_HOUR
.
getValue
()),
dataListFilterTrue
,
dateNow
);
// 近3天启动平均值,四合五入
List
<
PressurePumpCountVo
>
dayAvgDataList
=
pressurePumpService
.
getDayAvgDataList
(
pumpInfoList
,
PressurePumpRelateEnum
.
PRESSURE_PUMP
.
getValue
(),
countRedisKey
,
equipmentCode
,
pressurePumpStart
,
bizOrgCode
,
countExpire
);
AtomicInteger
dayAvgFrequency
=
new
AtomicInteger
();
if
(!
CollectionUtils
.
isEmpty
(
dayAvgDataList
))
{
dayAvgDataList
.
forEach
(
x
->
dayAvgFrequency
.
addAndGet
(
x
.
getValue
()));
try
{
Date
startDate
=
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
.
DateUtils
.
dateAddDays
(
dateNow
,
Integer
.
parseInt
(
PressurePumpRelateEnum
.
DAY_AVG
.
getValue
()));
String
startTime
=
String
.
join
(
" "
,
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
.
DateUtils
.
dateFormat
(
startDate
,
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
.
DateUtils
.
DATE_PATTERN
),
"00:00:00"
);
String
endTime
=
String
.
join
(
" "
,
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
.
DateUtils
.
dateFormat
(
dateNow
,
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
.
DateUtils
.
DATE_PATTERN
),
"00:00:00"
);
Map
<
String
,
List
<
PressurePumpCountVo
>>
dayAvgDataMap
=
pressurePumpService
.
getDateRangeCountList
(
pumpInfoList
,
startTime
,
endTime
,
PressurePumpRelateEnum
.
PRESSURE_PUMP
.
getValue
(),
countRedisKey
,
equipmentCode
,
pressurePumpStart
,
countExpire
,
bizOrgCode
);
if
(!
CollectionUtils
.
isEmpty
(
dayAvgDataMap
))
{
for
(
List
<
PressurePumpCountVo
>
voList
:
dayAvgDataMap
.
values
())
{
if
(!
CollectionUtils
.
isEmpty
(
voList
))
{
voList
.
forEach
(
x
->
dayAvgFrequency
.
addAndGet
(
x
.
getValue
()));
}
}
}
}
catch
(
ParseException
e
)
{
log
.
error
(
"近3天平均启动次数获取失败-->dayAvgFrequency:{}"
,
e
.
getMessage
());
}
int
dayAvgStartNum
=
Math
.
round
(
dayAvgFrequency
.
get
()
/
Math
.
abs
(
Integer
.
parseInt
(
PressurePumpRelateEnum
.
DAY_AVG
.
getValue
())));
pressurePumpInfo
=
fireFightingSystemMapper
.
getPressurePumpInfo
(
page
,
bizOrgCode
,
null
);
...
...
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