From 77d0c5782ab70d3201a424e4a656fe4d43e33ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 29 Apr 2024 09:43:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/VmiAppService.cs | 52 +++++++++++-------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs index 13e12d27..cf31d603 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs @@ -262,8 +262,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var dtos = _maper.Map, List>(entities); dtos = dtos.OrderByDescending(p => p.BillTime).ToList(); var fileName = $"库存余额_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; - var content = this.GetContent(dtos, "库存余额"); - await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); + result.ShouldNotBeNull(); + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); return fileName; } @@ -438,20 +440,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { var entities = await _logRepository.GetListByFilterAsync(input.Filters, input.Sorting).ConfigureAwait(false); var fileName = $"库存事务_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; - if (entities.Count > 1000000) { throw new UserFriendlyException("导出行数超过100W不能导出,请重新录入查询条件导出", "400"); } - var dtos = _maper.Map, List>(entities); - var exportImporter = new ExportImporter(); var result = await exportImporter.ExcelExporter(dtos).ConfigureAwait(false); result.ShouldNotBeNull(); - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); - return fileName; } @@ -2083,34 +2080,47 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } - + [ExcelExporter(MaxRowNumberOnASheet = 900000)] public class VmiBalanceSumDetailDto { - [Display(Name = "生产码")] + + [ExporterHeader(DisplayName = "生产码")] public string VinCode { set; get; } - [Display(Name = "虚拟零件号")] + + [ExporterHeader(DisplayName = "虚拟零件号")] public string MatchNumber { set; get; } - [Display(Name = "零件类型")] + + [ExporterHeader(DisplayName = "零件类型")] public string CodeType { set; get; } - [Display(Name = "厂内零件号")] + + [ExporterHeader(DisplayName = "厂内零件号")] public string RealPartCode { set; get; } - [Display(Name = "库位")] + + [ExporterHeader(DisplayName = "库位")] public string ErpToLoc { set; get; } - [Display(Name = "最后发运时间")] + + [ExporterHeader(DisplayName = "最后发运时间")] public DateTime? ShippingTime { set; get; } - [Display(Name = "最后结算时间")] + + [ExporterHeader(DisplayName = "最后结算时间")] public DateTime? BillTime { set; get; } - [Display(Name = "合计数量")] + + [ExporterHeader(DisplayName = "合计数量")] public decimal Qty { set; get; } - [Display(Name = "发运入库数量")] + + [ExporterHeader(DisplayName = "发运入库数量")] public decimal ShippingQty { set; get; } - [Display(Name = "结算出库数量")] + + [ExporterHeader(DisplayName = "结算出库数量")] public decimal SettleQty { set; get; } - [Display(Name = "退货出库数量")] + + [ExporterHeader(DisplayName = "退货出库数量")] public decimal ReturnQty { set; get; } - [Display(Name = "调整入库数量")] + + [ExporterHeader(DisplayName = "调整入库数量")] public decimal InputQty { set; get; } - [Display(Name = "调整出库数量")] + + [ExporterHeader(DisplayName = "调整出库数量")] public decimal OutputQty { set; get; } } public class VmiBalanceSumMainDto