From 7bd3c25f3182c25b69c92f3983d91ea82c6ac751 Mon Sep 17 00:00:00 2001 From: yanghongwei Date: Sat, 5 Apr 2025 17:56:33 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/AlarmService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Service/AlarmService.cs b/Service/AlarmService.cs index 648bdd9..0a76038 100644 --- a/Service/AlarmService.cs +++ b/Service/AlarmService.cs @@ -49,10 +49,7 @@ namespace LY.App.Service return new ApiResult() { code = 1, msg = "设备不存在" }; } await _redisService.SetAsync(key, deviceinfo, TimeSpan.FromDays(1)); - deviceinfo.Lat = input.product_lat; - deviceinfo.Lon = input.product_lon; - //更新位置 - await _db.Updateable(deviceinfo).ExecuteCommandAsync(); + var entity = input.data.Adapt>(); foreach (var item in entity) { @@ -132,6 +129,10 @@ namespace LY.App.Service deviceinfo.Lon = input.product_lon; await _redisService.SetAsync(key, deviceinfo); } + deviceinfo.Lat = input.product_lat; + deviceinfo.Lon = input.product_lon; + //更新位置 + await _db.Updateable(deviceinfo).ExecuteCommandAsync(); } private async Task GetBatId(string droneId) {