From bb85fa2c7b5048166ed9009e2a60e3842ba762e0 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Mon, 8 May 2023 16:26:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E7=9B=98=E6=8E=A5=E5=8F=A3Api=E5=8F=8ACase=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E7=BB=9F=E8=AE=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1025728 --user=宋昌昌 【工作台】我的仪表盘-我的待办-接口和接口用例统计和进入我的待办-各项目接口和接口用例总和不一致 https://www.tapd.cn/55049933/s/1369713 --- .../base/mapper/ext/ExtApiDefinitionMapper.xml | 1 - .../base/mapper/ext/ExtApiTestCaseMapper.xml | 6 +++--- .../workstation/service/WorkstationService.java | 15 +-------------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/workstation/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml b/workstation/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml index 04ef0aca32..cd940cd30f 100644 --- a/workstation/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml +++ b/workstation/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml @@ -552,7 +552,6 @@ and ad.status in ('Prepare', 'Underway') and ad.user_id = #{userId,jdbcType=VARCHAR} - and ad.latest = 1 diff --git a/workstation/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml b/workstation/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml index 73c3db66db..a4c8e7ef56 100644 --- a/workstation/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml +++ b/workstation/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml @@ -314,14 +314,14 @@ diff --git a/workstation/backend/src/main/java/io/metersphere/workstation/service/WorkstationService.java b/workstation/backend/src/main/java/io/metersphere/workstation/service/WorkstationService.java index 836d5b054b..aab1b12fbe 100644 --- a/workstation/backend/src/main/java/io/metersphere/workstation/service/WorkstationService.java +++ b/workstation/backend/src/main/java/io/metersphere/workstation/service/WorkstationService.java @@ -173,8 +173,6 @@ public class WorkstationService { int issueUpcomingCount = extIssuesMapper.getCountUpcoming(projectIds, userId); int apiUpcomingCount = extApiDefinitionMapper.getCountUpcoming(projectIds, userId); int apiCaseUpcomingCount = extApiTestCaseMapper.getCountUpcoming(projectIds, userId); - int updateApiCaseCount = getUpdateApiCaseCount(projectIds, userId); - int apiCaseCount = apiCaseUpcomingCount + updateApiCaseCount; int scenarioUpcomingCount = extApiScenarioMapper.getCountUpcoming(projectIds, userId); int loadUpcomingCount = extLoadTestMapper.getCountUpcoming(projectIds, userId); Map map = new HashMap<>(8); @@ -183,23 +181,12 @@ public class WorkstationService { map.put("track_review", reviewUpcomingCount); map.put("track_issue", issueUpcomingCount); map.put("api_definition", apiUpcomingCount); - map.put("api_case",apiCaseCount); + map.put("api_case",apiCaseUpcomingCount); map.put("api_automation", scenarioUpcomingCount); map.put("performance", loadUpcomingCount); return map; } - public int getUpdateApiCaseCount(List projectIds,String userId){ - int totalUpdateCount = 0; - for (String projectId : projectIds) { - List syncRuleCaseStatus = getSyncRuleCaseStatus(projectId); - Long toBeUpdatedTime = getToBeUpdatedTime(projectId); - int updateCount = extApiTestCaseMapper.getUpdateCount(userId, projectId, syncRuleCaseStatus, toBeUpdatedTime); - totalUpdateCount = totalUpdateCount+updateCount; - } - return totalUpdateCount; - } - public List getSyncRuleCaseStatus(String projectId) { List statusList = new ArrayList<>(); List projectApplicationConfigs = extProjectApplicationMapper.selectByProjectIdAndType(projectId,"TRIGGER_UPDATE");