From 23a1fc0fb1b8bf68c5b31a71e2a50caf60896e09 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 23 Apr 2024 16:43:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E6=89=B9=E9=87=8F=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1039944 --user=王孝刚 【接口测试】场景-批量-复制到-没把场景内步骤复制过去 https://www.tapd.cn/55049933/s/1506814 --- .../api/service/scenario/ApiScenarioService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioService.java index c461c87359..b7e6712f2a 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioService.java @@ -2176,7 +2176,12 @@ public class ApiScenarioService extends MoveNodeService { Map> currentScenarioParentStepMap = scenarioStepMap.get(scenarioId) .stream() - .collect(Collectors.groupingBy(step -> Optional.ofNullable(step.getParentId()).orElse(StringUtils.EMPTY))); + .collect(Collectors.groupingBy(step -> { + if (StringUtils.equals(step.getParentId(), "NONE")) { + step.setParentId(StringUtils.EMPTY); + } + return Optional.ofNullable(step.getParentId()).orElse(StringUtils.EMPTY); + })); List steps = buildStepTree(currentScenarioParentStepMap.get(StringUtils.EMPTY), currentScenarioParentStepMap, scenarioStepMap, new HashSet<>());