fix(接口测试): 接口导入用例ID生成问题

--user=郭雨琦
This commit is contained in:
guoyuqi 2022-08-02 12:10:05 +08:00 committed by xiaomeinvG
parent 118575abb9
commit dbc6c24a0b
1 changed files with 3 additions and 2 deletions

View File

@ -989,7 +989,8 @@ public class ApiDefinitionService {
if (caseList == null || caseList.isEmpty()) {
return;
}
for (ApiTestCaseWithBLOBs apiTestCaseWithBLOBs : caseList) {
for (int i = 0; i < caseList.size(); i++) {
ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = caseList.get(i);
apiTestCaseWithBLOBs.setApiDefinitionId(apiDefinition.getId());
if (apiDefinition.getToBeUpdated() != null && !apiTestCaseWithBLOBs.getVersionId().equals("cover")) {
apiTestCaseWithBLOBs.setToBeUpdated(true);
@ -1013,7 +1014,7 @@ public class ApiDefinitionService {
apiTestCaseWithBLOBs.setOrder(getImportNextCaseOrder(apiDefinition.getProjectId()));
}
if (apiTestCaseWithBLOBs.getNum() == null) {
apiTestCaseWithBLOBs.setNum(testCaseService.getNextNum(apiDefinition.getId()));
apiTestCaseWithBLOBs.setNum(apiTestCaseService.getNextNum(apiDefinition.getId(), apiDefinition.getNum() + i, apiDefinition.getProjectId()));
}
if (apiDefinition.getToBeUpdateTime() != null) {