diff --git a/OpenAuth.App/ServiceApp/ManageApp.cs b/OpenAuth.App/ServiceApp/ManageApp.cs index fc79a85..9a16e93 100644 --- a/OpenAuth.App/ServiceApp/ManageApp.cs +++ b/OpenAuth.App/ServiceApp/ManageApp.cs @@ -367,15 +367,18 @@ namespace OpenAuth.App.ServiceApp { using (var db = UnitWork.CreateContext()) { - int[] uavtype = info.TypeId.Split('-', StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToArray(); + int[] uavtype = info.TypeId.Split('-', StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)) + .ToArray(); if (uavtype.Length == 3) { - var devicename = db.LasaDeviceDictionary.AsQueryable().Where(r => r.Domain == uavtype[0] && r.DeviceType == uavtype[1] && r.SubType == uavtype[2]).First(); + var devicename = db.LasaDeviceDictionary.AsQueryable().Where(r => + r.Domain == uavtype[0] && r.DeviceType == uavtype[1] && r.SubType == uavtype[2]).First(); if (devicename != null) { info.TypeId = devicename.DeviceName; } } + var flag = db.LasaUav.Insert(info); if (db.Commit()) return true; @@ -2538,11 +2541,14 @@ namespace OpenAuth.App.ServiceApp aiInspection.WarningContent = req.WarningContent; } - // 更新 - // todo 关于多次调用问题 + // 关于多次调用问题 var count = await db.Queryable().Where(x => x.TaskId == req.TaskId).CountAsync(); if (count == 0) { + // 设置任务智能巡检标识 + task.AIInspection = "true"; + task.Status = 3; // 表示智能巡检中 + await db.Updateable(task).ExecuteCommandAsync(); await db.Insertable(aiInspection).ExecuteCommandAsync(); } } @@ -2655,6 +2661,15 @@ namespace OpenAuth.App.ServiceApp public async Task> EndHandFlyTask(string taskid) { + // todo + var savedTask = await Repository.ChangeRepository>().AsQueryable() + .Where(x => x.Id == taskid) + .FirstAsync(); + if (savedTask.Status == 3) + { + throw new Exception("智能巡检未关闭"); + } + var task = new LasaTask() { Id = taskid, @@ -3018,6 +3033,7 @@ WHERE #region redis获取数据 + public async Task> GetDronePortInfoFromRedis(string key) { var info = _redisCacheContext.Get(key); @@ -3028,12 +3044,14 @@ WHERE Result = info }; } + return new Response { Message = "暂无数据", Code = 500 }; } + #endregion } } \ No newline at end of file