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) {