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
b6c995de
authored
Dec 28, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat:非空判断
parent
546058a2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
server-web/src/main/java/com/makeit/mqtt/PushCallback.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/OffBedAlarm.java
View file @
b6c995de
...
@@ -51,7 +51,7 @@ public class OffBedAlarm implements IAlarm {
...
@@ -51,7 +51,7 @@ public class OffBedAlarm implements IAlarm {
public
void
checkConfig
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
public
void
checkConfig
(
PlatAlarmCheckDTO
platAlarmCheckDTO
)
{
PlatDevice
platDevice
=
platAlarmCheckDTO
.
getPlatDevice
();
PlatDevice
platDevice
=
platAlarmCheckDTO
.
getPlatDevice
();
platAlarmRecordService
.
getElderListByDeviceId
(
platAlarmCheckDTO
);
platAlarmRecordService
.
getElderListByDeviceId
(
platAlarmCheckDTO
);
log
.
info
(
"执行离床checkConfig方法:"
);
//
log.info("执行离床checkConfig方法:");
List
<
PlatElder
>
platElderList
=
platAlarmCheckDTO
.
getPlatElderList
();
List
<
PlatElder
>
platElderList
=
platAlarmCheckDTO
.
getPlatElderList
();
if
(
CollectionUtils
.
isEmpty
(
platElderList
))
{
if
(
CollectionUtils
.
isEmpty
(
platElderList
))
{
log
.
error
(
"离床告警心率设备未关联长者,设备plat_id:"
+
platAlarmCheckDTO
.
getPlatDevice
().
getId
());
log
.
error
(
"离床告警心率设备未关联长者,设备plat_id:"
+
platAlarmCheckDTO
.
getPlatDevice
().
getId
());
...
...
server-web/src/main/java/com/makeit/mqtt/PushCallback.java
View file @
b6c995de
...
@@ -27,6 +27,7 @@ import com.makeit.service.saas.PlatTenantService;
...
@@ -27,6 +27,7 @@ import com.makeit.service.saas.PlatTenantService;
import
com.makeit.service.saas.SaasSleepAnalysisModelService
;
import
com.makeit.service.saas.SaasSleepAnalysisModelService
;
import
com.makeit.utils.AlarmConfigCacheUtil
;
import
com.makeit.utils.AlarmConfigCacheUtil
;
import
com.makeit.utils.DeviceCacheUtil
;
import
com.makeit.utils.DeviceCacheUtil
;
import
com.makeit.utils.old.StringUtils
;
import
com.makeit.utils.redis.RedisUtil
;
import
com.makeit.utils.redis.RedisUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.eclipse.paho.client.mqttv3.IMqttDeliveryToken
;
import
org.eclipse.paho.client.mqttv3.IMqttDeliveryToken
;
...
@@ -195,7 +196,7 @@ public class PushCallback implements MqttCallback {
...
@@ -195,7 +196,7 @@ public class PushCallback implements MqttCallback {
String
messageType
=
device
.
getMessageType
();
String
messageType
=
device
.
getMessageType
();
//更新设备状态
//更新设备状态
platDeviceService
.
updateDeviceStatus
(
messageType
,
deviceId
,
""
);
platDeviceService
.
updateDeviceStatus
(
messageType
,
deviceId
,
""
);
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
equalsAnyIgnoreCase
(
messageType
,
DeviceState
.
online
.
getValue
()))
{
if
(
StringUtils
.
equalsAnyIgnoreCase
(
messageType
,
DeviceState
.
online
.
getValue
()))
{
return
;
return
;
}
}
for
(
HeaderInfo
.
Bind
binding
:
bindings
)
{
for
(
HeaderInfo
.
Bind
binding
:
bindings
)
{
...
@@ -238,7 +239,9 @@ public class PushCallback implements MqttCallback {
...
@@ -238,7 +239,9 @@ public class PushCallback implements MqttCallback {
platAlarmCheckDTO
.
setProperties
(
properties
);
platAlarmCheckDTO
.
setProperties
(
properties
);
//设备状态
//设备状态
platAlarmCheckDTO
.
setMessageType
(
messageType
);
platAlarmCheckDTO
.
setMessageType
(
messageType
);
if
(
properties
!=
null
)
{
platAlarmCheckDTO
.
setDeviceTime
(
properties
.
getString
(
"alarmId"
));
platAlarmCheckDTO
.
setDeviceTime
(
properties
.
getString
(
"alarmId"
));
}
alarm
.
checkConfig
(
platAlarmCheckDTO
);
alarm
.
checkConfig
(
platAlarmCheckDTO
);
}
}
}
}
...
...
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