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; + } }