From da8946e3d3430494fa7a81d1f25130bdb63823f8 Mon Sep 17 00:00:00 2001 From: zhaoxinyu <89237069@qq.com> Date: Wed, 10 Jul 2024 11:31:55 +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 | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 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 d1dbd8a1..84ab6f08 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 @@ -304,22 +304,22 @@ 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"; - 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); + //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); - //ExtendExcel.BucketName = _cfg.GetValue("MinIO:BucketName", "default"); + ExtendExcel.BucketName = _cfg.GetValue("MinIO:BucketName", "default"); - //ExtendExcel.AccessKey = _cfg.GetValue("MinIO:AccessKey", "g0GKnhRGEQHI0uiGBYre"); + ExtendExcel.AccessKey = _cfg.GetValue("MinIO:AccessKey", "g0GKnhRGEQHI0uiGBYre"); - //ExtendExcel.SecretKey = _cfg.GetValue("MinIO:SecretKey", "iKGlLz6UBzci3xrERw5Zz1gI77enT5u9agFemHPv"); + ExtendExcel.SecretKey = _cfg.GetValue("MinIO:SecretKey", "iKGlLz6UBzci3xrERw5Zz1gI77enT5u9agFemHPv"); - //ExtendExcel.EndPoint = _cfg.GetValue("MinIO:EndPoint", "localhost:10684/host"); + ExtendExcel.EndPoint = _cfg.GetValue("MinIO:EndPoint", "localhost:10684/host"); - //return await ExtendExcel.WriteDataToExcelInParallel("库存余额", dtos, 500000).ConfigureAwait(false); + return await ExtendExcel.WriteDataToExcelInParallel("库存余额", dtos, 500000).ConfigureAwait(false); - return fileName; + //return fileName; } /// @@ -1665,9 +1665,22 @@ namespace Win.Sfs.SettleAccount.Entities.BQ "SUM(qty)\n" + "FOR Type IN ([10],[20],[100],[150],[200],[800])\n" + ") AS piv\n" + - $") temp1 left join (select LU,PN,InvbillNum,Qty from {satablename} where BusinessType={(int)p_businessType}) temp2 on temp1.PN=temp2.PN and temp1.LU=temp2.LU\n" + - ") tempsum group by LU\n"; + $") temp1 left join (select LU,PN,InvbillNum,Qty from {satablename} WITH(NOLOCK) where BusinessType={(int)p_businessType}"; + if (!string.IsNullOrEmpty(sabegin)) + { + + sql += $" AND SettleDate >='{sabegin}'\n"; + + } + if (!string.IsNullOrEmpty(saend)) + { + sql += $" AND SettleDate <='{saend}'\n"; + } + + + sql+=") temp2 on temp1.PN=temp2.PN and temp1.LU=temp2.LU\n" + + ") tempsum group by LU\n"; command.CommandText = sql; command.CommandTimeout = 1200;