From 91e6ce28674e919a87b03ea016d1735464c151a0 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 13 Dec 2024 11:32:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=BC=BA=E9=99=B7=E6=9C=AC=E5=9C=B0=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=8A=A0=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1050351 --user=郭雨琦 修复缺陷本地平台显示加过滤条件问题 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001050351 --- .../metersphere/bug/mapper/ExtBugMapper.java | 3 +++ .../metersphere/bug/mapper/ExtBugMapper.xml | 9 +++++++++ .../dashboard/service/DashboardService.java | 20 +++++++++++++------ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.java index 856573c8fd..38e2abd2ce 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.java @@ -139,4 +139,7 @@ public interface ExtBugMapper { ListgetSimpleList(@Param("projectId") String projectId, @Param("startTime") Long startTime, @Param("endTime") Long endTime,@Param("handleUsers") Set handleUsers,@Param("createUser") String createUser, @Param("platforms") Set platforms); ListgetByHandleUser(@Param("projectId") String projectId, @Param("startTime") Long startTime, @Param("endTime") Long endTime,@Param("localHandleUser") String localHandleUser,@Param("createUser") String createUser,@Param("thirdHandleUser") String thirdHandleUser, @Param("thirdPlatform") String thirdPlatform); + + long localBugCount(@Param("projectId") String projectId); + } diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.xml b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.xml index e7103e38ac..65f47288d9 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.xml +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/mapper/ExtBugMapper.xml @@ -517,5 +517,14 @@ ) + + 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 b39e0bd661..308022b813 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 @@ -1121,9 +1121,13 @@ public class DashboardService { @NotNull private List getStatusOption(String projectId, String platformName) { - List allLocalStatusOptions = bugStatusService.getAllLocalStatusOptions(projectId); - rebuildStatusName(BugPlatform.LOCAL.getName(), allLocalStatusOptions); - List headerStatusOption = new ArrayList<>(allLocalStatusOptions); + List headerStatusOption = new ArrayList<>(); + long localBugCount = extBugMapper.localBugCount(projectId); + if (localBugCount >0 || StringUtils.equals(platformName, BugPlatform.LOCAL.getName())) { + List allLocalStatusOptions = bugStatusService.getAllLocalStatusOptions(projectId); + rebuildStatusName(BugPlatform.LOCAL.getName(), allLocalStatusOptions); + headerStatusOption.addAll(allLocalStatusOptions); + } if (!StringUtils.equals(platformName, BugPlatform.LOCAL.getName())) { List thirdStatusOptions = bugStatusService.getHeaderStatusOption(projectId); rebuildStatusName(platformName, thirdStatusOptions); @@ -1795,9 +1799,13 @@ public class DashboardService { @NotNull private List getHeaderStatusOption(String projectId, String platformName, List endStatus) { - List allLocalStatusOptions = bugStatusService.getAllLocalStatusOptions(projectId); - rebuildStatusName(BugPlatform.LOCAL.getName(), allLocalStatusOptions); - List headerStatusOption = new ArrayList<>(allLocalStatusOptions); + List headerStatusOption = new ArrayList<>(); + long localBugCount = extBugMapper.localBugCount(projectId); + if (localBugCount >0 || StringUtils.equals(platformName, BugPlatform.LOCAL.getName())) { + List allLocalStatusOptions = bugStatusService.getAllLocalStatusOptions(projectId); + rebuildStatusName(BugPlatform.LOCAL.getName(), allLocalStatusOptions); + headerStatusOption.addAll(allLocalStatusOptions); + } if (!StringUtils.equals(platformName, BugPlatform.LOCAL.getName())) { List thirdStatusOptions = bugStatusService.getHeaderStatusOption(projectId); rebuildStatusName(platformName, thirdStatusOptions);