refactor(用例管理): 用例重新提审,废弃之前的评审历史

This commit is contained in:
WangXu10 2024-02-02 15:47:50 +08:00 committed by 刘瑞斌
parent 1ae8f21bc9
commit 35199849c2
5 changed files with 29 additions and 2 deletions

View File

@ -10,7 +10,7 @@ public class FilterChainUtils {
filterChainDefinitionMap.put("/*.html", "anon");
filterChainDefinitionMap.put("/login", "anon");
filterChainDefinitionMap.put("/ldap/login", "anon");
filterChainDefinitionMap.put("/ldap/open", "anon");
filterChainDefinitionMap.put("/authentication/get-list", "anon");
filterChainDefinitionMap.put("/signout", "anon");
filterChainDefinitionMap.put("/is-login", "anon");
filterChainDefinitionMap.put("/get-key", "anon");

View File

@ -16,4 +16,7 @@ public interface ExtCaseReviewHistoryMapper {
void updateDelete(@Param("caseIds") List<String> caseIds, @Param("reviewId") String reviewId, @Param("delete") boolean delete);
void updateAbandoned(@Param("caseId") String caseId);
void batchUpdateAbandoned(@Param("reviewId") String reviewId, @Param("caseIds") List<String> caseIds);
}

View File

@ -60,6 +60,23 @@
</if>
</update>
<update id="updateAbandoned">
update case_review_history
set abandoned = true
where case_id = #{caseId}
and abandoned = false
</update>
<update id="batchUpdateAbandoned">
update case_review_history
set abandoned = true
where review_id = #{reviewId}
and case_id in
<foreach collection="caseIds" item="caseId" separator="," open="(" close=")">
#{caseId}
</foreach>
and abandoned = false
</update>
</mapper>

View File

@ -261,6 +261,9 @@ public class CaseReviewFunctionalCaseService {
reviewFunctionalCaseExample.createCriteria().andCaseIdEqualTo(blob.getId());
List<CaseReviewFunctionalCase> caseReviewFunctionalCases = caseReviewFunctionalCaseMapper.selectByExample(reviewFunctionalCaseExample);
if (CollectionUtils.isNotEmpty(caseReviewFunctionalCases)) {
//重新提审作废之前的记录
extCaseReviewHistoryMapper.updateAbandoned(blob.getId());
caseReviewFunctionalCases.forEach(item -> {
updateReviewCaseAndCaseStatus(item);
insertHistory(item);
@ -353,6 +356,10 @@ public class CaseReviewFunctionalCaseService {
CaseReviewFunctionalCaseMapper caseReviewFunctionalCaseMapper = sqlSession.getMapper(CaseReviewFunctionalCaseMapper.class);
Map<String, String> statusMap = new HashMap<>();
//重新提审作废之前的记录
extCaseReviewHistoryMapper.batchUpdateAbandoned(reviewId,caseIds);
for (CaseReviewFunctionalCase caseReviewFunctionalCase : caseReviewFunctionalCaseList) {
//校验当前操作人是否是该用例的评审人或者是系统管理员是增加评审历史不是过滤掉
String caseId = caseReviewFunctionalCase.getCaseId();

View File

@ -3,7 +3,7 @@
<mapper namespace="io.metersphere.project.mapper.ExtBaseProjectVersionMapper">
<select id="getDefaultVersion" resultType="java.lang.String">
select id from project_version where project_id = #{projectId} and status = 'open' and latest = TRUE LIMIT 1
select id from project_version where project_id = #{projectId} and latest = TRUE LIMIT 1
</select>
<select id="getVersionByIds" resultType="io.metersphere.project.domain.ProjectVersion">