更新20260602

This commit is contained in:
GukSang.Jin
2026-06-02 18:45:14 +08:00
parent fee2310977
commit 212dca6abe
9 changed files with 282 additions and 11 deletions

View File

@@ -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(
"开始导出防滑性能 ExcelTestNumber={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;
}