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 @@