fix(用例管理): 修复导入不勾选重复也导入的问题

--bug=1045518 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001045518
This commit is contained in:
guoyuqi 2024-08-21 11:48:21 +08:00 committed by Craftsman
parent 927fd92abb
commit 9cc77a5006
2 changed files with 6 additions and 3 deletions

View File

@ -330,7 +330,7 @@ public class FunctionalCaseFileService {
XMindCaseParser xMindParser = new XMindCaseParser(request, customFields, user, lasePos); XMindCaseParser xMindParser = new XMindCaseParser(request, customFields, user, lasePos);
errList = xMindParser.parse(multipartFile); errList = xMindParser.parse(multipartFile);
response.setErrorMessages(errList); response.setErrorMessages(errList);
response.setSuccessCount(xMindParser.getList().size() + xMindParser.getUpdateList().size()); response.setSuccessCount(xMindParser.getList().size() + xMindParser.getUpdateList().size()+ xMindParser.getCheckSuccessList().size());
response.setFailCount(errList.size()); response.setFailCount(errList.size());
xMindParser.clear(); xMindParser.clear();
return response; return response;
@ -407,7 +407,7 @@ public class FunctionalCaseFileService {
} }
xmindParser.saveData(); xmindParser.saveData();
response.setErrorMessages(errList); response.setErrorMessages(errList);
response.setSuccessCount(xmindParser.getList().size() + xmindParser.getUpdateList().size()); response.setSuccessCount(xmindParser.getList().size() + xmindParser.getUpdateList().size()+ xmindParser.getCheckSuccessList().size());
response.setFailCount(errList.size()); response.setFailCount(errList.size());
xmindParser.clear(); xmindParser.clear();
return response; return response;

View File

@ -46,6 +46,8 @@ public class XMindCaseParser {
@Getter @Getter
protected List<FunctionalCaseExcelData> list = new ArrayList<>(); protected List<FunctionalCaseExcelData> list = new ArrayList<>();
@Getter @Getter
protected List<FunctionalCaseExcelData> checkSuccessList = new ArrayList<>();
@Getter
protected List<FunctionalCaseExcelData> updateList = new ArrayList<>(); protected List<FunctionalCaseExcelData> updateList = new ArrayList<>();
private FunctionalCaseService functionalCaseService; private FunctionalCaseService functionalCaseService;
@ -93,6 +95,7 @@ public class XMindCaseParser {
public void clear() { public void clear() {
list.clear(); list.clear();
updateList.clear(); updateList.clear();
checkSuccessList.clear();
pathMap.clear(); pathMap.clear();
moduleTree = new ArrayList<>(); moduleTree = new ArrayList<>();
customFieldValidatorMap = new HashMap<>(); customFieldValidatorMap = new HashMap<>();
@ -288,7 +291,7 @@ public class XMindCaseParser {
functionalCaseExcelData.setNum(checkResult); functionalCaseExcelData.setNum(checkResult);
updateList.add(functionalCaseExcelData); updateList.add(functionalCaseExcelData);
} else { } else {
list.add(functionalCaseExcelData); checkSuccessList.add(functionalCaseExcelData);
} }
} else { } else {
list.add(functionalCaseExcelData); list.add(functionalCaseExcelData);