fix(测试跟踪): 测试计划功能用例不展示自定义字段
--bug=1016573 --user=陈建星 【测试跟踪】github #17657,功能用例自定义字段已经输入值并保存,在任务计划中关联用例后自定义字段值消失 https://www.tapd.cn/55049933/s/1239713
This commit is contained in:
parent
1a017e8274
commit
1acb119ddf
|
@ -2,6 +2,7 @@ package io.metersphere.track.dto;
|
||||||
|
|
||||||
import io.metersphere.base.domain.IssuesDao;
|
import io.metersphere.base.domain.IssuesDao;
|
||||||
import io.metersphere.base.domain.TestCaseWithBLOBs;
|
import io.metersphere.base.domain.TestCaseWithBLOBs;
|
||||||
|
import io.metersphere.dto.CustomFieldDao;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -28,4 +29,5 @@ public class TestPlanCaseDTO extends TestCaseWithBLOBs {
|
||||||
|
|
||||||
private List<TestCaseTestDTO> list;
|
private List<TestCaseTestDTO> list;
|
||||||
private List<IssuesDao> issueList;
|
private List<IssuesDao> issueList;
|
||||||
|
private List<CustomFieldDao> fields;
|
||||||
}
|
}
|
||||||
|
|
|
@ -754,8 +754,13 @@ public class TestCaseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buildCustomField(TestCaseDTO data) {
|
private void buildCustomField(TestCaseDTO data) {
|
||||||
|
List<CustomFieldDao> fields = getCustomFiledById(data.getId());
|
||||||
|
data.setFields(fields);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CustomFieldDao> getCustomFiledById(String id) {
|
||||||
CustomFieldTestCaseExample example = new CustomFieldTestCaseExample();
|
CustomFieldTestCaseExample example = new CustomFieldTestCaseExample();
|
||||||
example.createCriteria().andResourceIdEqualTo(data.getId());
|
example.createCriteria().andResourceIdEqualTo(id);
|
||||||
List<CustomFieldTestCase> customFieldTestCases = customFieldTestCaseMapper.selectByExampleWithBLOBs(example);
|
List<CustomFieldTestCase> customFieldTestCases = customFieldTestCaseMapper.selectByExampleWithBLOBs(example);
|
||||||
List<CustomFieldDao> fields = new ArrayList<>();
|
List<CustomFieldDao> fields = new ArrayList<>();
|
||||||
customFieldTestCases.forEach(i -> {
|
customFieldTestCases.forEach(i -> {
|
||||||
|
@ -765,7 +770,7 @@ public class TestCaseService {
|
||||||
customFieldDao.setTextValue(i.getTextValue());
|
customFieldDao.setTextValue(i.getTextValue());
|
||||||
fields.add(customFieldDao);
|
fields.add(customFieldDao);
|
||||||
});
|
});
|
||||||
data.setFields(fields);
|
return fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buildProjectInfoWidthoutProject(List<TestCaseDTO> resList) {
|
private void buildProjectInfoWidthoutProject(List<TestCaseDTO> resList) {
|
||||||
|
|
|
@ -14,6 +14,7 @@ import io.metersphere.commons.utils.*;
|
||||||
import io.metersphere.controller.request.OrderRequest;
|
import io.metersphere.controller.request.OrderRequest;
|
||||||
import io.metersphere.controller.request.ResetOrderRequest;
|
import io.metersphere.controller.request.ResetOrderRequest;
|
||||||
import io.metersphere.controller.request.member.QueryMemberRequest;
|
import io.metersphere.controller.request.member.QueryMemberRequest;
|
||||||
|
import io.metersphere.dto.CustomFieldDao;
|
||||||
import io.metersphere.dto.ProjectConfig;
|
import io.metersphere.dto.ProjectConfig;
|
||||||
import io.metersphere.log.vo.DetailColumn;
|
import io.metersphere.log.vo.DetailColumn;
|
||||||
import io.metersphere.log.vo.OperatingLogDetails;
|
import io.metersphere.log.vo.OperatingLogDetails;
|
||||||
|
@ -275,6 +276,8 @@ public class TestPlanTestCaseService {
|
||||||
testCaseTestDTOS.forEach(dto -> {
|
testCaseTestDTOS.forEach(dto -> {
|
||||||
setTestName(dto);
|
setTestName(dto);
|
||||||
});
|
});
|
||||||
|
List<CustomFieldDao> fields = testCaseService.getCustomFiledById(testPlanCaseDTO.getCaseId());
|
||||||
|
testPlanCaseDTO.setFields(fields);
|
||||||
testPlanCaseDTO.setList(testCaseTestDTOS);
|
testPlanCaseDTO.setList(testCaseTestDTOS);
|
||||||
return testPlanCaseDTO;
|
return testPlanCaseDTO;
|
||||||
}
|
}
|
||||||
|
|
|
@ -417,6 +417,13 @@ export default {
|
||||||
this.testCase = item;
|
this.testCase = item;
|
||||||
this.originalStatus = this.testCase.status;
|
this.originalStatus = this.testCase.status;
|
||||||
parseCustomField(this.testCase, this.testCaseTemplate, null, buildTestCaseOldFields(this.testCase));
|
parseCustomField(this.testCase, this.testCaseTemplate, null, buildTestCaseOldFields(this.testCase));
|
||||||
|
this.testCaseTemplate.customFields.forEach(item => {
|
||||||
|
try {
|
||||||
|
item.defaultValue = JSON.parse(item.defaultValue);
|
||||||
|
} catch (e) {
|
||||||
|
// nothing
|
||||||
|
}
|
||||||
|
});
|
||||||
this.isCustomFiledActive = true;
|
this.isCustomFiledActive = true;
|
||||||
if (!this.testCase.actualResult) {
|
if (!this.testCase.actualResult) {
|
||||||
// 如果没值,使用模板的默认值
|
// 如果没值,使用模板的默认值
|
||||||
|
|
Loading…
Reference in New Issue