From 7f467193e1bfc60255e0317af0137feb067ed726 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 15 Feb 2023 10:07:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E9=87=8D=E6=96=B0=E6=8F=90=E5=AE=A1=E5=AF=B9?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E6=9C=89=E4=BA=BA=E8=AF=84=E5=AE=A1=E4=BD=86?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=98=AF=E8=AF=84=E5=AE=A1=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1023006 --user=陈建星 【测试跟踪】用例评审-开启重新提审-多人评审,修改用例后状态没有变成重新提审 https://www.tapd.cn/55049933/s/1335271 --- .../mapper/ext/ExtTestCaseCommentMapper.java | 3 +- .../mapper/ext/ExtTestCaseCommentMapper.xml | 3 ++ .../ext/ExtTestCaseReviewTestCaseMapper.xml | 2 +- .../service/TestCaseCommentService.java | 8 +++-- .../service/TestReviewTestCaseService.java | 29 ++++++++++++------- .../business/case/components/TestCaseEdit.vue | 3 ++ .../business/case/components/TestCaseList.vue | 2 +- .../components/public/PublicTestCaseList.vue | 2 +- .../business/common/minder/TestCaseMinder.vue | 2 +- .../TestCaseReviewStatusTableItem.vue | 23 ++++++++------- .../review/view/TestCaseReviewView.vue | 4 +-- .../components/TestReviewTestCaseList.vue | 7 +++++ test-track/frontend/src/i18n/lang/en-US.js | 4 +-- test-track/frontend/src/i18n/lang/zh-CN.js | 4 +-- test-track/frontend/src/i18n/lang/zh-TW.js | 4 +-- 15 files changed, 60 insertions(+), 40 deletions(-) diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseCommentMapper.java b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseCommentMapper.java index 78d301c579..b133e95ff1 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseCommentMapper.java +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseCommentMapper.java @@ -12,5 +12,6 @@ public interface ExtTestCaseCommentMapper { * @param caseId * @return */ - List getCaseComments(@Param("caseId") String caseId, @Param("type") String type, @Param("belongId") String belongId); + List getCaseComments(@Param("caseId") String caseId, @Param("type") String type, + @Param("belongId") String belongId, @Param("withStatus") boolean withStatus); } diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseCommentMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseCommentMapper.xml index ed5abba958..55756a4801 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseCommentMapper.xml +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseCommentMapper.xml @@ -12,6 +12,9 @@ and test_case_comment.belong_id = #{belongId} + + and test_case_comment.status is not null + order by test_case_comment.create_time desc diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewTestCaseMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewTestCaseMapper.xml index 3ee518c277..b2fe0ed791 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewTestCaseMapper.xml +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestCaseReviewTestCaseMapper.xml @@ -23,6 +23,6 @@ diff --git a/test-track/backend/src/main/java/io/metersphere/service/TestCaseCommentService.java b/test-track/backend/src/main/java/io/metersphere/service/TestCaseCommentService.java index 422dd34633..de063a6db7 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/TestCaseCommentService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/TestCaseCommentService.java @@ -85,7 +85,7 @@ public class TestCaseCommentService { } public List getCaseComments(String caseId, String type) { - return filterMarkComments(extTestCaseCommentMapper.getCaseComments(caseId, type, null)); + return filterMarkComments(extTestCaseCommentMapper.getCaseComments(caseId, type, null, false)); } /** @@ -100,7 +100,11 @@ public class TestCaseCommentService { } public List getCaseComments(String caseId, String type, String belongId) { - return filterMarkComments(extTestCaseCommentMapper.getCaseComments(caseId, type, belongId)); + return filterMarkComments(extTestCaseCommentMapper.getCaseComments(caseId, type, belongId, false)); + } + + public List getStatusCaseComments(String caseId, String type, String belongId) { + return filterMarkComments(extTestCaseCommentMapper.getCaseComments(caseId, type, belongId, true)); } public List getCaseComments(String caseId) { diff --git a/test-track/backend/src/main/java/io/metersphere/service/TestReviewTestCaseService.java b/test-track/backend/src/main/java/io/metersphere/service/TestReviewTestCaseService.java index 65eba50579..783cd7f496 100644 --- a/test-track/backend/src/main/java/io/metersphere/service/TestReviewTestCaseService.java +++ b/test-track/backend/src/main/java/io/metersphere/service/TestReviewTestCaseService.java @@ -205,7 +205,7 @@ public class TestReviewTestCaseService { public String updateReviewCaseStatusForEdit(TestCaseReviewTestCaseEditRequest testCaseReviewTestCase, String reviewPassRule) { List comments = - testCaseCommentService.getCaseComments(testCaseReviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), testCaseReviewTestCase.getReviewId()); + testCaseCommentService.getStatusCaseComments(testCaseReviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), testCaseReviewTestCase.getReviewId()); comments = filterAgainComments(comments); @@ -228,7 +228,7 @@ public class TestReviewTestCaseService { TestCaseReviewTestCase testCaseReviewTestCase = testCaseReviewTestCaseMapper.selectByPrimaryKey(id); List comments = - testCaseCommentService.getCaseComments(testCaseReviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), testCaseReviewTestCase.getReviewId()); + testCaseCommentService.getStatusCaseComments(testCaseReviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), testCaseReviewTestCase.getReviewId()); String reviewPassRule = testCaseReviewService.getTestReview(testCaseReviewTestCase.getReviewId()) .getReviewPassRule(); @@ -675,7 +675,7 @@ public class TestReviewTestCaseService { public void updateReviewCaseStatusForRuleChange(String originPassRule, TestCaseReviewTestCase reviewTestCase, String reviewPassRule) { List comments = - testCaseCommentService.getCaseComments(reviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), reviewTestCase.getReviewId()); + testCaseCommentService.getStatusCaseComments(reviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), reviewTestCase.getReviewId()); comments = filterAgainComments(comments); @@ -702,7 +702,7 @@ public class TestReviewTestCaseService { */ public void reCalcReviewCaseStatus(String reviewPassRule, TestCaseReviewTestCase reviewTestCase) { List comments = - testCaseCommentService.getCaseComments(reviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), reviewTestCase.getReviewId()); + testCaseCommentService.getStatusCaseComments(reviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), reviewTestCase.getReviewId()); comments = filterAgainComments(comments); @@ -720,13 +720,20 @@ public class TestReviewTestCaseService { public void reReviewByCaseId(String caseId) { List reviewTestCases = extTestCaseReviewTestCaseMapper.selectForReReview(caseId); for (TestCaseReviewTestCase reviewTestCase : reviewTestCases) { - updateTestReviewTestCaseStatus(reviewTestCase, TestCaseReviewCommentStatus.Again.name()); - // 添加一条重新提审的评论 - TestCaseReviewTestCaseEditRequest addCommentRequest = new TestCaseReviewTestCaseEditRequest(); - BeanUtils.copyBean(addCommentRequest, reviewTestCase); - addCommentRequest.setStatus(TestCaseReviewCommentStatus.Again.name()); - addCommentRequest.setComment(StringUtils.EMPTY); - testCaseCommentService.saveReviewCommentWithoutNotification(addCommentRequest); + List comments = + testCaseCommentService.getStatusCaseComments(reviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), reviewTestCase.getReviewId()); + + comments = filterAgainComments(comments); + + if (CollectionUtils.isNotEmpty(comments)) { + updateTestReviewTestCaseStatus(reviewTestCase, TestCaseReviewCommentStatus.Again.name()); + // 添加一条重新提审的评论 + TestCaseReviewTestCaseEditRequest addCommentRequest = new TestCaseReviewTestCaseEditRequest(); + BeanUtils.copyBean(addCommentRequest, reviewTestCase); + addCommentRequest.setStatus(TestCaseReviewCommentStatus.Again.name()); + addCommentRequest.setComment(StringUtils.EMPTY); + testCaseCommentService.saveReviewCommentWithoutNotification(addCommentRequest); + } } } } diff --git a/test-track/frontend/src/business/case/components/TestCaseEdit.vue b/test-track/frontend/src/business/case/components/TestCaseEdit.vue index 8dfea54a7e..f9369fd1c8 100644 --- a/test-track/frontend/src/business/case/components/TestCaseEdit.vue +++ b/test-track/frontend/src/business/case/components/TestCaseEdit.vue @@ -1400,6 +1400,9 @@ export default { this.currentVersionName = this.findVersionNameByID(this.form.versionId) }, async getVersionOptionList() { + if (!hasLicense()) { + return; + } let res = await getProjectVersions(getCurrentProjectID()); this.versionOptions = res.data ?? []; }, diff --git a/test-track/frontend/src/business/case/components/TestCaseList.vue b/test-track/frontend/src/business/case/components/TestCaseList.vue index 0263491342..0a6600a6dd 100644 --- a/test-track/frontend/src/business/case/components/TestCaseList.vue +++ b/test-track/frontend/src/business/case/components/TestCaseList.vue @@ -4,7 +4,7 @@
- +
diff --git a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue index 0a60ff04d1..7817c0d033 100644 --- a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue +++ b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue @@ -2,7 +2,7 @@
- +
diff --git a/test-track/frontend/src/business/common/minder/TestCaseMinder.vue b/test-track/frontend/src/business/common/minder/TestCaseMinder.vue index 60ed14e1e5..ea76238257 100644 --- a/test-track/frontend/src/business/common/minder/TestCaseMinder.vue +++ b/test-track/frontend/src/business/common/minder/TestCaseMinder.vue @@ -1,7 +1,7 @@