From 35199849c28c9769648410676c4013ef9fce05a4 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Fri, 2 Feb 2024 15:47:50 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E7=94=A8=E4=BE=8B=E9=87=8D=E6=96=B0=E6=8F=90=E5=AE=A1?= =?UTF-8?q?=EF=BC=8C=E5=BA=9F=E5=BC=83=E4=B9=8B=E5=89=8D=E7=9A=84=E8=AF=84?= =?UTF-8?q?=E5=AE=A1=E5=8E=86=E5=8F=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/sdk/util/FilterChainUtils.java | 2 +- .../mapper/ExtCaseReviewHistoryMapper.java | 3 +++ .../mapper/ExtCaseReviewHistoryMapper.xml | 17 +++++++++++++++++ .../CaseReviewFunctionalCaseService.java | 7 +++++++ .../mapper/ExtBaseProjectVersionMapper.xml | 2 +- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/FilterChainUtils.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/FilterChainUtils.java index 6730fd1ba5..30a5922f69 100644 --- a/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/FilterChainUtils.java +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/util/FilterChainUtils.java @@ -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"); diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewHistoryMapper.java b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewHistoryMapper.java index 271e3c6f8d..6cb55c8fec 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewHistoryMapper.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewHistoryMapper.java @@ -16,4 +16,7 @@ public interface ExtCaseReviewHistoryMapper { void updateDelete(@Param("caseIds") List caseIds, @Param("reviewId") String reviewId, @Param("delete") boolean delete); + void updateAbandoned(@Param("caseId") String caseId); + + void batchUpdateAbandoned(@Param("reviewId") String reviewId, @Param("caseIds") List caseIds); } diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewHistoryMapper.xml b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewHistoryMapper.xml index e1791eefdb..356ab07bba 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewHistoryMapper.xml +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/mapper/ExtCaseReviewHistoryMapper.xml @@ -60,6 +60,23 @@ + + update case_review_history + set abandoned = true + where case_id = #{caseId} + and abandoned = false + + + update case_review_history + set abandoned = true + where review_id = #{reviewId} + and case_id in + + #{caseId} + + and abandoned = false + + \ No newline at end of file diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewFunctionalCaseService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewFunctionalCaseService.java index 416f938d1c..4fa9680c12 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewFunctionalCaseService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/CaseReviewFunctionalCaseService.java @@ -261,6 +261,9 @@ public class CaseReviewFunctionalCaseService { reviewFunctionalCaseExample.createCriteria().andCaseIdEqualTo(blob.getId()); List 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 statusMap = new HashMap<>(); + + //重新提审,作废之前的记录 + extCaseReviewHistoryMapper.batchUpdateAbandoned(reviewId,caseIds); + for (CaseReviewFunctionalCase caseReviewFunctionalCase : caseReviewFunctionalCaseList) { //校验当前操作人是否是该用例的评审人或者是系统管理员,是增加评审历史,不是过滤掉 String caseId = caseReviewFunctionalCase.getCaseId(); diff --git a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtBaseProjectVersionMapper.xml b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtBaseProjectVersionMapper.xml index 5bc4c4d710..399d23aada 100644 --- a/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtBaseProjectVersionMapper.xml +++ b/backend/services/project-management/src/main/java/io/metersphere/project/mapper/ExtBaseProjectVersionMapper.xml @@ -3,7 +3,7 @@