From 77381ea1730bc2cd014756c8146815236f85f154 Mon Sep 17 00:00:00 2001 From: zwz <83956804@qq.com> Date: Mon, 2 Jun 2025 22:39:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D1=E3=80=81=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E5=AF=BC=E5=87=BA=E6=97=B6=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E7=AB=A0=E8=8A=82=E5=8F=B7=E4=B8=8D=E5=AF=B9=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9B2=E3=80=81=E9=83=A8=E5=88=86=E7=AB=A0=E8=8A=82?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E6=B2=A1=E6=9C=89=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/domain/vo/PmsProjectTestcaseVo.java | 1 + .../impl/PmsProjectTestcaseServiceImpl.java | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectTestcaseVo.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectTestcaseVo.java index c1f06033d..a220d37d9 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectTestcaseVo.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/domain/vo/PmsProjectTestcaseVo.java @@ -37,4 +37,5 @@ public class PmsProjectTestcaseVo { private String identifier; private String testTracking; + } diff --git a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectTestcaseServiceImpl.java b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectTestcaseServiceImpl.java index 40b2e37cd..465e79dc9 100644 --- a/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectTestcaseServiceImpl.java +++ b/microservices-modules/microservices-modules-pms/src/main/java/com/microservices/pms/project/service/impl/PmsProjectTestcaseServiceImpl.java @@ -564,7 +564,9 @@ public class PmsProjectTestcaseServiceImpl implements IPmsProjectTestcaseService List testcases = getTestcase(item); for (PmsProjectTestcaseVo testcase : testcases) { - if (testcase.getPmsModuleId() == moduleId) { + Long pmsModuleId = testcase.getPmsModuleId(); + boolean isEqual = Objects.equals(pmsModuleId, moduleId); + if (isEqual) { List 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 pendingOutputDatas = GetPendingOutputData(projectId, current.getId()); insertTable(document, pendingOutputDatas, chapter); - chapter = chapter + 1; } else { addNumberedHeading(document, current.getLabel(), current.getLevel()); List 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()); }