diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java index 68424f694b..bfb8f5b40e 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java @@ -798,6 +798,13 @@ public class ApiScenarioReportService { example.createCriteria().andCreateTimeLessThan(time).andProjectIdEqualTo(projectId); List apiScenarioReports = apiScenarioReportMapper.selectByExample(example); List ids = apiScenarioReports.stream().map(ApiScenarioReport::getId).collect(Collectors.toList()); + + ApiDefinitionExecResultExample definitionExecResultExample = new ApiDefinitionExecResultExample(); + definitionExecResultExample.createCriteria().andCreateTimeLessThan(time).andProjectIdEqualTo(projectId); + List apiDefinitionExecResults = definitionExecResultMapper.selectByExample(definitionExecResultExample); + List definitionExecIds = apiDefinitionExecResults.stream().map(ApiDefinitionExecResult::getId).collect(Collectors.toList()); + + ids.addAll(definitionExecIds); if (CollectionUtils.isNotEmpty(ids)) { APIReportBatchRequest request = new APIReportBatchRequest(); request.setIds(ids);