From 6857cb8c7105ed2dee04b69098a224698dc65556 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 22 Jun 2022 14:58:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA=E9=A6=96=E9=A1=B5=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E8=AF=84=E5=AE=A1=E6=95=B0=E9=87=8F=E5=80=BC=E6=9C=89?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1014279 --user=宋昌昌 【测试跟踪】首页用例评审用例状态多次修改后,数量显示不正确 https://www.tapd.cn/55049933/s/1188537 --- .../base/mapper/ext/ExtTestReviewCaseMapper.xml | 2 +- .../track/service/TestReviewTestCaseService.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml index f8daab3bbd..482bb34753 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReviewCaseMapper.xml @@ -100,7 +100,7 @@ test_case_review_test_case.update_time, test_case_review_test_case.review_id as reviewId, test_case.id as caseId, test_case.name, test_case.priority, test_case.test_id as testId, test_case.type, test_case.node_path, test_case.method, if(pa.type_value = 'false', cast(test_case.num as char), - test_case.custom_num) as customNum, test_case.review_status, + test_case.custom_num) as customNum, test_case_review_test_case.status reviewStatus, test_case.remark as remark, test_case.maintainer, test_case.steps as steps, test_case.node_id as nodeId, test_case_node.name as model, project.name as projectName, diff --git a/backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java index 309d1f3177..d84afddd42 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestReviewTestCaseService.java @@ -221,13 +221,18 @@ public class TestReviewTestCaseService { checkReviewCase(request.getReviewId()); } - // 更新状态 + // 更新状态{TestCase, TestCaseReviewTestCase} if (StringUtils.isNotBlank(request.getStatus())) { TestCaseExample example = new TestCaseExample(); example.createCriteria().andIdIn(ids); TestCaseWithBLOBs testCase = new TestCaseWithBLOBs(); testCase.setReviewStatus(request.getStatus()); testCaseMapper.updateByExampleSelective(testCase, example); + TestCaseReviewTestCaseExample caseReviewTestCaseExample = new TestCaseReviewTestCaseExample(); + caseReviewTestCaseExample.createCriteria().andReviewIdEqualTo(request.getReviewId()).andCaseIdIn(ids); + TestCaseReviewTestCase testCaseReviewTestCase = new TestCaseReviewTestCase(); + testCaseReviewTestCase.setStatus(request.getStatus()); + testCaseReviewTestCaseMapper.updateByExampleSelective(testCaseReviewTestCase, caseReviewTestCaseExample); } }