Commit 99b64558 by 李小龙

fix:告警配置更新

parent 6bf5cd66
......@@ -7,6 +7,7 @@ import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.alarm.PlatAlarmConfigDTOVO;
import com.makeit.dto.platform.alarm.PlatAlarmConfigQueryDTO;
import com.makeit.entity.platform.alarm.PlatAlarmConfig;
import com.makeit.global.annotation.AuthIgnore;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.service.platform.alarm.PlatAlarmConfigService;
......@@ -90,9 +91,9 @@ public class PlatAlarmConfigController {
@PostMapping("test")
@TenantIdIgnore
@AuthIgnore
public ApiResponseEntity<?> test(@Validated @RequestBody PlatAlarmConfigDTOVO dto) {
alarmConfigCacheUtil.get(dto.getOrgId(),dto.getAlarmType());
return ApiResponseUtils.success();
public ApiResponseEntity<PlatAlarmConfig> test(@Validated @RequestBody PlatAlarmConfigDTOVO dto) {
PlatAlarmConfig config = alarmConfigCacheUtil.get(dto.getOrgId(), dto.getAlarmType());
return ApiResponseUtils.success(config);
}
......
......@@ -20,7 +20,7 @@ public class PlatAlarmConfigBehaviorDTOVO {
@ApiModelProperty("平均停留时长允许范围")
private Integer duration;
private Integer averageDuration;
}
......@@ -73,7 +73,7 @@ public class BehaviorAlarm implements IAlarm {
}
String personState = Convert.toStr(properties.get("personState"));
PlatAlarmConfigBehaviorDTOVO ruleConfig = JsonUtil.toObj(ruleConfigStr, PlatAlarmConfigBehaviorDTOVO.class);
Integer duration = ruleConfig.getDuration();//分钟
Integer duration = ruleConfig.getAverageDuration();//分钟
PlatDayDurationRecord platDayDurationRecord = dayDurationUtil.get(platDevice.getOriDeviceId());
// if (platDayDurationRecord == null) {
// log.error("行为告警未找到行为异常平均时长,设备plat_id:" + platDevice.getId());
......@@ -116,6 +116,8 @@ public class BehaviorAlarm implements IAlarm {
log.error("空间雷达发出告警,设备plat_id:" + platDevice.getId());
if(duration1 != 0) {
notice(platAlarmCheckDTO);
}else {
return;
}
alarmRedisDTO.setAlarm(CommonEnum.YES.getValue());
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