This commit is contained in:
parent
fa3773c8dc
commit
e72164545e
|
|
@ -51,6 +51,8 @@ namespace LY.App.Service
|
|||
await _redisService.SetAsync(key, deviceinfo, TimeSpan.FromDays(1));
|
||||
}
|
||||
var entity = input.data.Adapt<List<Alarm>>();
|
||||
if (entity.Any())
|
||||
{
|
||||
foreach (var item in entity)
|
||||
{
|
||||
item.BatchId = await GetBatId(item.serial_number);
|
||||
|
|
@ -65,6 +67,8 @@ namespace LY.App.Service
|
|||
await _db.CopyNew().Insertable(entity).SplitTable().ExecuteReturnSnowflakeIdListAsync();
|
||||
//推送报警信息
|
||||
await _pushService.SendMessageToAll(new { msgType = "event", data = entity });
|
||||
}
|
||||
|
||||
return new ApiResult();
|
||||
}
|
||||
|
||||
|
|
@ -128,7 +132,7 @@ namespace LY.App.Service
|
|||
await _redisService.SetAsync(key, deviceinfo);
|
||||
//更新位置
|
||||
// await _db.Updateable(deviceinfo).ExecuteCommandAsync();
|
||||
await _db.Updateable<DeviceEntity>(deviceinfo).ExecuteCommandAsync();
|
||||
await _db.CopyNew().Updateable<DeviceEntity>(deviceinfo).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
private async Task<long> GetBatId(string droneId)
|
||||
|
|
|
|||
Loading…
Reference in New Issue