Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cb4d4438
authored
Dec 24, 2023
by
汪志阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:测试环境暂时关闭
parent
0517f9e3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
View file @
cb4d4438
...
@@ -53,6 +53,9 @@ public class OffBedAlarm implements IAlarm {
...
@@ -53,6 +53,9 @@ public class OffBedAlarm implements IAlarm {
*/
*/
@Override
@Override
public
void
checkConfig
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
public
void
checkConfig
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
if
(
1
==
1
)
{
return
;
}
PlatDevice
platDevice
=
platAlarmCheckDTO
.
getPlatDevice
();
PlatDevice
platDevice
=
platAlarmCheckDTO
.
getPlatDevice
();
platAlarmRecordService
.
getElderListByDeviceId
(
platAlarmCheckDTO
);
platAlarmRecordService
.
getElderListByDeviceId
(
platAlarmCheckDTO
);
log
.
info
(
"执行离床checkConfig方法:"
);
log
.
info
(
"执行离床checkConfig方法:"
);
...
@@ -62,16 +65,8 @@ public class OffBedAlarm implements IAlarm {
...
@@ -62,16 +65,8 @@ public class OffBedAlarm implements IAlarm {
return
;
return
;
}
}
PlatAlarmConfig
config
=
alarmConfigCacheUtil
.
get
(
platDevice
.
getOrgId
(),
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
OFF_BED
.
getValue
());
PlatAlarmConfig
config
=
alarmConfigCacheUtil
.
get
(
platDevice
.
getOrgId
(),
PlatAlarmConfigEnum
.
AlarmTypeEnum
.
OFF_BED
.
getValue
());
log
.
info
(
"当前config:{},dto config:{}"
,
config
.
getRuleConfig
(),
platAlarmCheckDTO
.
getPlatAlarmConfig
().
getRuleConfig
());
//
log.info("当前config:{},dto config:{}", config.getRuleConfig(), platAlarmCheckDTO.getPlatAlarmConfig().getRuleConfig());
offBedCheckAlarm
(
config
,
platAlarmCheckDTO
,
platDevice
);
offBedCheckAlarm
(
config
,
platAlarmCheckDTO
,
platDevice
);
// PlatAlarmConfig platAlarmConfig = platAlarmCheckDTO.getPlatAlarmConfig();
// List<PlatAlarmConfig> configList = platAlarmConfigService.listOfBed(platDevice.getId());
// if (CollUtil.isNotEmpty(configList)) {
// configList.forEach(c -> {
// log.info("离床告警dto,org_config:{},设备id:{}", c.getRuleConfig(), platDevice.getId());
// offBedCheckAlarm(c, platAlarmCheckDTO, platDevice);
// });
// }
}
}
...
@@ -193,7 +188,7 @@ public class OffBedAlarm implements IAlarm {
...
@@ -193,7 +188,7 @@ public class OffBedAlarm implements IAlarm {
platAlarmCheckDTO
.
setPlatAlarmConfig
(
config
);
platAlarmCheckDTO
.
setPlatAlarmConfig
(
config
);
noticeAlarm
(
alarmRedisDTO
,
platAlarmCheckDTO
,
deviceId
);
noticeAlarm
(
alarmRedisDTO
,
platAlarmCheckDTO
,
deviceId
);
}
else
{
}
else
{
log
.
info
(
"deviceId:{},cross离床告警,第一次离床时间在范围前,未预警,配置:{},
时间持续:{},start:{}"
,
deviceId
,
config
.
getRuleConfig
(),
mills
,
startLocalDteTime
);
log
.
info
(
"deviceId:{},cross离床告警,第一次离床时间在范围前,未预警,配置:{},
"
,
deviceId
,
config
.
getRuleConfig
()
);
}
}
}
else
{
}
else
{
...
@@ -243,7 +238,7 @@ public class OffBedAlarm implements IAlarm {
...
@@ -243,7 +238,7 @@ public class OffBedAlarm implements IAlarm {
}
}
LocalDateTime
now
=
currentTime
();
LocalDateTime
now
=
currentTime
();
LocalTime
localTime
=
LocalTime
.
now
()
.
plusHours
(
8
)
;
LocalTime
localTime
=
LocalTime
.
now
();
if
(!
isInTime
&&
localTime
.
isAfter
(
startTime
)
&&
localTime
.
isBefore
(
endTime
))
{
if
(!
isInTime
&&
localTime
.
isAfter
(
startTime
)
&&
localTime
.
isBefore
(
endTime
))
{
long
mills
=
Duration
.
between
(
startLocalDteTime
,
now
).
toMillis
()
/
1000
;
long
mills
=
Duration
.
between
(
startLocalDteTime
,
now
).
toMillis
()
/
1000
;
boolean
noInOverTime
=
mills
>=
duration
*
60
;
boolean
noInOverTime
=
mills
>=
duration
*
60
;
...
@@ -253,7 +248,7 @@ public class OffBedAlarm implements IAlarm {
...
@@ -253,7 +248,7 @@ public class OffBedAlarm implements IAlarm {
platAlarmCheckDTO
.
setPlatAlarmConfig
(
config
);
platAlarmCheckDTO
.
setPlatAlarmConfig
(
config
);
noticeAlarm
(
alarmRedisDTO
,
platAlarmCheckDTO
,
deviceId
);
noticeAlarm
(
alarmRedisDTO
,
platAlarmCheckDTO
,
deviceId
);
}
else
{
}
else
{
log
.
info
(
"deviceId:{},uncross离床告警第一次离床时间在范围前,未预警,配置:{}
,时间持续:{},start:{}"
,
deviceId
,
config
.
getRuleConfig
(),
mills
,
startLocalDteTime
);
log
.
info
(
"deviceId:{},uncross离床告警第一次离床时间在范围前,未预警,配置:{}
"
,
deviceId
,
config
.
getRuleConfig
()
);
}
}
}
else
{
}
else
{
log
.
info
(
"deviceId:{},UnCrossDay 未满足预警条件!fis:{},config:{}"
,
deviceId
,
firstTime
,
config
.
getRuleConfig
());
log
.
info
(
"deviceId:{},UnCrossDay 未满足预警条件!fis:{},config:{}"
,
deviceId
,
firstTime
,
config
.
getRuleConfig
());
...
@@ -328,7 +323,7 @@ public class OffBedAlarm implements IAlarm {
...
@@ -328,7 +323,7 @@ public class OffBedAlarm implements IAlarm {
}
}
private
static
LocalDateTime
currentTime
()
{
private
static
LocalDateTime
currentTime
()
{
return
LocalDateTime
.
now
()
.
plusHours
(
8
)
;
return
LocalDateTime
.
now
();
// return LocalDateTime.now();
// return LocalDateTime.now();
}
}
...
...
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