diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java index aa76d7a985..bdddf39427 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiCaseService.java @@ -52,6 +52,7 @@ import io.metersphere.system.dto.LogInsertModule; import io.metersphere.system.dto.ModuleSelectDTO; import io.metersphere.system.dto.sdk.BaseTreeNode; import io.metersphere.system.dto.sdk.SessionUser; +import io.metersphere.system.service.BaseTaskHubService; import io.metersphere.system.service.UserLoginService; import io.metersphere.system.uid.IDGenerator; import io.metersphere.system.utils.ServiceUtils; @@ -127,6 +128,8 @@ public class TestPlanApiCaseService extends TestPlanResourceService { private ExtApiTestCaseMapper extApiTestCaseMapper; @Resource private ApiCommonService apiCommonService; + @Resource + private BaseTaskHubService baseTaskHubService; private static final String EXECUTOR = "executeUserName"; @@ -768,6 +771,8 @@ public class TestPlanApiCaseService extends TestPlanResourceService { execTaskItem.setResourceId(apiTestCase.getId()); execTaskItem.setResourceName(apiTestCase.getName()); + baseTaskHubService.insertExecTaskAndDetail(execTask, execTaskItem); + TaskInfo taskInfo = taskRequest.getTaskInfo(); TaskItem taskItem = taskRequest.getTaskItem(); taskInfo.setTaskId(execTask.getId()); diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiScenarioService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiScenarioService.java index 670da9bf36..fa4d0c7ff8 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiScenarioService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanApiScenarioService.java @@ -50,6 +50,7 @@ import io.metersphere.system.dto.LogInsertModule; import io.metersphere.system.dto.ModuleSelectDTO; import io.metersphere.system.dto.sdk.BaseTreeNode; import io.metersphere.system.dto.sdk.SessionUser; +import io.metersphere.system.service.BaseTaskHubService; import io.metersphere.system.service.UserLoginService; import io.metersphere.system.uid.IDGenerator; import io.metersphere.system.utils.ServiceUtils; @@ -117,6 +118,8 @@ public class TestPlanApiScenarioService extends TestPlanResourceService { private TestPlanConfigService testPlanConfigService; @Resource private ApiCommonService apiCommonService; + @Resource + private BaseTaskHubService baseTaskHubService; private static final String EXECUTOR = "executeUserName"; @@ -352,6 +355,8 @@ public class TestPlanApiScenarioService extends TestPlanResourceService { execTaskItem.setResourceId(testPlanApiScenario.getId()); execTaskItem.setResourceName(apiScenario.getName()); + baseTaskHubService.insertExecTaskAndDetail(execTask, execTaskItem); + TaskInfo taskInfo = taskRequest.getTaskInfo(); taskInfo.setTaskId(execTask.getId()); taskInfo.setRunModeConfig(runModeConfig);