细节调整
This commit is contained in:
parent
f72fae2154
commit
73bea5e080
|
|
@ -49,12 +49,15 @@ namespace LY.App.Service
|
||||||
var entity = input.data.Adapt<List<Alarm>>();
|
var entity = input.data.Adapt<List<Alarm>>();
|
||||||
if (entity.Any())
|
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));
|
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();
|
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);
|
entity.AddRange(O4entity);
|
||||||
|
}
|
||||||
|
if (entity.Any())
|
||||||
|
{
|
||||||
foreach (var item in entity)
|
foreach (var item in entity)
|
||||||
{
|
{
|
||||||
item.BatchId = await GetBatId(item.serial_number);
|
item.BatchId = await GetBatId(item.serial_number);
|
||||||
|
|
@ -72,6 +75,8 @@ namespace LY.App.Service
|
||||||
//推送报警信息
|
//推送报警信息
|
||||||
await _pushService.SendMessageToAll(new { msgType = "event", data = entity });
|
await _pushService.SendMessageToAll(new { msgType = "event", data = entity });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return new ApiResult();
|
return new ApiResult();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue