细节调整

This commit is contained in:
yanghongwei 2025-04-23 13:10:24 +08:00
parent f72fae2154
commit 73bea5e080
1 changed files with 6 additions and 1 deletions

View File

@ -49,12 +49,15 @@ namespace LY.App.Service
var entity = input.data.Adapt<List<Alarm>>();
if (entity.Any())
{
// 排除掉不这几个类型的设备
// 排除掉不在范围内的报警信息
var O4entity = entity.Where(s => s.device_type == "O4" || s.serial_number == "O4" || s.device_type == "UAV" || !string.IsNullOrEmpty(s.device_type));
entity = entity.Where(s => checkDistance(s.drone_lat, s.drone_lon, deviceinfo.Lat, deviceinfo.Lon) == true).ToList();
if (O4entity.Any())
{
entity.AddRange(O4entity);
}
if (entity.Any())
{
foreach (var item in entity)
{
item.BatchId = await GetBatId(item.serial_number);
@ -72,6 +75,8 @@ namespace LY.App.Service
//推送报警信息
await _pushService.SendMessageToAll(new { msgType = "event", data = entity });
}
}
return new ApiResult();
}