fix(测试跟踪): 新建功能用例等级字段为非必填时报错
--bug=1011509 --user=李玉号 [测试跟踪]github#11698新建功能用例,用例等级字段为非必填时,无法把用例新增到最新版本以外的其他版本中。 https://www.tapd.cn/55049933/s/1123065 Closes #11698
This commit is contained in:
parent
fc8070e210
commit
2fedefc3ce
|
@ -5,6 +5,7 @@ import io.metersphere.commons.constants.TestReviewCaseStatus;
|
||||||
import io.metersphere.track.request.testcase.TrackCount;
|
import io.metersphere.track.request.testcase.TrackCount;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -110,6 +111,7 @@ public class TrackStatisticsDTO {
|
||||||
*/
|
*/
|
||||||
public void countPriority(List<TrackCountResult> trackCountResults) {
|
public void countPriority(List<TrackCountResult> trackCountResults) {
|
||||||
for (TrackCountResult countResult : trackCountResults) {
|
for (TrackCountResult countResult : trackCountResults) {
|
||||||
|
if (StringUtils.isNotBlank(countResult.getGroupField())) {
|
||||||
switch (countResult.getGroupField().toUpperCase()){
|
switch (countResult.getGroupField().toUpperCase()){
|
||||||
case TrackCount.P0:
|
case TrackCount.P0:
|
||||||
this.p0CaseCountNumber += countResult.getCountNumber();
|
this.p0CaseCountNumber += countResult.getCountNumber();
|
||||||
|
@ -126,6 +128,7 @@ public class TrackStatisticsDTO {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.allCaseCountNumber += countResult.getCountNumber();
|
this.allCaseCountNumber += countResult.getCountNumber();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -424,8 +424,10 @@ public class TestCaseService {
|
||||||
criteria.andNameEqualTo(testCase.getName())
|
criteria.andNameEqualTo(testCase.getName())
|
||||||
.andProjectIdEqualTo(testCase.getProjectId())
|
.andProjectIdEqualTo(testCase.getProjectId())
|
||||||
.andNodePathEqualTo(nodePath)
|
.andNodePathEqualTo(nodePath)
|
||||||
.andTypeEqualTo(testCase.getType())
|
.andTypeEqualTo(testCase.getType());
|
||||||
.andPriorityEqualTo(testCase.getPriority());
|
if (StringUtils.isNotBlank(testCase.getPriority())) {
|
||||||
|
criteria.andPriorityEqualTo(testCase.getPriority());
|
||||||
|
}
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(testCase.getTestId())) {
|
if (StringUtils.isNotBlank(testCase.getTestId())) {
|
||||||
criteria.andTestIdEqualTo(testCase.getTestId());
|
criteria.andTestIdEqualTo(testCase.getTestId());
|
||||||
|
|
Loading…
Reference in New Issue