diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/excel/validate/CustomFieldMultipleMemberValidator.java b/backend/services/case-management/src/main/java/io/metersphere/functional/excel/validate/CustomFieldMultipleMemberValidator.java index 88dcf9d4d9..e36d1a3b36 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/excel/validate/CustomFieldMultipleMemberValidator.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/excel/validate/CustomFieldMultipleMemberValidator.java @@ -7,6 +7,7 @@ import io.metersphere.sdk.util.Translator; import io.metersphere.system.dto.sdk.TemplateCustomFieldDTO; import org.apache.commons.lang3.StringUtils; +import java.util.ArrayList; import java.util.List; /** @@ -32,7 +33,7 @@ public class CustomFieldMultipleMemberValidator extends CustomFieldMemberValidat @Override public Object parse2Key(String keyOrValuesStr, TemplateCustomFieldDTO customField) { if (StringUtils.isBlank(keyOrValuesStr)) { - return StringUtils.EMPTY; + return JSON.toJSONString(new ArrayList<>()); } List keyOrValues = parse2Array(keyOrValuesStr); diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/excel/validate/CustomFieldMultipleSelectValidator.java b/backend/services/case-management/src/main/java/io/metersphere/functional/excel/validate/CustomFieldMultipleSelectValidator.java index b55d2bf97b..f4b3540457 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/excel/validate/CustomFieldMultipleSelectValidator.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/excel/validate/CustomFieldMultipleSelectValidator.java @@ -7,6 +7,7 @@ import io.metersphere.sdk.util.Translator; import io.metersphere.system.dto.sdk.TemplateCustomFieldDTO; import org.apache.commons.lang3.StringUtils; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; @@ -35,7 +36,7 @@ public class CustomFieldMultipleSelectValidator extends CustomFieldSelectValidat @Override public Object parse2Key(String keyOrValuesStr, TemplateCustomFieldDTO customField) { if (StringUtils.isBlank(keyOrValuesStr)) { - return StringUtils.EMPTY; + return JSON.toJSONString(new ArrayList<>()); } List keyOrValues = parse2Array(keyOrValuesStr); Map nameMap = optionTextMapCache.get(customField.getFieldId()); diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/excel/validate/CustomFieldMultipleTextValidator.java b/backend/services/case-management/src/main/java/io/metersphere/functional/excel/validate/CustomFieldMultipleTextValidator.java index 833c1535f6..17d573da8b 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/excel/validate/CustomFieldMultipleTextValidator.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/excel/validate/CustomFieldMultipleTextValidator.java @@ -7,6 +7,7 @@ import io.metersphere.sdk.util.Translator; import io.metersphere.system.dto.sdk.TemplateCustomFieldDTO; import org.apache.commons.lang3.StringUtils; +import java.util.ArrayList; import java.util.List; /** @@ -33,7 +34,7 @@ public class CustomFieldMultipleTextValidator extends AbstractCustomFieldValidat @Override public Object parse2Key(String keyOrValuesStr, TemplateCustomFieldDTO customField) { if (StringUtils.isBlank(keyOrValuesStr)) { - return StringUtils.EMPTY; + return JSON.toJSONString(new ArrayList<>()); } List keyOrValues = parse2Array(keyOrValuesStr);