fix(接口测试): 测试计划用例单独执行,没有出现在任务中心

--bug=1047999 --user=陈建星 【系统设置】系统-任务中心-用例执行任务/用例执行任务详情列表-在测试计划内单独执行用例/场景-任务列表未显示该任务 https://www.tapd.cn/55049933/s/1597730
This commit is contained in:
AgAngle 2024-10-24 19:55:29 +08:00 committed by 刘瑞斌
parent caf13cfb46
commit aee26d4961
2 changed files with 10 additions and 0 deletions

View File

@ -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());

View File

@ -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);