|
@ -326,6 +326,7 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices |
|
|
//[Authorize(SettleAccountPermissions.Invoices.Default)]
|
|
|
//[Authorize(SettleAccountPermissions.Invoices.Default)]
|
|
|
virtual public async Task<string> ExportAsync(InvoiceRequestDto input) |
|
|
virtual public async Task<string> ExportAsync(InvoiceRequestDto input) |
|
|
{ |
|
|
{ |
|
|
|
|
|
IExporter _csv = new CsvExporter(); |
|
|
IExporter _excel = new ExcelExporter(); |
|
|
IExporter _excel = new ExcelExporter(); |
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(input.Version)) |
|
|
if (!string.IsNullOrEmpty(input.Version)) |
|
@ -337,13 +338,24 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices |
|
|
|
|
|
|
|
|
var dtoDetails = ObjectMapper.Map<List<Invoice>, List<InvoiceTHExportDto>>(entities); |
|
|
var dtoDetails = ObjectMapper.Map<List<Invoice>, List<InvoiceTHExportDto>>(entities); |
|
|
|
|
|
|
|
|
|
|
|
string _fileName = string.Empty; |
|
|
//声明导出容器
|
|
|
//声明导出容器
|
|
|
|
|
|
|
|
|
byte[] result = null; |
|
|
byte[] result = null; |
|
|
|
|
|
|
|
|
string _fileName = string.Format("大众发票汇总_{0}.xlsx", _snowflakeIdGenerator.Create().ToString()); |
|
|
switch (input.FileType) |
|
|
|
|
|
{ |
|
|
|
|
|
case 0: |
|
|
|
|
|
_fileName = string.Format("大众发票汇总_{0}.csv", input.UserId.ToString()); |
|
|
|
|
|
result = await _csv.ExportAsByteArray(dtoDetails); |
|
|
|
|
|
break; |
|
|
|
|
|
case 1: |
|
|
|
|
|
_fileName = string.Format("大众发票汇总_{0}.xlsx", input.UserId.ToString()); |
|
|
result = await _excel.ExportAsByteArray(dtoDetails); |
|
|
result = await _excel.ExportAsByteArray(dtoDetails); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
//string _fileName = string.Format("大众发票汇总_{0}.xlsx", _snowflakeIdGenerator.Create().ToString());
|
|
|
|
|
|
//result = await _excel.ExportAsByteArray(dtoDetails);
|
|
|
|
|
|
|
|
|
result.ShouldNotBeNull(); |
|
|
result.ShouldNotBeNull(); |
|
|
|
|
|
|
|
|