refactor(report): 修改山西结算报告文件生成方法

- 在GenerateFileEntry方法中添加applyFrontendColumnConfig参数,默认值为true
- 更新GenerateReportExcel方法签名以接收applyFrontendColumnConfig参数
- 将ApplySwapValuationColumnConfig调用包装在条件判断中
- 修正PDF和Excel文件生成时的参数传递
- 更新XML文档注释以反映新参数的作用
```
This commit is contained in:
张名锐
2026-07-17 13:35:23 +08:00
parent c41e677042
commit 8aa06c1b72
@@ -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
/// </summary>
/// <param name="report"></param>
/// <param name="type"></param>
/// <param name="html"></param>
/// <param name="applyFrontendColumnConfig">是否按当前用户的前端列配置隐藏并重排互换估值列</param>
/// <returns></returns>
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)
{