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