马昊 2 years ago
parent
commit
57fd3d0850
  1. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_EDI_Service.cs

10
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_EDI_Service.cs

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

Loading…
Cancel
Save