diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java b/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java
index 4faa3d53dd..e32cd6387c 100644
--- a/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java
+++ b/backend/src/main/java/io/metersphere/api/controller/ApiDefinitionController.java
@@ -187,6 +187,11 @@ public class ApiDefinitionController {
return apiDefinitionService.getDbResult(testId);
}
+ @GetMapping("/report/get/{testId}")
+ public APIReportResult getReportById(@PathVariable String testId) {
+ return apiDefinitionService.getReportById(testId);
+ }
+
@GetMapping("/report/getReport/{testId}/{type}")
public APIReportResult getReport(@PathVariable String testId, @PathVariable String type) {
return apiDefinitionService.getDbResult(testId, type);
diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java
index 3b876f599b..75a0327ea7 100644
--- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java
+++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java
@@ -77,6 +77,8 @@ public class ApiDefinitionService {
@Resource
private ExtApiDefinitionExecResultMapper extApiDefinitionExecResultMapper;
@Resource
+ private ApiDefinitionExecResultMapper apiDefinitionExecResultMapper;
+ @Resource
private JMeterService jMeterService;
@Resource
private SqlSessionFactory sqlSessionFactory;
@@ -635,6 +637,10 @@ public class ApiDefinitionService {
ApiDefinitionExecResult result = extApiDefinitionExecResultMapper.selectMaxResultByResourceId(testId);
return buildAPIReportResult(result);
}
+ public APIReportResult getReportById(String testId) {
+ ApiDefinitionExecResult result = apiDefinitionExecResultMapper.selectByPrimaryKey(testId);
+ return buildAPIReportResult(result);
+ }
private APIReportResult buildAPIReportResult(ApiDefinitionExecResult result) {
if (result == null) {
diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTaskMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTaskMapper.xml
index c393345fc4..fc6a6046b4 100644
--- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTaskMapper.xml
+++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTaskMapper.xml
@@ -17,7 +17,7 @@
UNION ALL
(select t.id,t.name,'API' as executionModule, ifnull(t.actuator,'LOCAL') as actuator, t1.`name` as executor,t.create_time as executionTime, ifnull(t.trigger_mode,'MANUAL') as triggerMode ,ifnull(t.status,'Saved') as executionStatus
from api_definition_exec_result t left join `user` t1 ON t.user_id = t1.id left join api_definition t3 on t.resource_id = t3.id left join api_test_case t4 on t4.id = t.resource_id
- where to_days(FROM_UNIXTIME(t.create_time/1000))= to_days(now()) and t3.project_id =#{request.projectId} and t4.project_id =#{request.projectId}
+ where to_days(FROM_UNIXTIME(t.create_time/1000))= to_days(now()) and (t3.project_id =#{request.projectId} OR t4.project_id =#{request.projectId})