This commit is contained in:
jackchenyang
2024-06-04 09:10:53 +08:00
parent 84d50caf65
commit fa12713e4c
9 changed files with 441 additions and 179 deletions
@@ -745,7 +745,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
ws.GetRow(rowIndex + 11).Height = 11 * 20;
ws.GetRow(rowIndex + 10).GetCell(1).SetCellValue("试压包号\r\nTest Package No.");
ws.GetRow(rowIndex + 10).GetCell(4).SetCellValue("UG-130-FW-HT-0001");
ws.GetRow(rowIndex + 10).GetCell(4).SetCellValue(info?.testpackageNo);
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 12, rowIndex + 13, 2, 4));
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 12, rowIndex + 13, 6, 7));
@@ -756,7 +756,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
ws.GetRow(rowIndex + 12).GetCell(2).SetCellValue("ACTIVITY");
ws.GetRow(rowIndex + 12).GetCell(2).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None,
BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 14, true, true, "Arial");
ws.GetRow(rowIndex + 12).GetCell(6).SetCellValue("CC7");
ws.GetRow(rowIndex + 12).GetCell(6).SetCellValue(info?.workAreaCode);
ws.GetRow(rowIndex + 12).GetCell(6).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None,
BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 14, true, true, "Arial");
ws.GetRow(rowIndex + 12).GetCell(9).SetCellValue("JIANLI");
@@ -1138,12 +1138,6 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
//垂直水平居中
ws.VerticallyCenter = true;
ws.HorizontallyCenter = true;
//打印边距设置 厘米/3
ws.SetMargin(MarginType.RightMargin, (double)2.4 / 3);
ws.SetMargin(MarginType.LeftMargin, (double)2.9 / 3);
ws.SetMargin(MarginType.TopMargin, (double)2.4 / 3);
ws.SetMargin(MarginType.BottomMargin, (double)2.4 / 3);
//页眉页脚间距
ws.SetMargin(MarginType.HeaderMargin, 0);
ws.SetMargin(MarginType.FooterMargin, 0);
@@ -6839,25 +6833,30 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
{
hssfworkbook = (XSSFWorkbook)WorkbookFactory.Create(file);
}
//操作目录模版sheet是否存在,不存在就把对应的sheet删除掉(特殊处理)
int index = 0;
if (!templateFileIds.Contains("2BEFB0F4-A466-4C59-963F-9092BACF2E52"))
{
hssfworkbook.RemoveAt(0);
index++;
}
//'2-TP-02-试压包封面UG-FW-001
if (!templateFileIds.Contains("D4B4DD64-8361-4A75-AA3E-E484934B9B06"))
{
hssfworkbook.RemoveAt(0);
hssfworkbook.RemoveAt(1);
index++;
}
//3-TP-03-试压包目录UG-FW-001
if (!templateFileIds.Contains("6CD2710C-2AD6-4E7D-BED7-C8BEDAD300DE"))
{
hssfworkbook.RemoveAt(1 - index);
hssfworkbook.RemoveAt(2 - index);
index++;
}
//4-TP-04-试压标识
if (!templateFileIds.Contains("87A66CAA-CA30-4A1E-8382-E8503059A0D0"))
{
hssfworkbook.RemoveAt(2 - index);
hssfworkbook.RemoveAt(3 - index);
index++;
}
@@ -6869,11 +6868,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
continue;
switch (templateFileId)
{
//1-TP-01-试压包路径表UG-FW-001
case "2BEFB0F4-A466-4C59-963F-9092BACF2E52":
XSSFSheet sheet1 = (XSSFSheet)hssfworkbook.CreateSheet(oneTemp.Title);
template1(hssfworkbook, sheet1);
break;
//6-TP-05-P&ID清单UG-FW-001 模版
case "811EF650-7686-447F-BEE8-776D50041CD0":
XSSFSheet sheet6 = (XSSFSheet)hssfworkbook.CreateSheet(oneTemp.Title);