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
5c4ab660
authored
Oct 24, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix: 修复bug
parent
fdf03315
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/BreathAlarm.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderServiceImpl.java
server-web/src/main/java/com/makeit/mqtt/PushCallback.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/BreathAlarm.java
View file @
5c4ab660
...
...
@@ -71,7 +71,7 @@ public class BreathAlarm implements IAlarm {
PlatAlarmConfig
config
=
platAlarmCheckDTO
.
getPlatAlarmConfig
();
String
ruleConfigStr
=
config
.
getRuleConfig
();
if
(
CommonEnum
.
NO
.
getValue
().
equals
(
config
.
getStatus
()))
{
log
.
error
(
"呼吸告警配置为
启
用,告警配置id:"
+
config
.
getId
());
log
.
error
(
"呼吸告警配置为
警
用,告警配置id:"
+
config
.
getId
());
return
;
}
if
(
StringUtils
.
isBlank
(
ruleConfigStr
))
{
...
...
@@ -91,6 +91,12 @@ public class BreathAlarm implements IAlarm {
String
deviceId
=
platDevice
.
getId
();
String
personState
=
Convert
.
toStr
(
properties
.
get
(
"personState"
));
int
hasPerson
=
(
int
)
properties
.
get
(
"person"
);
if
(
"0"
.
equals
(
hasPerson
))
{
log
.
info
(
"当前上报数据无人,不需要告警"
);
return
;
}
//呼吸率
int
br
=
(
int
)
properties
.
get
(
"br"
);
...
...
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderServiceImpl.java
View file @
5c4ab660
...
...
@@ -123,7 +123,7 @@ public class PlatElderServiceImpl extends ServiceImpl<PlatElderMapper, PlatElder
.
in
(
CollectionUtils
.
isNotEmpty
(
orgIdList
),
PlatElder:
:
getOrgId
,
orgIdList
)
.
like
(
StringUtils
.
isNotBlank
(
dto
.
getCertificateNumber
()),
PlatElder:
:
getCertificateNumber
,
dto
.
getCertificateNumber
())
.
apply
(
StringUtils
.
isNotBlank
(
dto
.
getSpaceId
()),
"find_in_set('"
+
dto
.
getSpaceId
()
+
"',space_path)"
)
.
apply
(
StringUtils
.
isNotBlank
(
dto
.
getOrgId
()),
"find_in_set('"
+
dto
.
getOrgId
()
+
"',org_path)"
)
//
.apply(StringUtils.isNotBlank(dto.getOrgId()), "find_in_set('" + dto.getOrgId() + "',org_path)")
.
orderByDesc
(
PlatElder:
:
getId
);
}
...
...
server-web/src/main/java/com/makeit/mqtt/PushCallback.java
View file @
5c4ab660
...
...
@@ -10,6 +10,7 @@ import com.makeit.dto.platform.alarm.PlatAlarmCheckDTO;
import
com.makeit.entity.platform.alarm.PlatAlarmConfig
;
import
com.makeit.entity.platform.device.PlatDevice
;
import
com.makeit.entity.saas.PlatTenant
;
import
com.makeit.enums.CommonEnum
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.module.iot.enums.DeviceState
;
import
com.makeit.module.iot.vo.DeviceInfo
;
...
...
@@ -144,6 +145,10 @@ public class PushCallback implements MqttCallback {
return
;
}
for
(
PlatAlarmConfig
config
:
deviceAlarmConfigList
)
{
if
(
CommonEnum
.
NO
.
getValue
().
equals
(
config
.
getStatus
()))
{
logger
.
error
(
"告警配置为禁用,告警配置id:"
+
config
.
getId
());
continue
;
}
String
alarmType
=
config
.
getAlarmType
();
for
(
IAlarm
alarm
:
alarmList
)
{
...
...
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