From 849f3fb856a4571498c41e5aa92a1a84e2038cbe Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 26 Apr 2023 18:53:12 +0800 Subject: [PATCH] =?UTF-8?q?=20fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):?= =?UTF-8?q?=20=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=88=B0=E6=9C=9F=E5=90=8E=EF=BC=8C=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=B2=A1=E6=9C=89=E5=8F=98=E6=88=90=E5=B7=B2=E7=BB=93?= =?UTF-8?q?=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1025804 --user=陈建星 【测试跟踪】测试计划-计划结束时间到期后,测试计划状态未更新为已结束 https://www.tapd.cn/55049933/s/1367340 --- .../plan/service/TestPlanService.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java index 706fba9f04..9d56afe635 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanService.java @@ -575,17 +575,17 @@ public class TestPlanService { failNum++; } } - if (passNum == statusList.size()) { // 全部通过 + + // 到结束时间了,不管用例的状态都改为已结束 + if (testPlanWithBLOBs.getPlannedEndTime() != null && System.currentTimeMillis() > testPlanWithBLOBs.getPlannedEndTime()) { + testPlanWithBLOBs.setStatus(TestPlanStatus.Finished.name()); + editTestPlan(testPlanWithBLOBs); + } else if (prepareNum == 0 && passNum + failNum == statusList.size()) { + // 如果全部都执行完了改为已完成,如果已完成之后到结束时间了,走上面逻辑改成已结束 testPlanWithBLOBs.setStatus(TestPlanStatus.Completed.name()); this.editTestPlan(testPlanWithBLOBs); - } else if (prepareNum == 0 && passNum + failNum == statusList.size()) { // 已结束 - if (testPlanWithBLOBs.getPlannedEndTime() != null && testPlanWithBLOBs.getPlannedEndTime() > System.currentTimeMillis()) { - testPlanWithBLOBs.setStatus(TestPlanStatus.Completed.name()); - } else { - testPlanWithBLOBs.setStatus(TestPlanStatus.Finished.name()); - } - editTestPlan(testPlanWithBLOBs); - } else if (prepareNum != 0) { // 进行中 + } else if (prepareNum != 0) { + // 用例没有执行完,并且结束时间没到,改为进行中 testPlanWithBLOBs.setStatus(TestPlanStatus.Underway.name()); editTestPlan(testPlanWithBLOBs); }