Commit 01f45382 by 杨伟程
parents a5583251 99b64558
...@@ -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);
} }
......
...@@ -20,7 +20,7 @@ public class PlatAlarmConfigBehaviorDTOVO { ...@@ -20,7 +20,7 @@ public class PlatAlarmConfigBehaviorDTOVO {
@ApiModelProperty("平均停留时长允许范围") @ApiModelProperty("平均停留时长允许范围")
private Integer duration; private Integer averageDuration;
} }
...@@ -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.getAverageDuration();//分钟
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment