From 586304c90b46121cca977660911b7f7cb313affc Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 26 Oct 2021 16:18:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=88=91=E7=9A=84=E5=BE=85=E5=8A=9E?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=20=E6=88=91=E5=88=9B=E5=BB=BA=E7=9A=84?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E6=88=91=E5=88=9B=E5=BB=BA=E7=9A=84=E7=BC=BA=E9=99=B7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用例审核查询 接口负责人查询 接口自动化查询 --- .../metersphere/api/service/ApiDefinitionService.java | 4 ++++ .../base/mapper/ext/ExtApiDefinitionMapper.xml | 2 +- .../base/mapper/ext/ExtApiScenarioMapper.xml | 3 +++ .../base/mapper/ext/ExtApiTestCaseMapper.xml | 2 +- .../base/mapper/ext/ExtTestCaseReviewMapper.xml | 3 +++ .../metersphere/base/mapper/ext/ExtTestPlanMapper.xml | 10 ++++++++++ .../track/request/testcase/QueryTestPlanRequest.java | 3 +++ .../request/testreview/QueryCaseReviewRequest.java | 2 ++ .../track/service/TestCaseReviewService.java | 4 ++++ 9 files changed, 31 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index e46a1c2383..a4400e008b 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -239,6 +239,10 @@ public class ApiDefinitionService { } } } + //update userId + if(request.getUserId().equals("currentUserId")){ + request.setUserId(SessionUtils.getUserId()); + } return request; } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml index 3f5f849476..14c47d2abb 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiDefinitionMapper.xml @@ -162,7 +162,7 @@ - and api_definition.user_id + and api_definition.create_user diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml index 0cb8acc730..08188d2150 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioMapper.xml @@ -275,6 +275,9 @@ + + and (api_scenario.status is null or api_scenario.status != 'Trash') + and api_scenario.last_result IS NULL diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml index b805e5d44b..10dd69c9bb 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml @@ -397,7 +397,7 @@ and (t1.status is null or t1.status != 'Trash') - and (t1.update_time >= 'request.updateTime' or t2.status = 'error') + and (t1.update_time >= #{request.updateTime} or t2.status = 'error') GROUP BY t1.id, t1.project_id, diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml index 4f68d87f1b..c69bcfbba5 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewMapper.xml @@ -50,6 +50,9 @@ and test_case_review.name like CONCAT('%', #{request.name},'%') + + and test_case_review.id in (select test_case_review_users.review_id from test_case_review_users where test_case_review_users.user_id = #{request.reviewerId}) + and test_case_review.project_id = #{request.projectId} diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml index 3a696bf3d9..bc2bff3b90 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanMapper.xml @@ -119,6 +119,10 @@ from test_plan LEFT JOIN schedule ON schedule.resource_id = test_plan.id JOIN project on project.id = test_plan.project_id + + JOIN test_plan_principal ON test_plan_principal.test_plan_id = test_plan.id + JOIN test_plan_test_case on test_plan_test_case.plan_id = test_plan.id + @@ -159,13 +163,19 @@ + + AND ( test_plan.creator = '${@io.metersphere.commons.utils.SessionUtils@getUserId()}' or test_plan_principal.principal_id = '${@io.metersphere.commons.utils.SessionUtils@getUserId()}' or test_plan_test_case.executor = '${@io.metersphere.commons.utils.SessionUtils@getUserId()}') + + order by test_plan.${order.name} ${order.type} + +