From 798252ec4ac0e7545dae02f53422069afaf296ce Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 26 Jan 2022 20:20:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E7=89=88=E6=9C=AC=E5=AF=BC=E5=85=A5=E6=8A=A5?= =?UTF-8?q?=E9=94=99=20--bug=3D1010044=20--user=3D=E9=99=88=E5=BB=BA?= =?UTF-8?q?=E6=98=9F=20=E3=80=90=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA?= =?UTF-8?q?=E3=80=91=E5=8A=9F=E8=83=BD=E7=94=A8=E4=BE=8B=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E9=9D=9E=E6=9C=80=E6=96=B0=E7=89=88=EF=BC=8C=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E4=BA=86=20https://www.tapd.cn/55049933/s/1099636?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/track/service/TestCaseService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index c5bc127eff..f09a9fe959 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -729,9 +729,11 @@ public class TestCaseService { if (multipartFile == null) { 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())) { // 创建如果没选版本就创建最新版本,更新时没选就更新最近版本的用例 - request.setVersionId(extProjectVersionMapper.getDefaultVersion(request.getProjectId())); + if (StringUtils.isBlank(request.getVersionId())) { + request.setVersionId(extProjectVersionMapper.getDefaultVersion(request.getProjectId())); + } int nextNum = getNextNum(request.getProjectId()); importCreateNum.set(nextNum); beforeImportCreateNum.set(nextNum);