refactor(用例管理): 用例重新提审,废弃之前的评审历史
This commit is contained in:
parent
1ae8f21bc9
commit
35199849c2
|
@ -10,7 +10,7 @@ public class FilterChainUtils {
|
||||||
filterChainDefinitionMap.put("/*.html", "anon");
|
filterChainDefinitionMap.put("/*.html", "anon");
|
||||||
filterChainDefinitionMap.put("/login", "anon");
|
filterChainDefinitionMap.put("/login", "anon");
|
||||||
filterChainDefinitionMap.put("/ldap/login", "anon");
|
filterChainDefinitionMap.put("/ldap/login", "anon");
|
||||||
filterChainDefinitionMap.put("/ldap/open", "anon");
|
filterChainDefinitionMap.put("/authentication/get-list", "anon");
|
||||||
filterChainDefinitionMap.put("/signout", "anon");
|
filterChainDefinitionMap.put("/signout", "anon");
|
||||||
filterChainDefinitionMap.put("/is-login", "anon");
|
filterChainDefinitionMap.put("/is-login", "anon");
|
||||||
filterChainDefinitionMap.put("/get-key", "anon");
|
filterChainDefinitionMap.put("/get-key", "anon");
|
||||||
|
|
|
@ -16,4 +16,7 @@ public interface ExtCaseReviewHistoryMapper {
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
void updateAbandoned(@Param("caseId") String caseId);
|
||||||
|
|
||||||
|
void batchUpdateAbandoned(@Param("reviewId") String reviewId, @Param("caseIds") List<String> caseIds);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,23 @@
|
||||||
</if>
|
</if>
|
||||||
</update>
|
</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>
|
</mapper>
|
|
@ -261,6 +261,9 @@ public class CaseReviewFunctionalCaseService {
|
||||||
reviewFunctionalCaseExample.createCriteria().andCaseIdEqualTo(blob.getId());
|
reviewFunctionalCaseExample.createCriteria().andCaseIdEqualTo(blob.getId());
|
||||||
List<CaseReviewFunctionalCase> caseReviewFunctionalCases = caseReviewFunctionalCaseMapper.selectByExample(reviewFunctionalCaseExample);
|
List<CaseReviewFunctionalCase> caseReviewFunctionalCases = caseReviewFunctionalCaseMapper.selectByExample(reviewFunctionalCaseExample);
|
||||||
if (CollectionUtils.isNotEmpty(caseReviewFunctionalCases)) {
|
if (CollectionUtils.isNotEmpty(caseReviewFunctionalCases)) {
|
||||||
|
//重新提审,作废之前的记录
|
||||||
|
extCaseReviewHistoryMapper.updateAbandoned(blob.getId());
|
||||||
|
|
||||||
caseReviewFunctionalCases.forEach(item -> {
|
caseReviewFunctionalCases.forEach(item -> {
|
||||||
updateReviewCaseAndCaseStatus(item);
|
updateReviewCaseAndCaseStatus(item);
|
||||||
insertHistory(item);
|
insertHistory(item);
|
||||||
|
@ -353,6 +356,10 @@ public class CaseReviewFunctionalCaseService {
|
||||||
CaseReviewFunctionalCaseMapper caseReviewFunctionalCaseMapper = sqlSession.getMapper(CaseReviewFunctionalCaseMapper.class);
|
CaseReviewFunctionalCaseMapper caseReviewFunctionalCaseMapper = sqlSession.getMapper(CaseReviewFunctionalCaseMapper.class);
|
||||||
|
|
||||||
Map<String, String> statusMap = new HashMap<>();
|
Map<String, String> statusMap = new HashMap<>();
|
||||||
|
|
||||||
|
//重新提审,作废之前的记录
|
||||||
|
extCaseReviewHistoryMapper.batchUpdateAbandoned(reviewId,caseIds);
|
||||||
|
|
||||||
for (CaseReviewFunctionalCase caseReviewFunctionalCase : caseReviewFunctionalCaseList) {
|
for (CaseReviewFunctionalCase caseReviewFunctionalCase : caseReviewFunctionalCaseList) {
|
||||||
//校验当前操作人是否是该用例的评审人或者是系统管理员,是增加评审历史,不是过滤掉
|
//校验当前操作人是否是该用例的评审人或者是系统管理员,是增加评审历史,不是过滤掉
|
||||||
String caseId = caseReviewFunctionalCase.getCaseId();
|
String caseId = caseReviewFunctionalCase.getCaseId();
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<mapper namespace="io.metersphere.project.mapper.ExtBaseProjectVersionMapper">
|
<mapper namespace="io.metersphere.project.mapper.ExtBaseProjectVersionMapper">
|
||||||
|
|
||||||
<select id="getDefaultVersion" resultType="java.lang.String">
|
<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>
|
||||||
|
|
||||||
<select id="getVersionByIds" resultType="io.metersphere.project.domain.ProjectVersion">
|
<select id="getVersionByIds" resultType="io.metersphere.project.domain.ProjectVersion">
|
||||||
|
|
Loading…
Reference in New Issue