|
|
@ -48,14 +48,14 @@ public class BBAC_SE_EDI_SERVICE : ApplicationService |
|
|
|
public async Task<string> ExportAsync(RequestDto input) |
|
|
|
{ |
|
|
|
string fileName = $"BBAC的EDI数据_{Guid.NewGuid()}.xlsx"; |
|
|
|
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); |
|
|
|
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); ; |
|
|
|
var dtos = ObjectMapper.Map<List<BBAC_SE_EDI>, List<BBAC_SE_EDI_EXPORT_DTO>>(entities); |
|
|
|
|
|
|
|
ExportImporter _exportImporter = new ExportImporter(); |
|
|
|
var result = await _exportImporter.ExcelExporter(dtos); |
|
|
|
var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); ; |
|
|
|
result.ShouldNotBeNull(); |
|
|
|
|
|
|
|
await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }); |
|
|
|
await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); ; |
|
|
|
return fileName; |
|
|
|
} |
|
|
|
#endregion
|
|
|
@ -67,8 +67,8 @@ public class BBAC_SE_EDI_SERVICE : ApplicationService |
|
|
|
[HttpPost] |
|
|
|
public async Task<PagedResultDto<BBAC_SE_EDI_DTO>> GetListAsync(RequestDto input) |
|
|
|
{ |
|
|
|
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); |
|
|
|
var totalCount = await _repository.GetCountByFilterAsync(input.Filters); |
|
|
|
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); |
|
|
|
var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); |
|
|
|
var dtos = ObjectMapper.Map<List<BBAC_SE_EDI>, List<BBAC_SE_EDI_DTO>>(entities); |
|
|
|
return new PagedResultDto<BBAC_SE_EDI_DTO>(totalCount, dtos); |
|
|
|
} |
|
|
|