fix(接口测试): 修复停止集合报告报错的缺陷

--bug=1042216 --user=王孝刚 【项目任务中心】批量执行CASE/场景-集合报告-在任务中心停止报错
https://www.tapd.cn/55049933/s/1529628
This commit is contained in:
wxg0103 2024-06-14 19:24:15 +08:00 committed by Craftsman
parent da7c0b3106
commit cfb8375ad5
3 changed files with 3 additions and 2 deletions

View File

@ -214,7 +214,7 @@
<select id="getReports" resultType="io.metersphere.api.dto.report.ReportDTO">
select distinct ar.* , project.organization_id ,
ar.test_plan_case_id as testPlanId,
if (ar.test_plan_case_id = 'NONE' , a.api_test_case_id , ar.test_plan_case_id) as resourceId from api_report ar
if (ar.test_plan_case_id = 'NONE' and ar.integrated =0, a.api_test_case_id , ar.test_plan_case_id) as resourceId from api_report ar
LEFT JOIN api_test_case_record a ON ar.id = a.api_report_id
LEFT JOIN api_test_case c ON a.api_test_case_id = c.id
left join project on ar.project_id = project.id

View File

@ -107,7 +107,7 @@
select distinct asr.*, project.organization_id,
asr.test_plan_scenario_id as testPlanId,
if (asr.test_plan_scenario_id = 'NONE' , a.api_scenario_id , asr.test_plan_scenario_id) as resourceId
if (asr.test_plan_scenario_id = 'NONE' and asr.integrated =0 , a.api_scenario_id , asr.test_plan_scenario_id) as resourceId
from api_scenario_report asr
left join api_scenario_record a on asr.id = a.api_scenario_report_id
left JOIN api_scenario s on a.api_scenario_id = s.id

View File

@ -114,6 +114,7 @@ public class ApiReportShareService {
request.setCreateUser(userId);
request.setCustomData(shareRequest.getReportId().getBytes());
request.setShareType(ShareInfoType.API_SHARE_REPORT.name());
request.setProjectId(shareRequest.getProjectId());
ShareInfo shareInfo = createShareInfo(request);
return conversionShareInfoToDTO(shareInfo);
}