fix(测试跟踪): 自动重新提审对已经有人评审但状态是评审中的用例不生效

--bug=1023006 --user=陈建星 【测试跟踪】用例评审-开启重新提审-多人评审,修改用例后状态没有变成重新提审 https://www.tapd.cn/55049933/s/1335271
This commit is contained in:
chenjianxing 2023-02-15 10:07:01 +08:00 committed by jianxing
parent 4fab6f7930
commit 7f467193e1
15 changed files with 60 additions and 40 deletions

View File

@ -12,5 +12,6 @@ public interface ExtTestCaseCommentMapper {
* @param caseId * @param caseId
* @return * @return
*/ */
List<TestCaseCommentDTO> getCaseComments(@Param("caseId") String caseId, @Param("type") String type, @Param("belongId") String belongId); List<TestCaseCommentDTO> getCaseComments(@Param("caseId") String caseId, @Param("type") String type,
@Param("belongId") String belongId, @Param("withStatus") boolean withStatus);
} }

View File

@ -12,6 +12,9 @@
<if test="belongId != null and belongId != ''"> <if test="belongId != null and belongId != ''">
and test_case_comment.belong_id = #{belongId} and test_case_comment.belong_id = #{belongId}
</if> </if>
<if test="withStatus">
and test_case_comment.status is not null
</if>
order by test_case_comment.create_time desc order by test_case_comment.create_time desc
</select> </select>
</mapper> </mapper>

View File

@ -23,6 +23,6 @@
<select id="selectForReReview" resultType="io.metersphere.base.domain.TestCaseReviewTestCase"> <select id="selectForReReview" resultType="io.metersphere.base.domain.TestCaseReviewTestCase">
select id, case_id, status, review_id select id, case_id, status, review_id
from test_case_review_test_case from test_case_review_test_case
where case_id = #{caseId} and (status = 'Pass' or status = 'UnPass'); where case_id = #{caseId} and (status = 'Pass' or status = 'UnPass' or status = 'Underway');
</select> </select>
</mapper> </mapper>

View File

@ -85,7 +85,7 @@ public class TestCaseCommentService {
} }
public List<TestCaseCommentDTO> getCaseComments(String caseId, String type) { public List<TestCaseCommentDTO> 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<TestCaseCommentDTO> getCaseComments(String caseId, String type, String belongId) { public List<TestCaseCommentDTO> getCaseComments(String caseId, String type, String belongId) {
return filterMarkComments(extTestCaseCommentMapper.getCaseComments(caseId, type, belongId)); return filterMarkComments(extTestCaseCommentMapper.getCaseComments(caseId, type, belongId, false));
}
public List<TestCaseCommentDTO> getStatusCaseComments(String caseId, String type, String belongId) {
return filterMarkComments(extTestCaseCommentMapper.getCaseComments(caseId, type, belongId, true));
} }
public List<TestCaseCommentDTO> getCaseComments(String caseId) { public List<TestCaseCommentDTO> getCaseComments(String caseId) {

View File

@ -205,7 +205,7 @@ public class TestReviewTestCaseService {
public String updateReviewCaseStatusForEdit(TestCaseReviewTestCaseEditRequest testCaseReviewTestCase, String reviewPassRule) { public String updateReviewCaseStatusForEdit(TestCaseReviewTestCaseEditRequest testCaseReviewTestCase, String reviewPassRule) {
List<TestCaseCommentDTO> comments = List<TestCaseCommentDTO> comments =
testCaseCommentService.getCaseComments(testCaseReviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), testCaseReviewTestCase.getReviewId()); testCaseCommentService.getStatusCaseComments(testCaseReviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), testCaseReviewTestCase.getReviewId());
comments = filterAgainComments(comments); comments = filterAgainComments(comments);
@ -228,7 +228,7 @@ public class TestReviewTestCaseService {
TestCaseReviewTestCase testCaseReviewTestCase = testCaseReviewTestCaseMapper.selectByPrimaryKey(id); TestCaseReviewTestCase testCaseReviewTestCase = testCaseReviewTestCaseMapper.selectByPrimaryKey(id);
List<TestCaseCommentDTO> comments = List<TestCaseCommentDTO> 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()) String reviewPassRule = testCaseReviewService.getTestReview(testCaseReviewTestCase.getReviewId())
.getReviewPassRule(); .getReviewPassRule();
@ -675,7 +675,7 @@ public class TestReviewTestCaseService {
public void updateReviewCaseStatusForRuleChange(String originPassRule, TestCaseReviewTestCase reviewTestCase, String reviewPassRule) { public void updateReviewCaseStatusForRuleChange(String originPassRule, TestCaseReviewTestCase reviewTestCase, String reviewPassRule) {
List<TestCaseCommentDTO> comments = List<TestCaseCommentDTO> comments =
testCaseCommentService.getCaseComments(reviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), reviewTestCase.getReviewId()); testCaseCommentService.getStatusCaseComments(reviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), reviewTestCase.getReviewId());
comments = filterAgainComments(comments); comments = filterAgainComments(comments);
@ -702,7 +702,7 @@ public class TestReviewTestCaseService {
*/ */
public void reCalcReviewCaseStatus(String reviewPassRule, TestCaseReviewTestCase reviewTestCase) { public void reCalcReviewCaseStatus(String reviewPassRule, TestCaseReviewTestCase reviewTestCase) {
List<TestCaseCommentDTO> comments = List<TestCaseCommentDTO> comments =
testCaseCommentService.getCaseComments(reviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), reviewTestCase.getReviewId()); testCaseCommentService.getStatusCaseComments(reviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), reviewTestCase.getReviewId());
comments = filterAgainComments(comments); comments = filterAgainComments(comments);
@ -720,13 +720,20 @@ public class TestReviewTestCaseService {
public void reReviewByCaseId(String caseId) { public void reReviewByCaseId(String caseId) {
List<TestCaseReviewTestCase> reviewTestCases = extTestCaseReviewTestCaseMapper.selectForReReview(caseId); List<TestCaseReviewTestCase> reviewTestCases = extTestCaseReviewTestCaseMapper.selectForReReview(caseId);
for (TestCaseReviewTestCase reviewTestCase : reviewTestCases) { for (TestCaseReviewTestCase reviewTestCase : reviewTestCases) {
updateTestReviewTestCaseStatus(reviewTestCase, TestCaseReviewCommentStatus.Again.name()); List<TestCaseCommentDTO> comments =
// 添加一条重新提审的评论 testCaseCommentService.getStatusCaseComments(reviewTestCase.getCaseId(), TestCaseCommentType.REVIEW.name(), reviewTestCase.getReviewId());
TestCaseReviewTestCaseEditRequest addCommentRequest = new TestCaseReviewTestCaseEditRequest();
BeanUtils.copyBean(addCommentRequest, reviewTestCase); comments = filterAgainComments(comments);
addCommentRequest.setStatus(TestCaseReviewCommentStatus.Again.name());
addCommentRequest.setComment(StringUtils.EMPTY); if (CollectionUtils.isNotEmpty(comments)) {
testCaseCommentService.saveReviewCommentWithoutNotification(addCommentRequest); 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);
}
} }
} }
} }

View File

@ -1400,6 +1400,9 @@ export default {
this.currentVersionName = this.findVersionNameByID(this.form.versionId) this.currentVersionName = this.findVersionNameByID(this.form.versionId)
}, },
async getVersionOptionList() { async getVersionOptionList() {
if (!hasLicense()) {
return;
}
let res = await getProjectVersions(getCurrentProjectID()); let res = await getProjectVersions(getCurrentProjectID());
this.versionOptions = res.data ?? []; this.versionOptions = res.data ?? [];
}, },

View File

@ -4,7 +4,7 @@
<div class="case-main-layout-left" style="float: left; display: inline-block"> <div class="case-main-layout-left" style="float: left; display: inline-block">
<!-- 表头统计内容 --> <!-- 表头统计内容 -->
<ms-table-count-bar :count-content="$t('table.all_case_content') + ' (' + page.total + ')'"></ms-table-count-bar> <ms-table-count-bar :count-content="$t('case.all_case_content') + ' (' + page.total + ')'"></ms-table-count-bar>
</div> </div>
<div class="case-main-layout-right" style="float: right; display: flex"> <div class="case-main-layout-right" style="float: right; display: flex">

View File

@ -2,7 +2,7 @@
<div class="case-main-layout"> <div class="case-main-layout">
<div class="case-main-layout-left" style="float: left; display: inline-block"> <div class="case-main-layout-left" style="float: left; display: inline-block">
<ms-table-count-bar :count-content="$t('table.all_case_content') + ' (' + page.total + ')'"></ms-table-count-bar> <ms-table-count-bar :count-content="$t('case.all_case_content') + ' (' + page.total + ')'"></ms-table-count-bar>
</div> </div>
<div class="case-main-layout-right" style="float: right; display: flex"> <div class="case-main-layout-right" style="float: right; display: flex">

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div class="case-main-layout-left" style="display: inline-block"> <div class="case-main-layout-left" style="display: inline-block">
<ms-table-count-bar :count-content="$t('table.all_case_content') + '(' + caseNum + ')'"></ms-table-count-bar> <ms-table-count-bar :count-content="$t('case.all_case_content') + '(' + caseNum + ')'"></ms-table-count-bar>
</div> </div>
<div class="case-main-layout-right" style="float: right; display: flex"> <div class="case-main-layout-right" style="float: right; display: flex">

View File

@ -2,7 +2,7 @@
<ms-table-column <ms-table-column
:prop="prop" :prop="prop"
:field="field" :field="field"
:filters="reviewStatusFilters" :filters="filters"
:min-width="minWidth" :min-width="minWidth"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
:label="$t('test_track.case.status')"> :label="$t('test_track.case.status')">
@ -34,16 +34,17 @@ export default {
type: Object, type: Object,
default: null default: null
}, },
}, filters: {
data() { type: Array,
return { default() {
reviewStatusFilters: [ return [
{text: this.$t('test_track.review.prepare'), value: 'Prepare'}, {text: this.$t('test_track.review.prepare'), value: 'Prepare'},
{text: this.$t('test_track.review.again'), value: 'Again'}, {text: this.$t('test_track.review.again'), value: 'Again'},
{text: this.$t('test_track.review.pass'), value: 'Pass'}, {text: this.$t('test_track.review.pass'), value: 'Pass'},
{text: this.$t('test_track.review.un_pass'), value: 'UnPass'}, {text: this.$t('test_track.review.un_pass'), value: 'UnPass'},
{text: this.$t('test_track.review.underway'), value: 'Underway'}, {text: this.$t('test_track.review.underway'), value: 'Underway'},
] ]
}
} }
} }
} }

View File

@ -203,11 +203,11 @@ export default {
<style scoped> <style scoped>
:deep(.ms-main-container) { :deep(.ms-main-container) {
height: calc(100vh - 80px - 53px); height: calc(100vh - 93px);
} }
:deep(.ms-aside-container ){ :deep(.ms-aside-container ){
height: calc(100vh - 80px - 53px) !important; height: calc(100vh - 93px) !important;
margin-top: 1px; margin-top: 1px;
} }

View File

@ -123,6 +123,7 @@
min-width="120px"/> min-width="120px"/>
<test-case-review-status-table-item <test-case-review-status-table-item
:filters="statusFilters"
:field="item" :field="item"
:fields-width="fieldsWidth"/> :fields-width="fieldsWidth"/>
@ -259,6 +260,12 @@ export default {
{text: 'P2', value: 'P2'}, {text: 'P2', value: 'P2'},
{text: 'P3', value: 'P3'} {text: 'P3', value: 'P3'}
], ],
statusFilters: [
{text: this.$t('test_track.review.again'), value: 'Again'},
{text: this.$t('test_track.review.pass'), value: 'Pass'},
{text: this.$t('test_track.review.un_pass'), value: 'UnPass'},
{text: this.$t('test_track.review.underway'), value: 'Underway'},
],
methodFilters: [ methodFilters: [
{text: this.$t('test_track.case.manual'), value: 'manual'}, {text: this.$t('test_track.case.manual'), value: 'manual'},
{text: this.$t('test_track.case.auto'), value: 'auto'} {text: this.$t('test_track.case.auto'), value: 'auto'}

View File

@ -65,9 +65,6 @@ const message = {
plan: { plan: {
batch_delete_tip: "Do you want to continue deleting the test plan?", batch_delete_tip: "Do you want to continue deleting the test plan?",
}, },
table: {
all_case_content: "All case"
},
review: { review: {
result_distribution: "Result Distribution", result_distribution: "Result Distribution",
review_pass_rule: 'Review Pass Criteria', review_pass_rule: 'Review Pass Criteria',
@ -84,6 +81,7 @@ const message = {
pass_review_confirm: "Are you sure to pass this review", pass_review_confirm: "Are you sure to pass this review",
}, },
case: { case: {
all_case_content: "All case",
use_case_detail: "Use Case Details", use_case_detail: "Use Case Details",
associate_test_cases: "Associate Test Cases", associate_test_cases: "Associate Test Cases",
dependencies: "Dependence", dependencies: "Dependence",

View File

@ -65,9 +65,6 @@ const message = {
plan: { plan: {
batch_delete_tip: "批量删除测试计划,是否继续?", batch_delete_tip: "批量删除测试计划,是否继续?",
}, },
table: {
all_case_content: "全部用例",
},
review: { review: {
result_distribution: "结果分布", result_distribution: "结果分布",
review_pass_rule: "评审通过标准", review_pass_rule: "评审通过标准",
@ -84,6 +81,7 @@ const message = {
pass_review_confirm: "确定通过此评审吗", pass_review_confirm: "确定通过此评审吗",
}, },
case: { case: {
all_case_content: "全部用例",
use_case_detail: "用例详情", use_case_detail: "用例详情",
associate_test_cases: "关联测试用例", associate_test_cases: "关联测试用例",
dependencies: "依赖关系", dependencies: "依赖关系",

View File

@ -65,9 +65,6 @@ const message = {
plan: { plan: {
batch_delete_tip: "批量刪除測試計劃,是否繼續?", batch_delete_tip: "批量刪除測試計劃,是否繼續?",
}, },
table: {
all_case_content: "全部用例"
},
review: { review: {
result_distribution: "結果分布", result_distribution: "結果分布",
review_pass_rule: '評審通過標準', review_pass_rule: '評審通過標準',
@ -84,6 +81,7 @@ const message = {
pass_review_confirm: "確定通過此評審嗎", pass_review_confirm: "確定通過此評審嗎",
}, },
case: { case: {
all_case_content: "全部用例",
use_case_detail: "用例詳情", use_case_detail: "用例詳情",
associate_test_cases: "關聯測試用例", associate_test_cases: "關聯測試用例",
dependencies: "依賴關繫", dependencies: "依賴關繫",