From 7a23f5266179b93bc1b30f06f8119c43a2b4789c Mon Sep 17 00:00:00 2001 From: zhangyong Date: Fri, 2 Dec 2022 13:41:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E5=85=B3=E8=81=94UI?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E8=BF=9B=E5=BA=A6=E9=97=AE=E9=A2=98?= 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/1310940 --- .../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);