refactor(用例管理): 列表返回options
This commit is contained in:
parent
7d4e6c340c
commit
1a2b88f7a2
|
@ -702,9 +702,6 @@ public class FunctionalCaseService {
|
||||||
List<CustomFieldOption> memberCustomOption = getMemberOptions(projectId);
|
List<CustomFieldOption> memberCustomOption = getMemberOptions(projectId);
|
||||||
List<FunctionalCaseCustomFieldDTO> customFields = functionalCaseCustomFieldService.getCustomFieldsByCaseIds(ids);
|
List<FunctionalCaseCustomFieldDTO> customFields = functionalCaseCustomFieldService.getCustomFieldsByCaseIds(ids);
|
||||||
customFields.forEach(customField -> {
|
customFields.forEach(customField -> {
|
||||||
if (StringUtils.equalsAnyIgnoreCase(customField.getType(), CustomFieldType.MEMBER.name(), CustomFieldType.MULTIPLE_MEMBER.name())) {
|
|
||||||
customField.setOptions(memberCustomOption);
|
|
||||||
}
|
|
||||||
if (customField.getInternal()) {
|
if (customField.getInternal()) {
|
||||||
customField.setFieldName(baseCustomFieldService.translateInternalField(customField.getFieldName()));
|
customField.setFieldName(baseCustomFieldService.translateInternalField(customField.getFieldName()));
|
||||||
}
|
}
|
||||||
|
@ -714,6 +711,9 @@ public class FunctionalCaseService {
|
||||||
Map<String, List<CustomFieldOption>> customOptions = fieldOptions.stream().collect(Collectors.groupingBy(CustomFieldOption::getFieldId));
|
Map<String, List<CustomFieldOption>> customOptions = fieldOptions.stream().collect(Collectors.groupingBy(CustomFieldOption::getFieldId));
|
||||||
customFields.forEach(customField -> {
|
customFields.forEach(customField -> {
|
||||||
customField.setOptions(customOptions.get(customField.getFieldId()));
|
customField.setOptions(customOptions.get(customField.getFieldId()));
|
||||||
|
if (StringUtils.equalsAnyIgnoreCase(customField.getType(), CustomFieldType.MEMBER.name(), CustomFieldType.MULTIPLE_MEMBER.name())) {
|
||||||
|
customField.setOptions(memberCustomOption);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return customFields.stream().collect(Collectors.groupingBy(FunctionalCaseCustomFieldDTO::getCaseId));
|
return customFields.stream().collect(Collectors.groupingBy(FunctionalCaseCustomFieldDTO::getCaseId));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue