From 8aa06c1b728c435ad639bb819946ba8f9a554297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8D=E9=94=90?= <1565842059@qq.com> Date: Fri, 17 Jul 2026 13:35:23 +0800 Subject: [PATCH] =?UTF-8?q?```=20refactor(report):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=B1=B1=E8=A5=BF=E7=BB=93=E7=AE=97=E6=8A=A5=E5=91=8A=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=94=9F=E6=88=90=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在GenerateFileEntry方法中添加applyFrontendColumnConfig参数,默认值为true - 更新GenerateReportExcel方法签名以接收applyFrontendColumnConfig参数 - 将ApplySwapValuationColumnConfig调用包装在条件判断中 - 修正PDF和Excel文件生成时的参数传递 - 更新XML文档注释以反映新参数的作用 ``` --- .../SettlementReportFotShanXiService.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/YLErpDAL/Modules/ReportModule/SettlementReportModule/SettlementReportFotShanXiService.cs b/YLErpDAL/Modules/ReportModule/SettlementReportModule/SettlementReportFotShanXiService.cs index 21736f28..316119e5 100644 --- a/YLErpDAL/Modules/ReportModule/SettlementReportModule/SettlementReportFotShanXiService.cs +++ b/YLErpDAL/Modules/ReportModule/SettlementReportModule/SettlementReportFotShanXiService.cs @@ -146,7 +146,7 @@ namespace YLErp.Modules.ReportModule.SettlementReportModule }); if (fileTypes.Contains("pdf")) { - var filepath = GenerateFileEntry(report, "pdf"); + var filepath = GenerateFileEntry(report, "pdf", applyFrontendColumnConfig: false); if (!string.IsNullOrEmpty(filepath)) { attachFiles.Add(filepath); @@ -159,7 +159,7 @@ namespace YLErp.Modules.ReportModule.SettlementReportModule } else { - var filepath = GenerateFileEntry(report, "excel"); + var filepath = GenerateFileEntry(report, "excel", applyFrontendColumnConfig: false); if (!string.IsNullOrEmpty(filepath)) { attachFiles.Add(filepath); @@ -202,15 +202,15 @@ namespace YLErp.Modules.ReportModule.SettlementReportModule /// /// /// - /// + /// 是否按当前用户的前端列配置隐藏并重排互换估值列 /// - public string GenerateFileEntry(ClientDingShiReport_ShanXi report, string type) + public string GenerateFileEntry(ClientDingShiReport_ShanXi report, string type, bool applyFrontendColumnConfig = true) { - var filepath = GenerateReportExcel(report, type.ToLower() == "pdf"); + var filepath = GenerateReportExcel(report, type.ToLower() == "pdf", applyFrontendColumnConfig); return filepath; } - public string GenerateReportExcel(ClientDingShiReport_ShanXi report,bool needToPdf) + public string GenerateReportExcel(ClientDingShiReport_ShanXi report, bool needToPdf, bool applyFrontendColumnConfig = true) { var tempFolder = OtcAppContext.MapPath("~/App_Docs/Temp/结算报告"); tempFolder = MosPathHelper.Combine(tempFolder, ""); @@ -310,7 +310,10 @@ namespace YLErp.Modules.ReportModule.SettlementReportModule , shouldDeleteSheet: true, needToPdf: false, callback: sheets => { FormatSwapValuationDisplayCells(sheets, report.EodSwapPositions); - ApplySwapValuationColumnConfig(sheets); + if (applyFrontendColumnConfig) + { + ApplySwapValuationColumnConfig(sheets); + } }); if (needToPdf) {