Merge remote-tracking branch 'origin/main'
commit
4058bd60a2
|
|
@ -14,6 +14,8 @@ using DocumentFormat.OpenXml.EMMA;
|
||||||
using NPOI.SS.Formula.Functions;
|
using NPOI.SS.Formula.Functions;
|
||||||
using Infrastructure.Extensions;
|
using Infrastructure.Extensions;
|
||||||
using DocumentFormat.OpenXml.Math;
|
using DocumentFormat.OpenXml.Math;
|
||||||
|
using DocumentFormat.OpenXml.Spreadsheet;
|
||||||
|
using Org.BouncyCastle.Ocsp;
|
||||||
|
|
||||||
namespace OpenAuth.App.ServiceApp
|
namespace OpenAuth.App.ServiceApp
|
||||||
{
|
{
|
||||||
|
|
@ -323,5 +325,28 @@ namespace OpenAuth.App.ServiceApp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
public async Task<Response<PageInfo<List<LasaMediaFile>>>> GetMediaFile(string device, string picname, DateTime? startTime, DateTime? endTime, int page, int limit)
|
||||||
|
{
|
||||||
|
RefAsync<int> totalCount = 0;
|
||||||
|
using (var db = UnitWork.CreateContext())
|
||||||
|
{
|
||||||
|
Console.WriteLine(startTime.ToString());
|
||||||
|
var list = await db.LasaMediaFile.AsQueryable()
|
||||||
|
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(device),x => x.DroneModelKey == device)
|
||||||
|
.WhereIF(!string.IsNullOrEmpty(picname), x => x.Name.Contains(picname))
|
||||||
|
.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)
|
||||||
|
.OrderBy(x => x.CreateTime, OrderByType.Asc)
|
||||||
|
.ToPageListAsync(page, limit, totalCount);
|
||||||
|
return new Response<PageInfo<List<LasaMediaFile>>>
|
||||||
|
{
|
||||||
|
Result = new PageInfo<List<LasaMediaFile>> { Items = list, Total = totalCount }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,8 @@ namespace OpenAuth.Repository
|
||||||
public SugarRepositiry<LasaDeviceDictionary> LasaDeviceDictionary { get; set; }
|
public SugarRepositiry<LasaDeviceDictionary> LasaDeviceDictionary { get; set; }
|
||||||
public SugarRepositiry<DroneDocktaskdetail> DroneDocktaskdetail { get; set; }
|
public SugarRepositiry<DroneDocktaskdetail> DroneDocktaskdetail { get; set; }
|
||||||
public SugarRepositiry<DroneDocktask> DroneDocktask { get; set; }
|
public SugarRepositiry<DroneDocktask> DroneDocktask { get; set; }
|
||||||
|
|
||||||
|
public SugarRepositiry<LasaMediaFile> LasaMediaFile { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -621,5 +621,23 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<Response<PageInfo<List<LasaMediaFile>>>> GetMediaFile(string device,string picname, DateTime startTime, DateTime endTime, int page, int limit)
|
||||||
|
{
|
||||||
|
var result = new Response<PageInfo<List<LasaMediaFile>>>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
result = await _app.GetMediaFile(device, picname,startTime, endTime, page, limit);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
result.Code = 500;
|
||||||
|
result.Message = ex.Message;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue