diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml index b5c88a2d05..3c6d72c494 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml @@ -368,10 +368,7 @@ SELECT count(id) AS countNumber FROM scenario_execution_info WHERE trigger_mode = 'SCHEDULE' - AND source_id IN (SELECT id - FROM api_scenario - WHERE project_id = #{projectId} - AND latest = 1) + AND project_id = #{projectId} AND version = #{version} @@ -382,10 +379,7 @@ SELECT count(id) AS countNumber, result AS groupField FROM scenario_execution_info WHERE trigger_mode = 'SCHEDULE' - AND source_id IN (SELECT id - FROM api_scenario - WHERE project_id = #{projectId} - AND latest = 1) + AND project_id = #{projectId} AND version = #{version} diff --git a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionExecResultService.java b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionExecResultService.java index 34f55c7e00..f717df81cb 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionExecResultService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionExecResultService.java @@ -303,13 +303,12 @@ public class ApiDefinitionExecResultService { if (StringUtils.equalsAny(dto.getRunMode(), ApiRunMode.SCHEDULE_API_PLAN.name(), ApiRunMode.JENKINS_API_PLAN.name())) { TestPlanApiCase apiCase = testPlanApiCaseMapper.selectByPrimaryKey(dto.getTestId()); if (apiCase != null) { - TestPlan testPlan = testPlanService.get(apiCase.getTestPlanId()); - if (testPlan != null) { + if (MapUtils.isNotEmpty(dto.getExtendedParameters()) && dto.getExtendedParameters().containsKey("projectId")) { + String projectId = dto.getExtendedParameters().get("projectId").toString(); ApiDefinition apiDefinition = extApiTestCaseMapper.selectApiBasicInfoByCaseId(apiCase.getId()); String version = apiDefinition == null ? "" : apiDefinition.getVersionId(); - apiCaseExecutionInfoService.insertExecutionInfo(apiCase.getId(), status, triggerMode, testPlan.getProjectId(), ExecutionExecuteTypeEnum.TEST_PLAN.name(), version); + apiCaseExecutionInfoService.insertExecutionInfo(apiCase.getId(), status, triggerMode, projectId, ExecutionExecuteTypeEnum.TEST_PLAN.name(), version); } - apiCase.setStatus(status); apiCase.setUpdateTime(System.currentTimeMillis()); testPlanApiCaseMapper.updateByPrimaryKeySelective(apiCase); diff --git a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioService.java b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioService.java index c98238a9d1..773cce7f95 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/scenario/ApiScenarioService.java @@ -1768,26 +1768,14 @@ public class ApiScenarioService { public List getApiIdInScenario(String projectId, Map> scenarioUrlMap, List apiList) { List apiIdList = new ArrayList<>(); if (MapUtils.isNotEmpty(scenarioUrlMap) && CollectionUtils.isNotEmpty(apiList)) { - ProjectApplication urlRepeatableConfig = baseProjectApplicationService.getProjectApplication(projectId, ProjectApplicationType.URL_REPEATABLE.name()); - boolean isUrlRepeatable = BooleanUtils.toBoolean(urlRepeatableConfig.getTypeValue()); for (ApiDefinition model : apiList) { if (StringUtils.equalsIgnoreCase(model.getProtocol(), "http")) { Map stepIdAndUrlMap = scenarioUrlMap.get(model.getMethod()); if (stepIdAndUrlMap != null) { - if (isUrlRepeatable) { - String url = stepIdAndUrlMap.get(model.getId()); - if (StringUtils.isNotEmpty(url)) { - boolean urlMatched = MockApiUtils.isUrlMatch(model.getPath(), url); - if (urlMatched) { - apiIdList.add(model.getId()); - } - } - } else { - Collection scenarioUrlList = scenarioUrlMap.get(model.getMethod()).values(); - boolean matchedUrl = MockApiUtils.isUrlInList(model.getPath(), scenarioUrlList); - if (matchedUrl) { - apiIdList.add(model.getId()); - } + Collection scenarioUrlList = scenarioUrlMap.get(model.getMethod()).values(); + boolean matchedUrl = MockApiUtils.isUrlInList(model.getPath(), scenarioUrlList); + if (matchedUrl) { + apiIdList.add(model.getId()); } } } else { @@ -2194,7 +2182,7 @@ public class ApiScenarioService { if (returnMap.containsKey(method)) { returnMap.get(method).put(item.getReferenceId(), item.getUrl()); } else { - Map urlMap = new HashMap() {{ + Map urlMap = new HashMap<>() {{ this.put(item.getReferenceId(), item.getUrl()); }}; returnMap.put(method, urlMap); diff --git a/api-test/frontend/src/business/home/ApiHome.vue b/api-test/frontend/src/business/home/ApiHome.vue index 46976385ea..cacc5530bd 100644 --- a/api-test/frontend/src/business/home/ApiHome.vue +++ b/api-test/frontend/src/business/home/ApiHome.vue @@ -139,15 +139,15 @@ export default { } .api-home-layout :deep(.dashboard-card) { - height: 392px; + height: 408px; } .api-home-layout :deep(.main-info) { - height: 197px; + height: 208px; } .api-home-layout :deep(.main-info-card) { - height: 197px; + height: 208px; width: 100%; color: #646A73; background-color: #FFFFFF; diff --git a/api-test/frontend/src/business/home/components/chart/CountChart.vue b/api-test/frontend/src/business/home/components/chart/CountChart.vue index 5696eb7d9c..8a8de276ef 100644 --- a/api-test/frontend/src/business/home/components/chart/CountChart.vue +++ b/api-test/frontend/src/business/home/components/chart/CountChart.vue @@ -1,9 +1,9 @@