refactor(用例管理): 评审历史倒序
This commit is contained in:
parent
3cbf941b1a
commit
88cf46c805
|
@ -12,6 +12,8 @@ public interface ExtCaseReviewHistoryMapper {
|
||||||
|
|
||||||
List<CaseReviewHistoryDTO> list(@Param("caseId") String caseId, @Param("reviewId") String reviewId);
|
List<CaseReviewHistoryDTO> list(@Param("caseId") String caseId, @Param("reviewId") String reviewId);
|
||||||
|
|
||||||
|
List<CaseReviewHistoryDTO> getHistoryListWidthAbandoned(@Param("caseId") String caseId, @Param("reviewId") String reviewId);
|
||||||
|
|
||||||
void updateDelete(@Param("caseIds") List<String> caseIds, @Param("reviewId") String reviewId, @Param("delete") boolean delete);
|
void updateDelete(@Param("caseIds") List<String> caseIds, @Param("reviewId") String reviewId, @Param("delete") boolean delete);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,28 @@
|
||||||
and ch.abandoned = false
|
and ch.abandoned = false
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getHistoryListWidthAbandoned" resultType="io.metersphere.functional.dto.CaseReviewHistoryDTO">
|
||||||
|
SELECT
|
||||||
|
ch.id,
|
||||||
|
ch.review_id,
|
||||||
|
ch.case_id,
|
||||||
|
ch.status,
|
||||||
|
ch.notifier,
|
||||||
|
ch.create_user,
|
||||||
|
ch.create_time,
|
||||||
|
ch.content,
|
||||||
|
u.name as userName,
|
||||||
|
ux.avatar as userLogo
|
||||||
|
FROM
|
||||||
|
case_review_history ch
|
||||||
|
left join user u on ch.create_user = u.id
|
||||||
|
left join user_extend ux on ch.create_user = ux.id
|
||||||
|
where ch.case_id = #{caseId}
|
||||||
|
<if test="reviewId != null and reviewId != ''">
|
||||||
|
and ch.review_id = #{reviewId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateDelete">
|
<update id="updateDelete">
|
||||||
update case_review_history
|
update case_review_history
|
||||||
set deleted = #{delete}
|
set deleted = #{delete}
|
||||||
|
|
|
@ -204,7 +204,7 @@ public class ReviewFunctionalCaseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<CaseReviewHistoryDTO> getCaseReviewHistoryList(String reviewId, String caseId) {
|
public List<CaseReviewHistoryDTO> getCaseReviewHistoryList(String reviewId, String caseId) {
|
||||||
List<CaseReviewHistoryDTO> list = extCaseReviewHistoryMapper.list(caseId, reviewId);
|
List<CaseReviewHistoryDTO> list = extCaseReviewHistoryMapper.getHistoryListWidthAbandoned(caseId, reviewId);
|
||||||
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"));
|
||||||
|
@ -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;
|
return list.stream().sorted(Comparator.comparing(CaseReviewHistoryDTO::getCreateTime).reversed()).toList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue