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
01f45382
authored
Sep 26, 2023
by
杨伟程
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'dev' of
http://git.xmmakeit.com/huangjiay/iot-platform-server
into dev
parents
a5583251
99b64558
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
server-module/src/main/java/com/makeit/module/controller/alarm/PlatAlarmConfigController.java
server-service/src/main/java/com/makeit/dto/platform/alarm/PlatAlarmConfigBehaviorDTOVO.java
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/BehaviorAlarm.java
server-module/src/main/java/com/makeit/module/controller/alarm/PlatAlarmConfigController.java
View file @
01f45382
...
@@ -7,6 +7,7 @@ import com.makeit.common.response.ApiResponseEntity;
...
@@ -7,6 +7,7 @@ import com.makeit.common.response.ApiResponseEntity;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.dto.platform.alarm.PlatAlarmConfigDTOVO
;
import
com.makeit.dto.platform.alarm.PlatAlarmConfigDTOVO
;
import
com.makeit.dto.platform.alarm.PlatAlarmConfigQueryDTO
;
import
com.makeit.dto.platform.alarm.PlatAlarmConfigQueryDTO
;
import
com.makeit.entity.platform.alarm.PlatAlarmConfig
;
import
com.makeit.global.annotation.AuthIgnore
;
import
com.makeit.global.annotation.AuthIgnore
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.service.platform.alarm.PlatAlarmConfigService
;
import
com.makeit.service.platform.alarm.PlatAlarmConfigService
;
...
@@ -90,9 +91,9 @@ public class PlatAlarmConfigController {
...
@@ -90,9 +91,9 @@ public class PlatAlarmConfigController {
@PostMapping
(
"test"
)
@PostMapping
(
"test"
)
@TenantIdIgnore
@TenantIdIgnore
@AuthIgnore
@AuthIgnore
public
ApiResponseEntity
<
?
>
test
(
@Validated
@RequestBody
PlatAlarmConfigDTOVO
dto
)
{
public
ApiResponseEntity
<
PlatAlarmConfig
>
test
(
@Validated
@RequestBody
PlatAlarmConfigDTOVO
dto
)
{
alarmConfigCacheUtil
.
get
(
dto
.
getOrgId
(),
dto
.
getAlarmType
());
PlatAlarmConfig
config
=
alarmConfigCacheUtil
.
get
(
dto
.
getOrgId
(),
dto
.
getAlarmType
());
return
ApiResponseUtils
.
success
();
return
ApiResponseUtils
.
success
(
config
);
}
}
...
...
server-service/src/main/java/com/makeit/dto/platform/alarm/PlatAlarmConfigBehaviorDTOVO.java
View file @
01f45382
...
@@ -20,7 +20,7 @@ public class PlatAlarmConfigBehaviorDTOVO {
...
@@ -20,7 +20,7 @@ public class PlatAlarmConfigBehaviorDTOVO {
@ApiModelProperty
(
"平均停留时长允许范围"
)
@ApiModelProperty
(
"平均停留时长允许范围"
)
private
Integer
d
uration
;
private
Integer
averageD
uration
;
}
}
server-service/src/main/java/com/makeit/service/platform/alarm/alarmStrategy/BehaviorAlarm.java
View file @
01f45382
...
@@ -73,7 +73,7 @@ public class BehaviorAlarm implements IAlarm {
...
@@ -73,7 +73,7 @@ public class BehaviorAlarm implements IAlarm {
}
}
String
personState
=
Convert
.
toStr
(
properties
.
get
(
"personState"
));
String
personState
=
Convert
.
toStr
(
properties
.
get
(
"personState"
));
PlatAlarmConfigBehaviorDTOVO
ruleConfig
=
JsonUtil
.
toObj
(
ruleConfigStr
,
PlatAlarmConfigBehaviorDTOVO
.
class
);
PlatAlarmConfigBehaviorDTOVO
ruleConfig
=
JsonUtil
.
toObj
(
ruleConfigStr
,
PlatAlarmConfigBehaviorDTOVO
.
class
);
Integer
duration
=
ruleConfig
.
getDuration
();
//分钟
Integer
duration
=
ruleConfig
.
get
Average
Duration
();
//分钟
PlatDayDurationRecord
platDayDurationRecord
=
dayDurationUtil
.
get
(
platDevice
.
getOriDeviceId
());
PlatDayDurationRecord
platDayDurationRecord
=
dayDurationUtil
.
get
(
platDevice
.
getOriDeviceId
());
// if (platDayDurationRecord == null) {
// if (platDayDurationRecord == null) {
// log.error("行为告警未找到行为异常平均时长,设备plat_id:" + platDevice.getId());
// log.error("行为告警未找到行为异常平均时长,设备plat_id:" + platDevice.getId());
...
@@ -116,6 +116,8 @@ public class BehaviorAlarm implements IAlarm {
...
@@ -116,6 +116,8 @@ public class BehaviorAlarm implements IAlarm {
log
.
error
(
"空间雷达发出告警,设备plat_id:"
+
platDevice
.
getId
());
log
.
error
(
"空间雷达发出告警,设备plat_id:"
+
platDevice
.
getId
());
if
(
duration1
!=
0
)
{
if
(
duration1
!=
0
)
{
notice
(
platAlarmCheckDTO
);
notice
(
platAlarmCheckDTO
);
}
else
{
return
;
}
}
alarmRedisDTO
.
setAlarm
(
CommonEnum
.
YES
.
getValue
());
alarmRedisDTO
.
setAlarm
(
CommonEnum
.
YES
.
getValue
());
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_BEHAVIOR_ID
+
deviceId
,
alarmRedisDTO
);
RedisUtil
.
set
(
RedisConst
.
ALARM_DEVICE_BEHAVIOR_ID
+
deviceId
,
alarmRedisDTO
);
...
...
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