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

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

View File

@ -19,8 +19,6 @@ import io.metersphere.commons.utils.*;
import io.metersphere.i18n.Translator; import io.metersphere.i18n.Translator;
import io.metersphere.service.ProjectApplicationService; import io.metersphere.service.ProjectApplicationService;
import io.metersphere.service.UserService; import io.metersphere.service.UserService;
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.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -50,10 +48,6 @@ public class ShareInfoService {
@Resource @Resource
ShareInfoMapper shareInfoMapper; ShareInfoMapper shareInfoMapper;
@Resource @Resource
TestPlanApiCaseService testPlanApiCaseService;
@Resource
TestPlanScenarioCaseService testPlanScenarioCaseService;
@Resource
TestPlanReportMapper testPlanReportMapper; TestPlanReportMapper testPlanReportMapper;
@Resource @Resource
private ProjectApplicationService projectApplicationService; private ProjectApplicationService projectApplicationService;
@ -67,9 +61,8 @@ public class ShareInfoService {
TestPlanMapper testPlanMapper; TestPlanMapper testPlanMapper;
@Resource @Resource
private ExtApiScenarioReportMapper extApiScenarioReportMapper; private ExtApiScenarioReportMapper extApiScenarioReportMapper;
@Resource @Resource
ApiDefinitionService apiDefinitionService; ApiScenarioReportService apiScenarioReportService;
@Resource @Resource
ApiModuleService apiModuleService; ApiModuleService apiModuleService;
@Resource @Resource
@ -646,6 +639,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)) {