bug 调整

This commit is contained in:
yanghongwei 2025-09-20 16:28:08 +08:00
parent 09785d909a
commit 21a381cb9e
1 changed files with 10 additions and 5 deletions

View File

@ -52,10 +52,15 @@ namespace LY.App.Service
{ {
// 排除掉不在范围内的报警信息 // 排除掉不在范围内的报警信息
var O4entity = entity.Where(s => s.device_type == "O4" || s.serial_number == "O4" || s.device_type == "UAV" || !string.IsNullOrEmpty(s.device_type)); 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()) if (O4entity.Any())
{ {
entity.AddRange(O4entity); foreach (var item in O4entity)
{
if (!entity.Exists(s => s.serial_number == item.serial_number))
{
entity.Add(item);
}
}
} }
if (entity.Any()) if (entity.Any())
{ {