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);