|
|
@ -106,42 +106,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 出库单导出
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="input"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost] |
|
|
|
[Route("Export")] |
|
|
|
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
|
|
|
|
virtual public async Task<string> ExportAsync(WmsSharePartOutPutRequestDto 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; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
private async Task<long> GetCountAsync(WmsSharePartOutPutRequestDto input) |
|
|
|
{ |
|
|
|
return await _wmsVersionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); |
|
|
|