|
|
@ -415,12 +415,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran |
|
|
|
[HttpPost] |
|
|
|
public async Task<string> BalanceExport(RequestDto input) |
|
|
|
{ |
|
|
|
IQueryable<VmiBalance> query = _balanceRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda<VmiBalance>()); |
|
|
|
if (!string.IsNullOrEmpty(input.Sorting)) |
|
|
|
{ |
|
|
|
query = DynamicQueryableExtensions.OrderBy(query, input.Sorting); |
|
|
|
} |
|
|
|
var entities = await query.ToListAsync().ConfigureAwait(false); |
|
|
|
var entities = await _balanceRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false); |
|
|
|
var fileName = $"库存余额_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx"; |
|
|
|
var content = this.GetContent(entities, "库存备份"); |
|
|
|
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); |
|
|
@ -447,12 +442,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran |
|
|
|
[HttpPost] |
|
|
|
public async Task<string> LogExport(RequestDto input) |
|
|
|
{ |
|
|
|
IQueryable<VmiLog> query = _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda<VmiLog>()); |
|
|
|
if (!string.IsNullOrEmpty(input.Sorting)) |
|
|
|
{ |
|
|
|
query = DynamicQueryableExtensions.OrderBy(query, input.Sorting); |
|
|
|
} |
|
|
|
var entities = await query.ToListAsync().ConfigureAwait(false); |
|
|
|
var entities = await _logRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false); |
|
|
|
var fileName = $"库存事务_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx"; |
|
|
|
var content = this.GetContent(entities, "库存事务_"); |
|
|
|
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); |
|
|
@ -465,13 +455,9 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran |
|
|
|
[HttpPost] |
|
|
|
public async Task<string> ReplenishedExportAsync(RequestDto input) |
|
|
|
{ |
|
|
|
IQueryable<VmiLog> query = _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda<VmiLog>()); |
|
|
|
query = query.Where(o => o.IsReplenished.HasValue && o.IsReplenished.Value == true); |
|
|
|
if (!string.IsNullOrEmpty(input.Sorting)) |
|
|
|
{ |
|
|
|
query = DynamicQueryableExtensions.OrderBy(query, input.Sorting); |
|
|
|
} |
|
|
|
var entities = await query.ToListAsync().ConfigureAwait(false); |
|
|
|
//input.Filters.Add(new FilterCondition { Logic = EnumFilterLogic.And, Action = EnumFilterAction.NotEqual, Column = "IsReplenished", Value = "null" });
|
|
|
|
var entities = await _logRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false); |
|
|
|
//IQueryable<VmiLog> query = _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda<VmiLog>());
|
|
|
|
var fileName = $"补货数据_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx"; |
|
|
|
var content = this.GetContent(entities, "补货数据_"); |
|
|
|
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); |
|
|
|