fix(测试跟踪): 功能用例导入报错

--bug=1016072 --user=陈建星 【测试跟踪】导入更新用例失败 https://www.tapd.cn/55049933/s/1229233
This commit is contained in:
chenjianxing 2022-08-22 14:34:48 +08:00 committed by f2c-ci-robot[bot]
parent 4144e90021
commit 701509c4b3
4 changed files with 9 additions and 2 deletions

View File

@ -196,7 +196,7 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
ExcelErrData excelErrData = new ExcelErrData(testCaseExcelData, rowIndex, ExcelErrData excelErrData = new ExcelErrData(testCaseExcelData, rowIndex,
Translator.get("number") Translator.get("number")
.concat(" ") .concat(" ")
.concat(rowIndex.toString()).concat(" ") .concat(String.valueOf(rowIndex + 1)).concat(" ")
.concat(Translator.get("row")) .concat(Translator.get("row"))
.concat(Translator.get("error")) .concat(Translator.get("error"))
.concat("") .concat("")

View File

@ -26,6 +26,9 @@ public class CustomFieldMultipleMemberValidator extends CustomFieldMemberValidat
@Override @Override
public String parse2Key(String keyOrValuesStr, CustomFieldDao customField) { public String parse2Key(String keyOrValuesStr, CustomFieldDao customField) {
if (StringUtils.isBlank(keyOrValuesStr)) {
return "";
}
List<String> keyOrValues = JSONArray.parseArray(keyOrValuesStr, String.class); List<String> keyOrValues = JSONArray.parseArray(keyOrValuesStr, String.class);
for (int i = 0; i < keyOrValues.size(); i++) { for (int i = 0; i < keyOrValues.size(); i++) {

View File

@ -18,6 +18,7 @@ public class CustomFieldMultipleSelectValidator extends CustomFieldSelectValidat
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
return; return;
} }
prepareCatch(customField);
Set<String> idSet = optionValueSetCache.get(customField.getId()); Set<String> idSet = optionValueSetCache.get(customField.getId());
Set<String> textSet = optionTextSetCache.get(customField.getId()); Set<String> textSet = optionTextSetCache.get(customField.getId());
for (String item : parse2Array(customField.getName(), value)) { for (String item : parse2Array(customField.getName(), value)) {
@ -29,6 +30,9 @@ public class CustomFieldMultipleSelectValidator extends CustomFieldSelectValidat
@Override @Override
public String parse2Key(String keyOrValuesStr, CustomFieldDao customField) { public String parse2Key(String keyOrValuesStr, CustomFieldDao customField) {
if (StringUtils.isBlank(keyOrValuesStr)) {
return "";
}
List<String> keyOrValues = JSONArray.parseArray(keyOrValuesStr, String.class); List<String> keyOrValues = JSONArray.parseArray(keyOrValuesStr, String.class);
Map<String, String> nameMap = optionTextMapCache.get(customField.getId()); Map<String, String> nameMap = optionTextMapCache.get(customField.getId());
for (int i = 0; i < keyOrValues.size(); i++) { for (int i = 0; i < keyOrValues.size(); i++) {

View File

@ -68,7 +68,7 @@ public class CustomFieldSelectValidator extends AbstractCustomFieldValidator {
* *
* @param customField * @param customField
*/ */
private void prepareCatch(CustomFieldDao customField) { protected void prepareCatch(CustomFieldDao customField) {
if (optionValueSetCache.get(customField.getId()) == null) { if (optionValueSetCache.get(customField.getId()) == null) {
List<CustomFieldOption> options = getOptions(customField.getId(), customField.getOptions()); List<CustomFieldOption> options = getOptions(customField.getId(), customField.getOptions());