From 9f2e50b1226b722a15bf9fd1bee9656e5a0273b8 Mon Sep 17 00:00:00 2001 From: zhaoxinyu Date: Thu, 28 Dec 2023 08:44:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/VmiAppService.cs | 21 ++++++++++++------- .../Entities/BQ/VmiAsyncBalanceService.cs | 9 -------- 2 files changed, 13 insertions(+), 17 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 f3a52dad..34be4bb6 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 @@ -221,11 +221,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public async Task BalanceSumByVersionExport(RequestDto input) { var entities = await _balanceSumRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount, true).ConfigureAwait(false); - - + + + IExporter _excel = new ExcelExporter(); + + byte[] result = null; + + result = await _excel.ExportAsByteArray(entities).ConfigureAwait(false); + result.ShouldNotBeNull(); + + + var fileName = $"库存余额_期间_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; - var content = this.GetContent(entities, "库存余额"); - await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); + + await _fileContainer.SaveAsync(fileName, result, true).ConfigureAwait(false); return fileName; } @@ -715,16 +724,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var next = before + 1; DateTime lastYear = DateTime.ParseExact(string.Format("{0}-12-{1} 08:00:00", last, p_day), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);//上期时间 DateTime beforeYear = DateTime.ParseExact(string.Format("{0}-12-{1} 07:59:59", before, p_day), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);//这期时间 - - string version = null; - if (p_billtime >= DateTime.ParseExact(string.Format("{0}-01-01 00:00:00", before), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture) && p_billtime <= DateTime.ParseExact(string.Format("{0}-01-01 07:59:59", before), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture)) { version = $"{last.ToString()}12"; } - if (p_billtime >= DateTime.ParseExact(string.Format("{0}-01-01 08:00:00", before), "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture) && p_billtime <= lastYear.AddMonths(1)) { version = $"{before.ToString()}01"; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs index 4b7aa76c..89925e11 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs @@ -59,15 +59,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } - - - - - - - - - [NonAction] [DisableValidation] public async Task Invoke(IServiceProvider serviceProvider)