update 采集是判断设备重连以及监听设备断开链接的时间

This commit is contained in:
chenbo 2023-12-14 14:52:43 +08:00
parent 3a6bb32db7
commit 6f9152bccf
1 changed files with 8 additions and 8 deletions

View File

@ -59,38 +59,38 @@ class DataCollectController extends BaseApiController
LandCollection::create($data);
// 设备告警
$monitorThreshold = MonitorThreshold::find();
$monitorThreshold = (new MonitorThreshold())->select()->toArray()[0];
// 风速告警
if ($payload['wind_speed'] > $monitorThreshold['wind_speed_max']) {
self::createAlarm($land[3], $device[1], 'wind_speed', '风速偏快' ,$payload['wind_speed']);
self::createAlarm($land[3], $device[1], '风速', '风速偏快' ,$payload['wind_speed']);
}
// ambient_temperature 环境温度
if ($payload['ambient_temperature'] < $monitorThreshold['air_temp_min']) {
self::createAlarm($land[3], $device[1], 'ambient_temperature', '气温偏低' ,$payload['ambient_temperature']);
self::createAlarm($land[3], $device[1], '环境温度', '气温偏低' ,$payload['ambient_temperature']);
}
// ambient_temperature 环境温度
if ($payload['ambient_temperature'] > $monitorThreshold['air_temp_max']) {
self::createAlarm($land[3], $device[1], 'ambient_temperature', '气温偏高' ,$payload['ambient_temperature']);
self::createAlarm($land[3], $device[1], '环境温度', '气温偏高' ,$payload['ambient_temperature']);
}
// ambient_humidity 环境湿度
if ($payload['ambient_humidity'] < $monitorThreshold['air_mois_min']) {
self::createAlarm($land[3], $device[1], 'ambient_temperature', '空气湿度偏低' ,$payload['ambient_humidity']);
self::createAlarm($land[3], $device[1], '环境湿度', '环境湿度偏低' ,$payload['ambient_humidity']);
}
// ambient_humidity 环境湿度
if ($payload['ambient_humidity'] < $monitorThreshold['air_mois_max']) {
self::createAlarm($land[3], $device[1], 'ambient_temperature', '空气湿度偏高' ,$payload['ambient_humidity']);
self::createAlarm($land[3], $device[1], '环境湿度', '环境湿度偏高' ,$payload['ambient_humidity']);
}
// carbon_dioxide 二氧化碳含量
if ($payload['carbon_dioxide'] > $monitorThreshold['air_co2_content_max']) {
self::createAlarm($land[3], $device[1], 'ambient_temperature', '空气二氧化碳含量偏高' ,$payload['carbon_dioxide']);
self::createAlarm($land[3], $device[1], '二氧化碳含量', '空气二氧化碳含量偏高' ,$payload['carbon_dioxide']);
}
// carbon_dioxide 二氧化碳含量
if ($payload['carbon_dioxide'] < $monitorThreshold['air_co2_content_min']) {
self::createAlarm($land[3], $device[1], 'ambient_temperature', '空气二氧化碳含量偏低' ,$payload['carbon_dioxide']);
self::createAlarm($land[3], $device[1], '二氧化碳含量', '空气二氧化碳含量偏低' ,$payload['carbon_dioxide']);
}
// ambient_air_pressure 大气压力