修复1、测试用例导出时表格章节号不对问题;2、部分章节测试用例没有导出的问题

This commit is contained in:
zwz 2025-06-02 22:39:02 +08:00
parent b079d42fcd
commit 77381ea173
2 changed files with 12 additions and 5 deletions

View File

@ -37,4 +37,5 @@ public class PmsProjectTestcaseVo {
private String identifier;
private String testTracking;
}

View File

@ -564,7 +564,9 @@ public class PmsProjectTestcaseServiceImpl implements IPmsProjectTestcaseService
List<PmsProjectTestcaseVo> testcases = getTestcase(item);
for (PmsProjectTestcaseVo testcase : testcases) {
if (testcase.getPmsModuleId() == moduleId) {
Long pmsModuleId = testcase.getPmsModuleId();
boolean isEqual = Objects.equals(pmsModuleId, moduleId);
if (isEqual) {
List<PmsProjectTestcaseStepVo> steps = getTestcaseStep(testcase.getId());
PendingOutputDataVo pendingOutputData = new PendingOutputDataVo();
pendingOutputData.setId(testcase.getId());
@ -1110,25 +1112,29 @@ public class PmsProjectTestcaseServiceImpl implements IPmsProjectTestcaseService
}
}
int chapter = 1;
int chapter = 0;
while (!stack.isEmpty()) {
TreeSelect current = stack.pop();
// 处理当前节点这里简单打印节点信息你可以根据需求修改
//System.out.println("ID: " + current.getId() + ", 名称: " + current.getLabel() + ", 层级:" + current.getLevel() + ", 父ID: " + current.getParentId() + ", 是否叶子节点: " + current.getIsLeaf() );
// System.out.println("ID: " + current.getId() + ", 名称: " + current.getLabel() + ", 层级:" + current.getLevel() + ", 父ID: " + current.getParentId() + ", 是否叶子节点: " + current.getIsLeaf() );
if (current.getIsLeaf()) {
if (current.getLevel() == 1){
chapter = chapter + 1;
}
if(current.getId() > 0){
addNumberedHeading(document, current.getLabel(), current.getLevel());
List<PendingOutputDataVo> pendingOutputDatas = GetPendingOutputData(projectId, current.getId());
insertTable(document, pendingOutputDatas, chapter);
chapter = chapter + 1;
} else {
addNumberedHeading(document, current.getLabel(), current.getLevel());
List<PendingOutputDataVo> pendingOutputDatas = GetPendingOutputData(projectId, null);
insertTable(document, pendingOutputDatas, chapter);
chapter = chapter + 1;
}
} else{
if (current.getLevel() == 1){
chapter = chapter + 1;
}
if(current.getId() > 0){
addNumberedHeading(document, current.getLabel(), current.getLevel());
}