diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java index ba6711da0c..70d835cfa8 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/MsScenario.java @@ -161,7 +161,7 @@ public class MsScenario extends MsTestElement { } HashTree scenarioTree = tree; if (config != null && !config.getExcludeScenarioIds().contains(this.getId())) { - scenarioTree = MsCriticalSectionController.createHashTree(tree, this.getName()); + scenarioTree = MsCriticalSectionController.createHashTree(tree, this.getName(), this.isEnable()); } // 场景变量和环境变量 Arguments arguments = arguments(config); diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsCriticalSectionController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsCriticalSectionController.java index 0dd1596585..19047979b0 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsCriticalSectionController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsCriticalSectionController.java @@ -17,12 +17,12 @@ public class MsCriticalSectionController extends MsTestElement { } - public static HashTree createHashTree(HashTree tree, String name) { + public static HashTree createHashTree(HashTree tree, String name, boolean enable) { CriticalSectionController criticalSectionController = new CriticalSectionController(); criticalSectionController.setName(StringUtils.isNotEmpty(name) ? "Csc_" + name : "Scenario Critical Section Controller"); criticalSectionController.setLockName("global_lock_" + getUUID(8)); - criticalSectionController.setEnabled(true); + criticalSectionController.setEnabled(enable); criticalSectionController.setProperty(TestElement.TEST_CLASS, CriticalSectionController.class.getName()); criticalSectionController.setProperty(TestElement.GUI_CLASS, "CriticalSectionControllerGui"); return tree.add(criticalSectionController); diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index 7f7302877f..dd7300e09f 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -1342,20 +1342,6 @@ public class ApiAutomationService { ApiScenarioExample example = new ApiScenarioExample(); example.createCriteria().andIdIn(request.getIds()); List apiScenarioWithBLOBs = apiScenarioMapper.selectByExampleWithBLOBs(example); - // 处理引用数据 - if (CollectionUtils.isNotEmpty(apiScenarioWithBLOBs)) { - apiScenarioWithBLOBs.forEach(item -> { - if (StringUtils.isNotEmpty(item.getScenarioDefinition())) { - JSONObject scenario = JSONObject.parseObject(item.getScenarioDefinition()); - JSONArray hashTree = scenario.getJSONArray("hashTree"); - if (hashTree != null) { - hashTreeService.setHashTree(hashTree); - scenario.put("hashTree", hashTree); - } - item.setScenarioDefinition(JSON.toJSONString(scenario)); - } - }); - } return apiScenarioWithBLOBs; }