diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.xml b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.xml index 0de7a830ec..28ccf01ed0 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.xml +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtFunctionalCaseMapper.xml @@ -918,8 +918,7 @@ count(distinct fct.case_id) from functional_case_test fct LEFT JOIN functional_case fc ON fc.id = fct.case_id - where fct.project_id = #{projectId} - and fc.project_id = #{projectId} + where fc.project_id = #{projectId} and fc.deleted = false AND fc.create_time BETWEEN #{startTime} AND #{endTime} diff --git a/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java b/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java index 463f3dda69..2aafe2ce79 100644 --- a/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java +++ b/backend/services/dashboard/src/main/java/io/metersphere/dashboard/service/DashboardService.java @@ -411,12 +411,13 @@ public class DashboardService { if (CollectionUtils.isNotEmpty(list)) { layoutDTO.setProjectIds(list.stream().map(Project::getId).toList()); } else { - layoutDTO.setProjectIds(allPermissionProjects.stream().map(Project::getId).toList()); + layoutDTO.setProjectIds(new ArrayList<>()); + layoutDTO.setSelectAll(true); } } } else if (StringUtils.equalsIgnoreCase(layoutDTO.getKey(), DashboardUserLayoutKeys.PROJECT_MEMBER_VIEW.toString())) { List list = orgProjectMemberList.stream().filter(t -> layoutDTO.getHandleUsers().contains(t.getId())).toList(); - layoutDTO.setHandleUsers(list.stream().map(ProjectUserMemberDTO::getId).toList()); + layoutDTO.setHandleUsers(list.stream().map(ProjectUserMemberDTO::getId).distinct().toList()); List projectList = allPermissionProjects.stream().filter(t -> layoutDTO.getProjectIds().contains(t.getId())).toList(); if (CollectionUtils.isEmpty(projectList)) { layoutDTO.setProjectIds(List.of(allPermissionProjects.getFirst().getId())); @@ -1248,7 +1249,10 @@ public class DashboardService { if (CollectionUtils.isNotEmpty(simpleAllApiScenarioList)) { simpleAllApiScenarioSize = simpleAllApiScenarioList.size(); } - List unExecList = simpleAllApiScenarioList.stream().filter(t -> StringUtils.equalsIgnoreCase(t.getLastReportStatus(), ExecStatus.PENDING.toString())).toList(); + List lastReportStatuList = new ArrayList<>(); + lastReportStatuList.add(StringUtils.EMPTY); + lastReportStatuList.add(ExecStatus.PENDING.toString()); + List unExecList = simpleAllApiScenarioList.stream().filter(t -> lastReportStatuList.contains(t.getLastReportStatus())).toList(); int unExecSize = CollectionUtils.isNotEmpty(unExecList) ? unExecList.size() : 0; List successList = simpleAllApiScenarioList.stream().filter(t -> StringUtils.equalsIgnoreCase(t.getLastReportStatus(), ResultStatus.SUCCESS.name())).toList();