|
|
@ -218,8 +218,43 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 导出
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="input"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost] |
|
|
|
[Route("Export")] |
|
|
|
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|
|
|
virtual public async Task<string> ExportAsync(WmsKanbanOutPutDetialRequestDto input) |
|
|
|
{ |
|
|
|
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum }); |
|
|
|
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, |
|
|
|
0, true); |
|
|
|
|
|
|
|
IExporter _excel = new ExcelExporter(); |
|
|
|
byte[] result = null; |
|
|
|
|
|
|
|
var _fileName = string.Format("大众备件出库单_{0}.xlsx", Guid.NewGuid().ToString()); |
|
|
|
result = await _excel.ExportAsByteArray(entities); |
|
|
|
|
|
|
|
|
|
|
|
result.ShouldNotBeNull(); |
|
|
|
|
|
|
|
//保存导出文件到服务器存成二进制
|
|
|
|
await _excelImportService.SaveBlobAsync( |
|
|
|
new SaveExcelImportInputDto |
|
|
|
{ |
|
|
|
Name = _fileName, |
|
|
|
Content = result |
|
|
|
} |
|
|
|
); |
|
|
|
return _fileName; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|