mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 21:49:23 +08:00
fix(测试跟踪): 导出用例自定义字段导出不全
--bug=1027597 --user=陈建星 【测试跟踪】导出excel用例-导出内容不全 https://www.tapd.cn/55049933/s/1391380
This commit is contained in:
parent
01a441eb50
commit
4547b580e4
@ -1929,10 +1929,11 @@ public class TestCaseService {
|
||||
|
||||
private void buildExportCustomField(Map<String, Map<String, String>> customSelectValueMap,
|
||||
Map<String, String> customNameMap, TestCaseDTO t, TestCaseExcelData data, Set<String> textFields) {
|
||||
try {
|
||||
List<CustomFieldResourceDTO> fields = customFieldTestCaseService.getByResourceId(t.getId());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
for (int index = 0; index < fields.size(); index++) {
|
||||
|
||||
List<CustomFieldResourceDTO> fields = customFieldTestCaseService.getByResourceId(t.getId());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
for (int index = 0; index < fields.size(); index++) {
|
||||
try {
|
||||
CustomFieldResourceDTO field = fields.get(index);
|
||||
//进行key value对换
|
||||
String id = field.getFieldId();
|
||||
@ -1942,6 +1943,9 @@ public class TestCaseService {
|
||||
}
|
||||
if (StringUtils.isNotBlank(field.getValue())) {
|
||||
Object value = JSON.parseObject(field.getValue());
|
||||
if (value == null) {
|
||||
continue;
|
||||
}
|
||||
Map<String, String> optionMap = customSelectValueMap.get(id);
|
||||
if (value instanceof List) {
|
||||
List<String> results = new ArrayList<>();
|
||||
@ -1961,11 +1965,11 @@ public class TestCaseService {
|
||||
map.put(customNameMap.get(id), value.toString());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
}
|
||||
data.setCustomData(map);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
}
|
||||
data.setCustomData(map);
|
||||
}
|
||||
|
||||
private void buildExportStep(TestCaseDTO t, List<String> stepDescList, List<String> stepResultList, TestCaseExcelData data) {
|
||||
|
Loading…
Reference in New Issue
Block a user