refactor(用例评审): 用例评审历史显示系统触发

This commit is contained in:
guoyuqi 2023-12-15 12:31:02 +08:00 committed by 刘瑞斌
parent 7fae8fd801
commit f2ec50e15b
6 changed files with 18 additions and 1 deletions

View File

@ -146,3 +146,4 @@ case_review.single=单人评审
case_review.multiple=多人评审
case_review.not.exist=用例评审不存在
case_review_content.not.exist = 评审意见不能为空
case_review_history.system=系统触发

View File

@ -163,4 +163,5 @@ case_review.single=Single person review
case_review.multiple=Multiple reviewers
case_review.not.exist=Case review does not exist
case_review_content.not.exist = Review comments cannot be empty
case_review_history.system=System trigger

View File

@ -162,4 +162,5 @@ case_review.single=单人评审
case_review.multiple=多人评审
case_review.not.exist=用例评审不存在
case_review_content.not.exist = 评审意见不能为空
case_review_history.system=系统触发

View File

@ -163,4 +163,5 @@ case_review.single=單人評審
case_review.multiple=多人評審
case_review.not.exist=用例評審不存在
case_review_content.not.exist = 評審意見不能為空
case_review_history.system=系統觸發

View File

@ -218,7 +218,12 @@ public class ReviewFunctionalCaseService {
public List<CaseReviewHistoryDTO> getCaseReviewHistoryList(String reviewId, String caseId) {
List<CaseReviewHistoryDTO> list = extCaseReviewHistoryMapper.list(caseId, reviewId);
for (CaseReviewHistoryDTO caseReviewHistoryDTO : list) {
caseReviewHistoryDTO.setContentText(new String(caseReviewHistoryDTO.getContent(),StandardCharsets.UTF_8));
if (StringUtils.equalsIgnoreCase(caseReviewHistoryDTO.getCreateUser(),"system")) {
caseReviewHistoryDTO.setUserName(Translator.get("case_review_history.system"));
}
if (caseReviewHistoryDTO.getContent() != null) {
caseReviewHistoryDTO.setContentText(new String(caseReviewHistoryDTO.getContent(),StandardCharsets.UTF_8));
}
}
return list;
}

View File

@ -231,6 +231,14 @@ public class ReviewFunctionalCaseControllerTests extends BaseTest {
public void getListSuccess() throws Exception {
List<CaseReview> caseReviews = getCaseReviews("创建用例评审1");
String reviewId = caseReviews.get(0).getId();
CaseReviewHistory caseReviewHistory = new CaseReviewHistory();
caseReviewHistory.setReviewId(reviewId);
caseReviewHistory.setCaseId("gyqReviewCaseTest");
caseReviewHistory.setCreateUser("system");
caseReviewHistory.setStatus(FunctionalCaseReviewStatus.RE_REVIEWED.toString());
caseReviewHistory.setId("test");
caseReviewHistory.setCreateTime(System.currentTimeMillis());
caseReviewHistoryMapper.insertSelective(caseReviewHistory);
List<CaseReviewHistoryDTO> gyqReviewCaseTest = getCaseReviewHistoryList("gyqReviewCaseTest", reviewId);
System.out.println(JSON.toJSONString(gyqReviewCaseTest));
}