fix(接口测试): 接口导入选覆盖,ID应该不变

This commit is contained in:
chenjianxing 2021-04-27 17:08:02 +08:00 committed by jianxing
parent 29d4e4ebe1
commit 406e51560a
2 changed files with 2 additions and 0 deletions

View File

@ -1309,6 +1309,7 @@ public class ApiAutomationService {
} else {
//如果存在则修改
scenarioWithBLOBs.setId(sameRequest.get(0).getId());
scenarioWithBLOBs.setNum(sameRequest.get(0).getNum());
batchMapper.updateByPrimaryKeyWithBLOBs(scenarioWithBLOBs);
}
}

View File

@ -422,6 +422,7 @@ public class ApiDefinitionService {
String request = setImportHashTree(apiDefinition);
apiDefinition.setModuleId(sameRequest.get(0).getModuleId());
apiDefinition.setModulePath(sameRequest.get(0).getModulePath());
apiDefinition.setNum(sameRequest.get(0).getNum()); //id 不变
apiDefinitionMapper.updateByPrimaryKeyWithBLOBs(apiDefinition);
apiDefinition.setRequest(request);
importApiCase(apiDefinition, apiTestCaseMapper, apiTestImportRequest, false);