更新20260602
This commit is contained in:
@@ -2,6 +2,7 @@ using DocumentFormat.OpenXml;
|
||||
using DocumentFormat.OpenXml.Packaging;
|
||||
using DocumentFormat.OpenXml.Spreadsheet;
|
||||
using Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Models;
|
||||
using Serilog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
@@ -28,6 +29,13 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Services
|
||||
: report.TestNumber);
|
||||
var path = Path.Combine(directory, $"{safeNumber}_防滑性能测试报告.xlsx");
|
||||
|
||||
Log.Information(
|
||||
"开始导出防滑性能 Excel:TestNumber={TestNumber}, ResultCount={ResultCount}, PointCount={PointCount}, Path={Path}",
|
||||
report.TestNumber,
|
||||
report.Results.Count,
|
||||
report.Points.Count,
|
||||
path);
|
||||
|
||||
using var document = SpreadsheetDocument.Create(path, SpreadsheetDocumentType.Workbook);
|
||||
var workbookPart = document.AddWorkbookPart();
|
||||
workbookPart.Workbook = new Workbook();
|
||||
@@ -38,6 +46,7 @@ namespace Footwear_Test_methodsfor_wholeshoe_Slipresistanceperformance.Services
|
||||
AddDataSheet(workbookPart, sheets, 3, report.Points);
|
||||
|
||||
workbookPart.Workbook.Save();
|
||||
Log.Information("防滑性能 Excel 导出完成:Path={Path}", path);
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user