fix(接口测试): 用例集合报告的修改

--user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001016248
This commit is contained in:
guoyuqi 2022-08-24 15:56:29 +08:00 committed by xiaomeinvG
parent 4c2655f0d1
commit d51e5f58c4
1 changed files with 8 additions and 3 deletions

View File

@ -19,7 +19,6 @@ import io.metersphere.commons.utils.LogUtil;
import io.metersphere.i18n.Translator; import io.metersphere.i18n.Translator;
import io.metersphere.service.ProjectApplicationService; import io.metersphere.service.ProjectApplicationService;
import io.metersphere.track.service.TestPlanApiCaseService; import io.metersphere.track.service.TestPlanApiCaseService;
import io.metersphere.track.service.TestPlanScenarioCaseService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.util.Strings; import org.apache.logging.log4j.util.Strings;
@ -49,8 +48,6 @@ public class ShareInfoService {
@Resource @Resource
TestPlanApiCaseService testPlanApiCaseService; TestPlanApiCaseService testPlanApiCaseService;
@Resource @Resource
TestPlanScenarioCaseService testPlanScenarioCaseService;
@Resource
TestPlanReportMapper testPlanReportMapper; TestPlanReportMapper testPlanReportMapper;
@Resource @Resource
private ProjectApplicationService projectApplicationService; private ProjectApplicationService projectApplicationService;
@ -64,6 +61,8 @@ public class ShareInfoService {
TestPlanMapper testPlanMapper; TestPlanMapper testPlanMapper;
@Resource @Resource
private ExtApiScenarioReportMapper extApiScenarioReportMapper; private ExtApiScenarioReportMapper extApiScenarioReportMapper;
@Resource
private ApiScenarioReportService apiScenarioReportService;
public List<ApiDocumentInfoDTO> findApiDocumentSimpleInfoByRequest(ApiDocumentRequest request) { public List<ApiDocumentInfoDTO> findApiDocumentSimpleInfoByRequest(ApiDocumentRequest request) {
@ -574,6 +573,12 @@ public class ShareInfoService {
APIScenarioReportResult reportResult = extApiScenarioReportMapper.get(shareInfo.getCustomData()); APIScenarioReportResult reportResult = extApiScenarioReportMapper.get(shareInfo.getCustomData());
if (reportResult != null) { if (reportResult != null) {
projectId = reportResult.getProjectId(); projectId = reportResult.getProjectId();
} else {
// case 集成报告
APIScenarioReportResult result = apiScenarioReportService.getApiIntegrated(shareInfo.getCustomData());
if (result != null) {
projectId = result.getProjectId();
}
} }
} }
if (StringUtils.isBlank(type) || Strings.isBlank(projectId)) { if (StringUtils.isBlank(type) || Strings.isBlank(projectId)) {