From 9735eb9f1c4e3334aa02135664f334a950cc588e Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Wed, 20 Nov 2024 18:29:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E6=98=BE=E7=A4=BA=E5=8E=BB=E9=87=8D=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=BB=98=E8=AE=A4=E5=80=BC=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functional/mapper/ExtFunctionalCaseMapper.xml | 3 +-- .../dashboard/service/DashboardService.java | 10 +++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) 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();