From ad296090be3c849b9fca6197d9ccc3a807e3e1fc Mon Sep 17 00:00:00 2001 From: zhangyong Date: Mon, 5 Dec 2022 10:29:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(UI=E8=87=AA=E5=8A=A8=E5=8C=96):=20=E5=85=B3?= =?UTF-8?q?=E8=81=94=E4=B8=80=E4=B8=AAui=E5=9C=BA=E6=99=AF=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=EF=BC=8C=E6=B2=A1=E6=9C=89=E6=89=A7=E8=A1=8C=EF=BC=8C?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E7=9A=84=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E5=8F=98=E6=88=90100%=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1020142 --user=张勇 【测试跟踪】测试计划关联UI后,状态会变成已结束 https://www.tapd.cn/55049933/s/1312072 --- .../io/metersphere/constants/DataStatus.java | 25 +++++++++++++++++++ .../plan/service/TestPlanService.java | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 test-track/backend/src/main/java/io/metersphere/constants/DataStatus.java diff --git a/test-track/backend/src/main/java/io/metersphere/constants/DataStatus.java b/test-track/backend/src/main/java/io/metersphere/constants/DataStatus.java new file mode 100644 index 0000000000..387e0de0f7 --- /dev/null +++ b/test-track/backend/src/main/java/io/metersphere/constants/DataStatus.java @@ -0,0 +1,25 @@ +package io.metersphere.constants; + +public enum DataStatus { + UNEXECUTE("UnExecute", "未开始"), + UNDERWAY("Underway", "进行中"), + TRASH("Trash", "废弃"), + PREPARE("Prepare", "未开始"), + COMPLETED("Completed", "已完成"); + + private String value; + private String desc; + + public String getValue() { + return value; + } + + public String getDesc() { + return desc; + } + + DataStatus(String value, String desc) { + this.value = value; + this.desc = desc; + } +} 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 2d4226d4fd..6f9dcf0a6a 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 @@ -12,6 +12,7 @@ import io.metersphere.base.mapper.ext.ExtTestPlanTestCaseMapper; import io.metersphere.commons.constants.*; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.*; +import io.metersphere.constants.DataStatus; import io.metersphere.constants.RunModeConstants; import io.metersphere.dto.*; import io.metersphere.excel.constants.TestPlanTestCaseStatus; @@ -420,7 +421,7 @@ public class TestPlanService { try { List execResults = getResultFunc.apply(planId); execResults.forEach(item -> { - if (StringUtils.isNotBlank(item) && !StringUtils.equalsIgnoreCase("UnExecute", item)) { + if (StringUtils.isNotBlank(item) && !StringUtils.equalsIgnoreCase(DataStatus.UNEXECUTE.getValue(), item) && !StringUtils.equalsIgnoreCase(DataStatus.PREPARE.getValue(), item)) { testPlan.setTested(testPlan.getTested() + 1); if (StringUtils.equalsIgnoreCase(item, APITestStatus.Success.name())) { testPlan.setPassed(testPlan.getPassed() + 1);