refactor(测试跟踪): 脑图评审用例优化

--story=1011376 --user=陈建星 脑图评审 https://www.tapd.cn/55049933/s/1347836
This commit is contained in:
chenjianxing 2023-03-10 17:20:09 +08:00 committed by jianxing
parent 88088536b0
commit fa5c23e512
2 changed files with 32 additions and 14 deletions

View File

@ -438,24 +438,28 @@ public class TestReviewTestCaseService {
testCaseReviewTestCaseMapper.updateByExampleSelective(testCaseReviewTestCase, caseReviewTestCaseExample);
}
ids.forEach(i -> {
String status = request.getStatus();
if (StringUtils.equals(status, TestCaseReviewCommentStatus.Pass.name())) {
status = TestCaseReviewCommentStatus.ForcePass.name();
} else if (StringUtils.equals(status, TestCaseReviewCommentStatus.UnPass.name())) {
status = TestCaseReviewCommentStatus.ForceUnPass.name();
}
ids.forEach(caseId -> {
String status = getForceUpdateStatusCommentStatus(request.getStatus());
TestCaseReviewTestCaseEditRequest testCaseReviewTestCase = new TestCaseReviewTestCaseEditRequest();
testCaseReviewTestCase.setStatus(status);
testCaseReviewTestCase.setReviewer(SessionUtils.getUser().getId());
testCaseReviewTestCase.setUpdateTime(System.currentTimeMillis());
testCaseReviewTestCase.setComment(request.getDescription());
testCaseReviewTestCase.setCaseId(i);
testCaseReviewTestCase.setCaseId(caseId);
testCaseReviewTestCase.setReviewId(request.getReviewId());
testCaseCommentService.saveReviewComment(testCaseReviewTestCase);
});
}
private String getForceUpdateStatusCommentStatus(String status) {
if (StringUtils.equals(status, TestCaseReviewCommentStatus.Pass.name())) {
status = TestCaseReviewCommentStatus.ForcePass.name();
} else if (StringUtils.equals(status, TestCaseReviewCommentStatus.UnPass.name())) {
status = TestCaseReviewCommentStatus.ForceUnPass.name();
}
return status;
}
public void editTestCaseBatchReviewer(TestReviewCaseBatchRequest request) {
ServiceUtils.getSelectAllIds(request, request.getCondition(),
(query) -> extTestReviewCaseMapper.selectTestCaseIds((QueryCaseReviewRequest) query));
@ -523,6 +527,16 @@ public class TestReviewTestCaseService {
item.setUpdateTime(System.currentTimeMillis());
testCaseReviewTestCaseMapper.updateByPrimaryKeySelective(item);
testCaseService.updateReviewStatus(item.getCaseId(), item.getStatus());
// 添加一条评论历史
String status = getForceUpdateStatusCommentStatus(item.getStatus());
TestCaseReviewTestCaseEditRequest testCaseReviewTestCase = new TestCaseReviewTestCaseEditRequest();
testCaseReviewTestCase.setStatus(status);
testCaseReviewTestCase.setReviewer(SessionUtils.getUser().getId());
testCaseReviewTestCase.setUpdateTime(System.currentTimeMillis());
testCaseReviewTestCase.setCaseId(item.getCaseId());
testCaseReviewTestCase.setReviewId(reviewId);
testCaseCommentService.saveReviewComment(testCaseReviewTestCase);
});
}
}

View File

@ -118,13 +118,17 @@ export default {
}
},
setParamCallback(data, item) {
if (item.reviewStatus === 'Pass') {
data.resource.push(this.$t('test_track.plan_view.pass'));
} else if (item.reviewStatus === 'UnPass') {
data.resource.push(this.$t('test_track.plan_view.not_pass'));
} else {
data.resource.push(this.$t('test_track.plan.plan_status_prepare'));
let statusMap = {
'Pass' : this.$t('test_track.review.pass'),
'UnPass' : this.$t('test_track.review.un_pass'),
'Again' : this.$t('test_track.review.again'),
'Underway' : this.$t('test_track.review.underway')
}
let resourceName = statusMap[item.status];
if (!resourceName) {
resourceName = this.$t('test_track.review.underway');
}
data.resource.push(resourceName);
data.caseId = item.caseId;
},
save(data) {