From 0848efda77ae17ae6f5e000a637aa3739ae25f5c Mon Sep 17 00:00:00 2001 From: 44673626 <44673626@qq.com> Date: Thu, 17 Feb 2022 14:54:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=B6=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/WMS/WMSSharePartAppService.cs | 35 +++++++++++++++++++ .../Entities/WMS/TaskList.cs | 1 + 2 files changed, 36 insertions(+) diff --git a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs index 1f853ff6..f3a4a7a8 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs @@ -218,7 +218,42 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts } + /// + /// 导出 + /// + /// + /// + [HttpPost] + [Route("Export")] + //[Authorize(SettleAccountPermissions.SettleAccounts.Default)] + virtual public async Task 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; + + + + } diff --git a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs index 558126ba..4bbecff0 100644 --- a/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs +++ b/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs @@ -1653,6 +1653,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS } + public class WmsSharePart90OutPut : FullAuditedAggregateRootBase { public WmsSharePart90OutPut()