修改测试用例导出表格格式

This commit is contained in:
曾威嶂 2025-07-21 11:18:02 +08:00
parent 63da653833
commit d67058a2d7
2 changed files with 18 additions and 10 deletions

View File

@ -175,7 +175,7 @@ public class PmsProjectTestcaseController extends BaseController {
if (fileName.endsWith(".docx")) { if (fileName.endsWith(".docx")) {
pmsProjectTestcaseService.testcaseImport(projectId, file); pmsProjectTestcaseService.testcaseImport(projectId, file);
return success("上传的文件是 docx 格式"); return success("导入成功");
} else { } else {
return error("上传的文件不是 docx 格式,请上传 docx 文件"); return error("上传的文件不是 docx 格式,请上传 docx 文件");
} }

View File

@ -764,11 +764,13 @@ public class PmsProjectTestcaseServiceImpl implements IPmsProjectTestcaseService
autoWrap(xwpfTable.getRow(8).getCell(4), 125,"期望测试结果",true,true); autoWrap(xwpfTable.getRow(8).getCell(4), 125,"期望测试结果",true,true);
autoWrap(xwpfTable.getRow(8).getCell(6), 125,"评估准则",true,true); autoWrap(xwpfTable.getRow(8).getCell(6), 125,"评估准则",true,true);
autoWrap(xwpfTable.getRow(8).getCell(8), 125,"实际测试结果",true,true); autoWrap(xwpfTable.getRow(8).getCell(8), 125,"实际测试结果",true,true);
autoWrap(xwpfTable.getRow(xwpfTable.getNumberOfRows() - 4).getCell(0), 62,"设计人员",false,true); autoWrap(xwpfTable.getRow(xwpfTable.getNumberOfRows() - 5).getCell(0), 62,"设计人员",false,true);
autoWrap(xwpfTable.getRow(xwpfTable.getNumberOfRows() - 4).getCell(4), 62,"设计日期",false,true); autoWrap(xwpfTable.getRow(xwpfTable.getNumberOfRows() - 5).getCell(4), 62,"设计日期",false,true);
autoWrap(xwpfTable.getRow(xwpfTable.getNumberOfRows() - 3).getCell(0), 62,"测试人员",false,true); autoWrap(xwpfTable.getRow(xwpfTable.getNumberOfRows() - 4).getCell(0), 62,"执行结果",false,true);
autoWrap(xwpfTable.getRow(xwpfTable.getNumberOfRows() - 3).getCell(4), 62,"测试执行时间",false,true); autoWrap(xwpfTable.getRow(xwpfTable.getNumberOfRows() - 3).getCell(0), 62,"问题标识",false,true);
autoWrap(xwpfTable.getRow(xwpfTable.getNumberOfRows() - 2).getCell(0), 62,"执行结果",false,true); autoWrap(xwpfTable.getRow(xwpfTable.getNumberOfRows() - 3).getCell(4), 62,"测试人员",false,true);
autoWrap(xwpfTable.getRow(xwpfTable.getNumberOfRows() - 2).getCell(0), 62,"测试监督员",false,true);
autoWrap(xwpfTable.getRow(xwpfTable.getNumberOfRows() - 2).getCell(4), 62,"测试执行时间",false,true);
//需要通过调取数据库中信息填入部分 //需要通过调取数据库中信息填入部分
autoWrap(xwpfTable.getRow(0).getCell(3), 62,pendingOutputData.getTitle(),false,false); autoWrap(xwpfTable.getRow(0).getCell(3), 62,pendingOutputData.getTitle(),false,false);
@ -875,11 +877,15 @@ public class PmsProjectTestcaseServiceImpl implements IPmsProjectTestcaseService
mergeCellsHorizontally(table, stepRowIndex + 9, 4, 5); mergeCellsHorizontally(table, stepRowIndex + 9, 4, 5);
mergeCellsHorizontally(table, stepRowIndex + 9, 6, 7); mergeCellsHorizontally(table, stepRowIndex + 9, 6, 7);
} }
//生成模版倒数第四行
mergeCellsHorizontally(table, table.getNumberOfRows() - 5, 0, 1);
mergeCellsHorizontally(table, table.getNumberOfRows() - 5, 2, 3);
mergeCellsHorizontally(table, table.getNumberOfRows() - 5, 4, 5);
mergeCellsHorizontally(table, table.getNumberOfRows() - 5, 6, 8);
//生成模版倒数第三行 //生成模版倒数第三行
mergeCellsHorizontally(table, table.getNumberOfRows() - 4, 0, 1); mergeCellsHorizontally(table, table.getNumberOfRows() - 4, 0, 1);
mergeCellsHorizontally(table, table.getNumberOfRows() - 4, 2, 3); mergeCellsHorizontally(table, table.getNumberOfRows() - 4, 2, 8);
mergeCellsHorizontally(table, table.getNumberOfRows() - 4, 4, 5);
mergeCellsHorizontally(table, table.getNumberOfRows() - 4, 6, 8);
//生成模版倒数第二行 //生成模版倒数第二行
mergeCellsHorizontally(table, table.getNumberOfRows() - 3, 0, 1); mergeCellsHorizontally(table, table.getNumberOfRows() - 3, 0, 1);
mergeCellsHorizontally(table, table.getNumberOfRows() - 3, 2, 3); mergeCellsHorizontally(table, table.getNumberOfRows() - 3, 2, 3);
@ -887,7 +893,9 @@ public class PmsProjectTestcaseServiceImpl implements IPmsProjectTestcaseService
mergeCellsHorizontally(table, table.getNumberOfRows() - 3, 6, 8); mergeCellsHorizontally(table, table.getNumberOfRows() - 3, 6, 8);
//生成模版倒数第一行 //生成模版倒数第一行
mergeCellsHorizontally(table, table.getNumberOfRows() - 2, 0, 1); mergeCellsHorizontally(table, table.getNumberOfRows() - 2, 0, 1);
mergeCellsHorizontally(table, table.getNumberOfRows() - 2, 2, 8); mergeCellsHorizontally(table, table.getNumberOfRows() - 2, 2, 3);
mergeCellsHorizontally(table, table.getNumberOfRows() - 2, 4, 5);
mergeCellsHorizontally(table, table.getNumberOfRows() - 2, 6, 8);
// 在表格中填值 // 在表格中填值
fillTbale(table, pendingOutputData); fillTbale(table, pendingOutputData);