refactor(用例管理): 评审历史倒序

This commit is contained in:
guoyuqi 2024-02-02 14:30:09 +08:00 committed by 刘瑞斌
parent 88cf46c805
commit e675b4b2e5
3 changed files with 3 additions and 2 deletions

View File

@ -45,6 +45,7 @@
<if test="reviewId != null and reviewId != ''"> <if test="reviewId != null and reviewId != ''">
and ch.review_id = #{reviewId} and ch.review_id = #{reviewId}
</if> </if>
order by ch.create_time desc
</select> </select>
<update id="updateDelete"> <update id="updateDelete">

View File

@ -36,7 +36,7 @@ public class FunctionalCaseReviewService {
} }
public List<CaseReviewHistoryDTO> getCaseReviewHistory(String caseId) { public List<CaseReviewHistoryDTO> getCaseReviewHistory(String caseId) {
List<CaseReviewHistoryDTO> list = extCaseReviewHistoryMapper.list(caseId, null); List<CaseReviewHistoryDTO> list = extCaseReviewHistoryMapper.getHistoryListWidthAbandoned(caseId, null);
for (CaseReviewHistoryDTO caseReviewHistoryDTO : list) { for (CaseReviewHistoryDTO caseReviewHistoryDTO : list) {
if (StringUtils.equalsIgnoreCase(caseReviewHistoryDTO.getCreateUser(), "system")) { if (StringUtils.equalsIgnoreCase(caseReviewHistoryDTO.getCreateUser(), "system")) {
caseReviewHistoryDTO.setUserName(Translator.get("case_review_history.system")); caseReviewHistoryDTO.setUserName(Translator.get("case_review_history.system"));

View File

@ -213,6 +213,6 @@ public class ReviewFunctionalCaseService {
caseReviewHistoryDTO.setContentText(new String(caseReviewHistoryDTO.getContent(), StandardCharsets.UTF_8)); caseReviewHistoryDTO.setContentText(new String(caseReviewHistoryDTO.getContent(), StandardCharsets.UTF_8));
} }
} }
return list.stream().sorted(Comparator.comparing(CaseReviewHistoryDTO::getCreateTime).reversed()).toList(); return list;
} }
} }