From 22c5bb9125f47181ac6cf04f454b0570855456ff Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Thu, 5 Sep 2024 10:51:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E8=AF=AF=E6=8A=A5=E8=A7=84=E5=88=99=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=90=AF=E7=94=A8=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/controller/ProjectApplicationController.java | 2 ++ .../project/service/ProjectApplicationService.java | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectApplicationController.java b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectApplicationController.java index 1ce7d4c5f2..23bc1d84f0 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectApplicationController.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/controller/ProjectApplicationController.java @@ -82,6 +82,8 @@ public class ProjectApplicationController { Map configMap = projectApplicationService.get(request, types); int errorNum = projectApplicationService.getFakeErrorList(request.getProjectId()); configMap.put("FAKE_ERROR_NUM", errorNum); + int enableErrorNum = projectApplicationService.getEnableFakeErrorList(request.getProjectId()); + configMap.put("ENABLE_FAKE_ERROR_NUM", enableErrorNum); return configMap; } diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectApplicationService.java b/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectApplicationService.java index d67e7c351b..33b90150f6 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectApplicationService.java +++ b/backend/services/project-management/src/main/java/io/metersphere/project/service/ProjectApplicationService.java @@ -715,4 +715,11 @@ public class ProjectApplicationService { } return plugin.getName(); } + + public int getEnableFakeErrorList(String projectId) { + FakeErrorExample example = new FakeErrorExample(); + example.createCriteria().andProjectIdEqualTo(projectId).andEnableEqualTo(true); + long l = fakeErrorMapper.countByExample(example); + return (int) l; + } }