From 9bff4f25733119af1e8d365d8039ed42e6f5a17a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BC=9F?= <421281095@qq.com> Date: Wed, 13 Aug 2025 16:08:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AA=92=E4=BD=93=E5=BA=93=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6=E8=88=AA?= =?UTF-8?q?=E7=BA=BFid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ServiceApp/AirportMaintenanceApp.cs | 21 ++++++++++--------- .../AirportMaintenanceController.cs | 4 ++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/OpenAuth.App/ServiceApp/AirportMaintenanceApp.cs b/OpenAuth.App/ServiceApp/AirportMaintenanceApp.cs index 271f0d1..d85f7b3 100644 --- a/OpenAuth.App/ServiceApp/AirportMaintenanceApp.cs +++ b/OpenAuth.App/ServiceApp/AirportMaintenanceApp.cs @@ -408,7 +408,7 @@ namespace OpenAuth.App.ServiceApp #endregion - public async Task>>> GetMediaFile(string taskId, string device, + public async Task>>> GetMediaFile(string taskId, string airId,string device, string picname, DateTime? startTime, DateTime? endTime, int page, int limit, string parentKey,int? objectKeyExist) { RefAsync totalCount = 0; @@ -417,15 +417,16 @@ namespace OpenAuth.App.ServiceApp Console.WriteLine(startTime.ToString()); var list = await db.LasaMediaFile.AsQueryable() .LeftJoin((x, b) => x.FlightId == b.FlightId) - .WhereIF(!string.IsNullOrEmpty(device), x => x.DroneModelKey == device) - .WhereIF(!string.IsNullOrEmpty(picname), x => x.Name.Contains(picname)) - .WhereIF(objectKeyExist is 0,x=> x.ObjectKey == null) - .WhereIF(objectKeyExist is 1,x=> x.ObjectKey != null) - .WhereIF(!"0001/1/1 0:00:00".Equal(startTime.ToString()), x => x.CreateTime >= startTime) - .WhereIF(!"0001/1/1 0:00:00".Equal(endTime.ToString()), x => x.CreateTime <= endTime) - .WhereIF(!string.IsNullOrEmpty(parentKey), x => x.ParentKey == parentKey) - .WhereIF(!string.IsNullOrEmpty(taskId), x => x.TaskId == taskId) - .OrderBy(x => x.CreateTime, OrderByType.Desc) + .WhereIF(!string.IsNullOrEmpty(device), (x, b) => x.DroneModelKey == device) + .WhereIF(!string.IsNullOrEmpty(picname), (x, b) => x.Name.Contains(picname)) + .WhereIF(!string.IsNullOrEmpty(airId), (x, b) => b.AirLineId == airId) + .WhereIF(objectKeyExist is 0,(x, b)=> x.ObjectKey == null) + .WhereIF(objectKeyExist is 1,(x, b)=> x.ObjectKey != null) + .WhereIF(!"0001/1/1 0:00:00".Equal(startTime.ToString()), (x, b) => x.CreateTime >= startTime) + .WhereIF(!"0001/1/1 0:00:00".Equal(endTime.ToString()), (x, b) => x.CreateTime <= endTime) + .WhereIF(!string.IsNullOrEmpty(parentKey), (x, b) => x.ParentKey == parentKey) + .WhereIF(!string.IsNullOrEmpty(taskId), (x, b) => x.TaskId == taskId) + .OrderBy((x, b) => x.CreateTime, OrderByType.Desc) .Select((x,b) => new LasaMediaFile { Id = x.Id, diff --git a/OpenAuth.WebApi/Controllers/ServiceControllers/AirportMaintenanceController.cs b/OpenAuth.WebApi/Controllers/ServiceControllers/AirportMaintenanceController.cs index d545e8e..88fe25d 100644 --- a/OpenAuth.WebApi/Controllers/ServiceControllers/AirportMaintenanceController.cs +++ b/OpenAuth.WebApi/Controllers/ServiceControllers/AirportMaintenanceController.cs @@ -692,12 +692,12 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers [HttpGet] - public async Task>>> GetMediaFile(string taskId,string device,string picname, DateTime startTime, DateTime endTime, int page, int limit,string parentKey,int? objectKeyExist) + public async Task>>> GetMediaFile(string taskId,string airId,string device,string picname, DateTime startTime, DateTime endTime, int page, int limit,string parentKey,int? objectKeyExist) { var result = new Response>>(); try { - result = await _app.GetMediaFile(taskId,device, picname,startTime, endTime, page, limit,parentKey,objectKeyExist); + result = await _app.GetMediaFile(taskId,airId,device, picname,startTime, endTime, page, limit,parentKey,objectKeyExist); } catch (Exception ex) {