fix: 功能用例选择版本导入报错

--bug=1010044 --user=陈建星 【测试跟踪】功能用例导入非最新版,报错了 https://www.tapd.cn/55049933/s/1099636
This commit is contained in:
chenjianxing 2022-01-26 20:20:15 +08:00 committed by 刘瑞斌
parent f779e29a13
commit 798252ec4a
1 changed files with 4 additions and 2 deletions

View File

@ -729,9 +729,11 @@ public class TestCaseService {
if (multipartFile == null) { if (multipartFile == null) {
MSException.throwException(Translator.get("upload_fail")); MSException.throwException(Translator.get("upload_fail"));
} }
if (StringUtils.isBlank(request.getVersionId()) && StringUtils.equals(request.getImportType(), FunctionCaseImportEnum.Create.name())) { if (StringUtils.equals(request.getImportType(), FunctionCaseImportEnum.Create.name())) {
// 创建如果没选版本就创建最新版本更新时没选就更新最近版本的用例 // 创建如果没选版本就创建最新版本更新时没选就更新最近版本的用例
if (StringUtils.isBlank(request.getVersionId())) {
request.setVersionId(extProjectVersionMapper.getDefaultVersion(request.getProjectId())); request.setVersionId(extProjectVersionMapper.getDefaultVersion(request.getProjectId()));
}
int nextNum = getNextNum(request.getProjectId()); int nextNum = getNextNum(request.getProjectId());
importCreateNum.set(nextNum); importCreateNum.set(nextNum);
beforeImportCreateNum.set(nextNum); beforeImportCreateNum.set(nextNum);