From bb6f39a41bc8dcb2eaf8a9d06155aa08d29db454 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Fri, 3 Dec 2021 11:32:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92):=20?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=97=B6?= =?UTF-8?q?=E6=9C=AA=E5=A4=8D=E5=88=B6=E6=89=80=E6=9C=89=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=85=B3=E8=81=94=E7=94=A8=E4=BE=8B=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1008539 --user=lyh 【测试计划】关联接口用例报错【+github#8057】 https://www.tapd.cn/55049933/s/1077518 Closes #8057 --- .../io/metersphere/track/service/TestPlanService.java | 8 ++------ .../main/resources/db/migration/V101__v1.15.3_release.sql | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 backend/src/main/resources/db/migration/V101__v1.15.3_release.sql diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index e15d641499..506ebcbe29 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -1317,14 +1317,10 @@ public class TestPlanService { String targetPlanId = UUID.randomUUID().toString(); TestPlanWithBLOBs targetPlan = new TestPlanWithBLOBs(); + BeanUtils.copyBean(targetPlan, testPlan); + // 覆盖原内容 targetPlan.setId(targetPlanId); targetPlan.setName(testPlan.getName() + "_" + UUID.randomUUID().toString().substring(0, 5) + "_COPY"); - targetPlan.setWorkspaceId(testPlan.getWorkspaceId()); - targetPlan.setDescription(testPlan.getDescription()); - targetPlan.setStage(testPlan.getStage()); - targetPlan.setTags(testPlan.getTags()); - targetPlan.setProjectId(testPlan.getProjectId()); - testPlan.setAutomaticStatusUpdate(testPlan.getAutomaticStatusUpdate()); targetPlan.setStatus(TestPlanStatus.Prepare.name()); targetPlan.setCreator(SessionUtils.getUserId()); targetPlan.setCreateTime(System.currentTimeMillis()); diff --git a/backend/src/main/resources/db/migration/V101__v1.15.3_release.sql b/backend/src/main/resources/db/migration/V101__v1.15.3_release.sql new file mode 100644 index 0000000000..8a26c95d5c --- /dev/null +++ b/backend/src/main/resources/db/migration/V101__v1.15.3_release.sql @@ -0,0 +1,2 @@ +-- 修复数据 +update test_plan set repeat_case = 0 where repeat_case is null; \ No newline at end of file