From cd1e8d3ca48cc5a1002e02cb578319c95d84e950 Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Tue, 6 Feb 2024 16:56:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E8=AF=84=E5=AE=A1=E6=A0=87=E5=87=86=E4=B8=BA=E5=A4=9A=E4=BA=BA?= =?UTF-8?q?=E8=AF=84=E5=AE=A1=E7=9A=84=E7=94=A8=E4=BE=8B=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E4=BE=8B=E8=AF=84=E5=AE=A1=E8=AF=A6=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=88=91=E7=9A=84=E8=AF=84=E5=AE=A1=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E6=9D=A1=E4=BB=B6=E5=89=8D=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/ReviewFunctionalCaseDTO.java | 3 + .../mapper/ExtCaseReviewHistoryMapper.java | 3 + .../mapper/ExtCaseReviewHistoryMapper.xml | 19 ++++++ .../ReviewFunctionalCasePageRequest.java | 3 + .../CaseReviewFunctionalCaseService.java | 67 ++++++++++++++----- .../service/FunctionalCaseService.java | 8 +-- ...seReviewFunctionalCaseControllerTests.java | 33 +++++---- .../dml/init_review_functional_case_test.sql | 4 +- .../src/models/caseManagement/caseReview.ts | 1 + .../case-management/caseReview/caseDetail.vue | 18 ++--- .../caseReview/locale/en-US.ts | 2 +- .../caseReview/locale/zh-CN.ts | 2 +- 12 files changed, 121 insertions(+), 42 deletions(-) diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/ReviewFunctionalCaseDTO.java b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/ReviewFunctionalCaseDTO.java index e8afd3624d..107f98c9cf 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/ReviewFunctionalCaseDTO.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/ReviewFunctionalCaseDTO.java @@ -58,4 +58,7 @@ public class ReviewFunctionalCaseDTO implements Serializable { @Schema(description = "用例创建人名称") private String createUserName; + @Schema(description = "只看我的评审状态") + private String myStatus; + } 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 6cb55c8fec..f0e957d61b 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 @@ -1,5 +1,6 @@ package io.metersphere.functional.mapper; +import io.metersphere.functional.domain.CaseReviewHistory; import io.metersphere.functional.dto.CaseReviewHistoryDTO; import org.apache.ibatis.annotations.Param; @@ -19,4 +20,6 @@ public interface ExtCaseReviewHistoryMapper { void updateAbandoned(@Param("caseId") String caseId); void batchUpdateAbandoned(@Param("reviewId") String reviewId, @Param("caseIds") List caseIds); + + List getReviewHistoryStatus(@Param("caseIds") List caseIds, @Param("reviewId") String reviewId); } 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 356ab07bba..3cf081e714 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 @@ -79,4 +79,23 @@ and abandoned = false + + + \ No newline at end of file diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/request/ReviewFunctionalCasePageRequest.java b/backend/services/case-management/src/main/java/io/metersphere/functional/request/ReviewFunctionalCasePageRequest.java index 4410881546..26e6b91aba 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/request/ReviewFunctionalCasePageRequest.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/request/ReviewFunctionalCasePageRequest.java @@ -30,4 +30,7 @@ public class ReviewFunctionalCasePageRequest extends BasePageRequest implements @Schema(description = "模块id") private List moduleIds; + + @Schema(description = "我的评审结果", requiredMode = Schema.RequiredMode.REQUIRED) + private boolean viewStatusFlag; } 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 dad852ce5d..8e4075ab75 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 @@ -123,10 +123,10 @@ public class CaseReviewFunctionalCaseService { */ public List page(ReviewFunctionalCasePageRequest request, boolean deleted, String userId) { List list = extCaseReviewFunctionalCaseMapper.page(request, deleted, userId, request.getSortString()); - return doHandleDTO(list, request.getReviewId()); + return doHandleDTO(list, request, userId); } - private List doHandleDTO(List list, String reviewId) { + private List doHandleDTO(List list, ReviewFunctionalCasePageRequest request, String userId) { if (CollectionUtils.isNotEmpty(list)) { List moduleIds = list.stream().map(ReviewFunctionalCaseDTO::getModuleId).toList(); List modules = extFunctionalCaseModuleMapper.selectBaseByIds(moduleIds); @@ -137,20 +137,57 @@ public class CaseReviewFunctionalCaseService { Map versionMap = versions.stream().collect(Collectors.toMap(ProjectVersion::getId, ProjectVersion::getName)); List caseIds = list.stream().map(ReviewFunctionalCaseDTO::getCaseId).toList(); - List reviewers = extCaseReviewFunctionalCaseUserMapper.selectReviewers(caseIds, reviewId); + List reviewers = extCaseReviewFunctionalCaseUserMapper.selectReviewers(caseIds, request.getReviewId()); Map userIdMap = reviewers.stream().collect(Collectors.toMap(ReviewsDTO::getCaseId, ReviewsDTO::getUserIds)); Map userNameMap = reviewers.stream().collect(Collectors.toMap(ReviewsDTO::getCaseId, ReviewsDTO::getUserNames)); + LinkedHashMap> caseStatusMap; + LinkedHashMap> caseUserMap; + if (request.isViewStatusFlag()) { + List histories = extCaseReviewHistoryMapper.getReviewHistoryStatus(caseIds, request.getReviewId()); + caseStatusMap = histories.stream().collect(Collectors.groupingBy(CaseReviewHistory::getCaseId, LinkedHashMap::new, Collectors.toList())); + caseUserMap = histories.stream().collect(Collectors.groupingBy(CaseReviewHistory::getCreateUser, LinkedHashMap::new, Collectors.toList())); + } else { + caseStatusMap = new LinkedHashMap<>(); + caseUserMap = new LinkedHashMap<>(); + + } + //当前用户的评审历史 + List userHistory = caseUserMap.get(userId); + list.forEach(item -> { item.setModuleName(moduleMap.get(item.getModuleId())); item.setVersionName(versionMap.get(item.getVersionId())); item.setReviewers(Collections.singletonList(userIdMap.get(item.getCaseId()))); item.setReviewNames(Collections.singletonList(userNameMap.get(item.getCaseId()))); + + if (request.isViewStatusFlag()) { + List histories = caseStatusMap.get(item.getCaseId()); + if (CollectionUtils.isNotEmpty(histories)) { + item.setMyStatus(getMyStatus(histories, userHistory)); + } else { + //不存在评审历史 + item.setMyStatus(FunctionalCaseReviewStatus.UNDER_REVIEWED.name()); + } + } }); } return list; } + private String getMyStatus(List histories, List userHistory) { + if (CollectionUtils.isNotEmpty(userHistory)) { + //当前用户存在评审记录 + return userHistory.get(0).getStatus(); + } + //重新提审记录 + List reReviewed = histories.stream().filter(history -> StringUtils.equalsIgnoreCase(history.getStatus(), FunctionalCaseReviewStatus.RE_REVIEWED.name())).toList(); + if (CollectionUtils.isNotEmpty(reReviewed)) { + return FunctionalCaseReviewStatus.RE_REVIEWED.name(); + } + return FunctionalCaseReviewStatus.UN_REVIEWED.name(); + } + /** * 批量删除 * @@ -334,11 +371,11 @@ public class CaseReviewFunctionalCaseService { CaseReview caseReview = caseReviewMapper.selectByPrimaryKey(reviewId); request.setReviewPassRule(caseReview.getReviewPassRule()); //检查权限 - if (!permissionCheckService.userHasProjectPermission(userId, caseReview.getProjectId(), PermissionConstants.CASE_REVIEW_READ_UPDATE) && StringUtils.equalsIgnoreCase(request.getStatus(), FunctionalCaseReviewStatus.RE_REVIEWED.toString()) ) { + if (!permissionCheckService.userHasProjectPermission(userId, caseReview.getProjectId(), PermissionConstants.CASE_REVIEW_READ_UPDATE) && StringUtils.equalsIgnoreCase(request.getStatus(), FunctionalCaseReviewStatus.RE_REVIEWED.toString())) { throw new MSException("http_result_forbidden"); } List caseReviewFunctionalCaseList = doCaseReviewFunctionalCases(request); - if(CollectionUtils.isEmpty(caseReviewFunctionalCaseList)) { + if (CollectionUtils.isEmpty(caseReviewFunctionalCaseList)) { return; } List caseIds = caseReviewFunctionalCaseList.stream().map(CaseReviewFunctionalCase::getCaseId).toList(); @@ -369,7 +406,7 @@ public class CaseReviewFunctionalCaseService { Map statusMap = new HashMap<>(); //重新提审,作废之前的记录 - extCaseReviewHistoryMapper.batchUpdateAbandoned(reviewId,caseIds); + extCaseReviewHistoryMapper.batchUpdateAbandoned(reviewId, caseIds); for (CaseReviewFunctionalCase caseReviewFunctionalCase : caseReviewFunctionalCaseList) { //校验当前操作人是否是该用例的评审人或者是系统管理员,是增加评审历史,不是过滤掉 @@ -639,7 +676,7 @@ public class CaseReviewFunctionalCaseService { List functionalModuleIds = extFunctionalCaseModuleMapper.selectBaseByProjectIdAndReviewId(reviewId); Map> projectModuleMap = functionalModuleIds.stream().collect(Collectors.groupingBy(FunctionalCaseModule::getProjectId)); if (MapUtils.isEmpty(projectModuleMap)) { - projectRootMap.forEach((projectId,projectOptionDTOList)->{ + projectRootMap.forEach((projectId, projectOptionDTOList) -> { BaseTreeNode projectNode = new BaseTreeNode(projectId, projectOptionDTOList.get(0).getProjectName(), Project.class.getName()); returnList.add(projectNode); BaseTreeNode defaultNode = functionalCaseModuleService.getDefaultModule(Translator.get("functional_case.module.default.name")); @@ -647,7 +684,7 @@ public class CaseReviewFunctionalCaseService { }); return returnList; } - projectModuleMap.forEach((projectId,moduleList)->{ + projectModuleMap.forEach((projectId, moduleList) -> { BaseTreeNode projectNode = new BaseTreeNode(projectId, moduleList.get(0).getProjectName(), Project.class.getName()); returnList.add(projectNode); List projectModuleIds = moduleList.stream().map(FunctionalCaseModule::getId).toList(); @@ -667,21 +704,21 @@ public class CaseReviewFunctionalCaseService { List projectModuleCountDTOList = extCaseReviewFunctionalCaseMapper.countModuleIdByRequest(request, deleted, userId); Map> projectCountMap = projectModuleCountDTOList.stream().collect(Collectors.groupingBy(FunctionalCaseModuleCountDTO::getProjectId)); Map projectModuleCountMap = new HashMap<>(); - projectCountMap.forEach((projectId,moduleCountDTOList)->{ - ListmoduleCountDTOS = new ArrayList<>(); + projectCountMap.forEach((projectId, moduleCountDTOList) -> { + List moduleCountDTOS = new ArrayList<>(); for (FunctionalCaseModuleCountDTO functionalCaseModuleCountDTO : moduleCountDTOList) { ModuleCountDTO moduleCountDTO = new ModuleCountDTO(); - BeanUtils.copyBean(moduleCountDTO,functionalCaseModuleCountDTO); + BeanUtils.copyBean(moduleCountDTO, functionalCaseModuleCountDTO); moduleCountDTOS.add(moduleCountDTO); } int sum = moduleCountDTOList.stream().mapToInt(FunctionalCaseModuleCountDTO::getDataCount).sum(); Map moduleCountMap = getModuleCountMap(projectId, request.getReviewId(), moduleCountDTOS); - moduleCountMap.forEach((k,v)->{ - if (projectModuleCountMap.get(k)==null || projectModuleCountMap.get(k) == 0L){ - projectModuleCountMap.put(k,v); + moduleCountMap.forEach((k, v) -> { + if (projectModuleCountMap.get(k) == null || projectModuleCountMap.get(k) == 0L) { + projectModuleCountMap.put(k, v); } }); - projectModuleCountMap.put(projectId, (long)sum); + projectModuleCountMap.put(projectId, (long) sum); }); //查出全部用例数量 long allCount = extCaseReviewFunctionalCaseMapper.caseCount(request, deleted, userId); diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseService.java index 8f002b17a8..d6dba0ddc4 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseService.java @@ -179,7 +179,7 @@ public class FunctionalCaseService { //记录日志 FunctionalCaseHistoryLogDTO historyLogDTO = getImportLogModule(functionalCase); - saveImportDataLog(functionalCase, new FunctionalCaseHistoryLogDTO(), historyLogDTO, userId, organizationId, OperationLogType.ADD.name(),OperationLogModule.CASE_MANAGEMENT_CASE_CREATE); + saveImportDataLog(functionalCase, new FunctionalCaseHistoryLogDTO(), historyLogDTO, userId, organizationId, OperationLogType.ADD.name(), OperationLogModule.CASE_MANAGEMENT_CASE_CREATE); return functionalCase; } @@ -962,7 +962,7 @@ public class FunctionalCaseService { List customFields = functionalCaseCustomFieldMapper.selectByExample(fieldExample); FunctionalCaseHistoryLogDTO historyLogDTO = new FunctionalCaseHistoryLogDTO(functionalCase, caseBlob, customFields, new ArrayList<>(), new ArrayList<>()); - saveImportDataLog(functionalCase, new FunctionalCaseHistoryLogDTO(), historyLogDTO, userId, organizationId, OperationLogType.IMPORT.name(),OperationLogModule.CASE_MANAGEMENT_CASE_CREATE); + saveImportDataLog(functionalCase, new FunctionalCaseHistoryLogDTO(), historyLogDTO, userId, organizationId, OperationLogType.IMPORT.name(), OperationLogModule.CASE_MANAGEMENT_CASE_CREATE); } @@ -1071,7 +1071,7 @@ public class FunctionalCaseService { //记录新值 FunctionalCaseHistoryLogDTO modifiedLogDTO = getImportLogModule(functionalCase); //记录日志 - saveImportDataLog(functionalCase, originalValue, modifiedLogDTO, userId, organizationId, OperationLogType.IMPORT.name(),OperationLogModule.CASE_MANAGEMENT_CASE_UPDATE); + saveImportDataLog(functionalCase, originalValue, modifiedLogDTO, userId, organizationId, OperationLogType.IMPORT.name(), OperationLogModule.CASE_MANAGEMENT_CASE_UPDATE); } private void handleUpdateCustomField(FunctionalCaseExcelData functionalCaseExcelData, String caseId, FunctionalCaseCustomFieldMapper customFieldMapper, Map customFieldsMap) { @@ -1089,7 +1089,7 @@ public class FunctionalCaseService { * @param originalValue 原值 * @param modifiedLogDTO 新值 */ - private void saveImportDataLog(FunctionalCase functionalCase, FunctionalCaseHistoryLogDTO originalValue, FunctionalCaseHistoryLogDTO modifiedLogDTO, String userId, String organizationId, String type,String module) { + private void saveImportDataLog(FunctionalCase functionalCase, FunctionalCaseHistoryLogDTO originalValue, FunctionalCaseHistoryLogDTO modifiedLogDTO, String userId, String organizationId, String type, String module) { LogDTO dto = new LogDTO( functionalCase.getProjectId(), organizationId, diff --git a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewFunctionalCaseControllerTests.java b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewFunctionalCaseControllerTests.java index 9338e642ee..c5c1bca263 100644 --- a/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewFunctionalCaseControllerTests.java +++ b/backend/services/case-management/src/test/java/io/metersphere/functional/controller/CaseReviewFunctionalCaseControllerTests.java @@ -54,9 +54,9 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest { public static final String REVIEW_FUNCTIONAL_CASE_BATCH_REVIEW = "/case/review/detail/batch/review"; public static final String URL_MODULE_TREE = "/case/review/detail/tree/"; - public static final String REVIEW_FUNCTIONAL_CASE_MODULE_COUNT= "/case/review/detail/module/count"; + public static final String REVIEW_FUNCTIONAL_CASE_MODULE_COUNT = "/case/review/detail/module/count"; - public static final String REVIEW_FUNCTIONAL_CASE_REVIEWER_STATUS= "/case/review/detail/reviewer/status/"; + public static final String REVIEW_FUNCTIONAL_CASE_REVIEWER_STATUS = "/case/review/detail/reviewer/status/"; @Resource @@ -97,9 +97,18 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest { @Sql(scripts = {"/dml/init_review_functional_case_test.sql"}, config = @SqlConfig(encoding = "utf-8", transactionMode = SqlConfig.TransactionMode.ISOLATED)) public void testReviewCasePage() throws Exception { ReviewFunctionalCasePageRequest request = new ReviewFunctionalCasePageRequest(); - request.setReviewId("wx_review_id_1"); request.setCurrent(1); request.setPageSize(10); + request.setProjectId("wx_test_project"); + + request.setReviewId("wx_review_id_5"); + request.setViewFlag(true); + request.setViewStatusFlag(true); + this.requestPostWithOkAndReturn(REVIEW_CASE_PAGE, request); + request.setReviewId("wx_review_id_1"); + this.requestPostWithOkAndReturn(REVIEW_CASE_PAGE, request); + + request.setReviewId("wx_review_id_1"); Map map = new HashMap<>(); map.put("customs", Arrays.asList(new LinkedHashMap() {{ put("id", "TEST_FIELD_ID"); @@ -109,10 +118,11 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest { }})); request.setCombine(map); request.setViewFlag(true); - request.setProjectId("wx_test_project"); + request.setViewStatusFlag(true); this.requestPostWithOkAndReturn(REVIEW_CASE_PAGE, request); this.requestPostWithOkAndReturn(REVIEW_FUNCTIONAL_CASE_MODULE_COUNT, request); request.setViewFlag(false); + request.setViewStatusFlag(false); this.requestPostWithOkAndReturn(REVIEW_CASE_PAGE, request); request.setSort(new HashMap<>() {{ @@ -144,10 +154,10 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest { @Test @Order(4) public void emptyDataTest() throws Exception { - List treeNodeDefaults = this.getCaseReviewModuleTreeNode("wx_test_project","wx_review_id_5"); + List treeNodeDefaults = this.getCaseReviewModuleTreeNode("wx_test_project", "wx_review_id_5"); String jsonStringD = JSON.toJSONString(treeNodeDefaults); System.out.println(jsonStringD); - List treeNodes = this.getCaseReviewModuleTreeNode("wx_test_project","wx_review_id_2"); + List treeNodes = this.getCaseReviewModuleTreeNode("wx_test_project", "wx_review_id_2"); String jsonString = JSON.toJSONString(treeNodes); System.out.println(jsonString); Assertions.assertTrue(CollectionUtils.isNotEmpty(treeNodes)); @@ -291,7 +301,7 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest { this.requestPostWithOk(REVIEW_FUNCTIONAL_CASE_BATCH_REVIEW, request); try { caseReviewFunctionalCaseService.batchReview(request, "GGG"); - } catch (Exception e){ + } catch (Exception e) { Assertions.assertNotNull(e); } @@ -374,7 +384,6 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest { this.requestPostWithOk(REVIEW_FUNCTIONAL_CASE_BATCH_REVIEW, request); - request = new BatchReviewFunctionalCaseRequest(); request.setReviewId("wx_review_id_1"); request.setReviewPassRule(CaseReviewPassRule.MULTIPLE.toString()); @@ -475,9 +484,9 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest { @Test @Order(11) public void getUserStatus() throws Exception { - List optionDTOS = getOptionDTOS("wx_review_id_1","gyq_case_id_5"); + List optionDTOS = getOptionDTOS("wx_review_id_1", "gyq_case_id_5"); Assertions.assertTrue(CollectionUtils.isNotEmpty(optionDTOS)); - optionDTOS = getOptionDTOS("wx_review_id_1_NONE","gyq_case_id_5"); + optionDTOS = getOptionDTOS("wx_review_id_1_NONE", "gyq_case_id_5"); Assertions.assertTrue(CollectionUtils.isEmpty(optionDTOS)); } @@ -500,7 +509,7 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest { } private List getOptionDTOS(String reviewId, String caseId) throws Exception { - MvcResult result = mockMvc.perform(MockMvcRequestBuilders.get(REVIEW_FUNCTIONAL_CASE_REVIEWER_STATUS+"/"+reviewId+"/"+caseId).header(SessionConstants.HEADER_TOKEN, sessionId) + MvcResult result = mockMvc.perform(MockMvcRequestBuilders.get(REVIEW_FUNCTIONAL_CASE_REVIEWER_STATUS + "/" + reviewId + "/" + caseId).header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) @@ -513,7 +522,7 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest { private List getCaseReviewModuleTreeNode(String projectId, String reviewId) throws Exception { - MvcResult result = mockMvc.perform(MockMvcRequestBuilders.get(URL_MODULE_TREE+"/"+reviewId).header(SessionConstants.HEADER_TOKEN, sessionId) + MvcResult result = mockMvc.perform(MockMvcRequestBuilders.get(URL_MODULE_TREE + "/" + reviewId).header(SessionConstants.HEADER_TOKEN, sessionId) .header(SessionConstants.CSRF_TOKEN, csrfToken) .header(SessionConstants.CURRENT_PROJECT, projectId) .contentType(MediaType.APPLICATION_JSON)) diff --git a/backend/services/case-management/src/test/resources/dml/init_review_functional_case_test.sql b/backend/services/case-management/src/test/resources/dml/init_review_functional_case_test.sql index ec830c458a..8b863e58f2 100644 --- a/backend/services/case-management/src/test/resources/dml/init_review_functional_case_test.sql +++ b/backend/services/case-management/src/test/resources/dml/init_review_functional_case_test.sql @@ -132,7 +132,9 @@ VALUES ('wx_history', 'wx_review_id_3', 'wx_case_id_1', NULL, 'PASS', b'0', b'0' ('wx_history_4', 'wx_review_id_4', 'wx_case_id_1', NULL, 'PASS', b'0', b'0', NULL, 'admin', 1669174143999), ('wx_history_5', 'wx_review_id_4', 'wx_case_id_2', NULL, 'UN_PASS', b'0', b'0', NULL, 'admin', 1669174143999), ('wx_history_6', 'wx_review_id_1', 'gyq_case_id_5', NULL, 'PASS', b'0', b'0', NULL, 'gyq_case_review', 1669174143999), - ('wx_history_7', 'wx_review_id_1', 'gyq_case_id_5', NULL, 'UN_PASS', b'0', b'0', NULL, 'GGG', 1669174143999); + ('wx_history_7', 'wx_review_id_1', 'gyq_case_id_5', NULL, 'UN_PASS', b'0', b'0', NULL, 'GGG', 1669174143999), + ('wx_history_8', 'wx_review_id_1', 'wx_case_id_1', NULL, 'UN_PASS', b'0', b'0', NULL, 'admin', 1669174143999), + ('wx_history_9', 'wx_review_id_5', 'gyq_case_id_d', NULL, 'RE_REVIEWED', b'0', b'0', NULL, 'GGG', 1669174143999); INSERT INTO case_review_user(review_id, user_id) VALUES ('wx_review_id_4', 'admin') \ No newline at end of file diff --git a/frontend/src/models/caseManagement/caseReview.ts b/frontend/src/models/caseManagement/caseReview.ts index dc641d05f9..014381b754 100644 --- a/frontend/src/models/caseManagement/caseReview.ts +++ b/frontend/src/models/caseManagement/caseReview.ts @@ -117,6 +117,7 @@ export interface ReviewListQueryParams extends TableQueryParams { export interface ReviewDetailCaseListQueryParams extends TableQueryParams { viewFlag: boolean; // 是否只看我的 reviewId: string; + viewStatusFlag: boolean; // 我的评审状态 } // 评审详情-用例拖拽排序入参 export interface SortReviewCaseParams { diff --git a/frontend/src/views/case-management/caseReview/caseDetail.vue b/frontend/src/views/case-management/caseReview/caseDetail.vue index 5b8d9691fa..4d5f8f0eb4 100644 --- a/frontend/src/views/case-management/caseReview/caseDetail.vue +++ b/frontend/src/views/case-management/caseReview/caseDetail.vue @@ -16,9 +16,9 @@ : t('caseManagement.caseReview.multi') }} -
- - {{ t('caseManagement.caseReview.myReview') }} +
+ + {{ t('caseManagement.caseReview.myReviewStatus') }}
@@ -323,7 +323,8 @@ { label: t(reviewResultMap.RE_REVIEWED.label), value: 'RE_REVIEWED' }, ]); - const onlyMine = ref(false); + const viewFlag = ref(false); + const onlyMineStatus = ref(false); const keyword = ref(''); const caseList = ref([]); const pageNation = ref({ @@ -341,7 +342,8 @@ const res = await getReviewDetailCasePage({ projectId: appStore.currentProjectId, reviewId: reviewId.value, - viewFlag: onlyMine.value, + viewFlag: viewFlag.value, + viewStatusFlag: onlyMineStatus.value, keyword: keyword.value, current: pageNation.value.current || 1, pageSize: pageNation.value.pageSize, @@ -363,7 +365,7 @@ } watch( - () => onlyMine.value, + () => onlyMineStatus.value, () => { pageNation.value.current = 1; loadCaseList(); @@ -566,7 +568,7 @@ total, pageSize, current, - onlyMine: _onlyMine, + viewFlag: _onlyMine, keyword: _keyword, combine, sort, @@ -578,7 +580,7 @@ pageSize, current, }; - onlyMine.value = !!_onlyMine; + viewFlag.value = !!_onlyMine; keyword.value = _keyword; otherListQueryParams.value = { combine, diff --git a/frontend/src/views/case-management/caseReview/locale/en-US.ts b/frontend/src/views/case-management/caseReview/locale/en-US.ts index c12766569a..b008fbfb26 100644 --- a/frontend/src/views/case-management/caseReview/locale/en-US.ts +++ b/frontend/src/views/case-management/caseReview/locale/en-US.ts @@ -111,7 +111,7 @@ export default { 'caseManagement.caseReview.append': 'Append', 'caseManagement.caseReview.appendTip1': 'Open: Add reviewer', 'caseManagement.caseReview.appendTip2': 'Close: Update reviewers', - 'caseManagement.caseReview.myReview': 'My reviews', + 'caseManagement.caseReview.myReviewStatus': 'My reviews status', 'caseManagement.caseReview.caseLevel': 'Case level', 'caseManagement.caseReview.caseVersion': 'Case version', 'caseManagement.caseReview.caseStatus': 'Case status', diff --git a/frontend/src/views/case-management/caseReview/locale/zh-CN.ts b/frontend/src/views/case-management/caseReview/locale/zh-CN.ts index 6a8660db9a..da1d3db9c7 100644 --- a/frontend/src/views/case-management/caseReview/locale/zh-CN.ts +++ b/frontend/src/views/case-management/caseReview/locale/zh-CN.ts @@ -101,7 +101,7 @@ export default { 'caseManagement.caseReview.append': '追加', 'caseManagement.caseReview.appendTip1': '开启:新增评审人', 'caseManagement.caseReview.appendTip2': '关闭:更新评审人', - 'caseManagement.caseReview.myReview': '我的评审', + 'caseManagement.caseReview.myReviewStatus': '我的评审状态', 'caseManagement.caseReview.caseLevel': '用例等级', 'caseManagement.caseReview.caseVersion': '用例版本', 'caseManagement.caseReview.caseStatus': '用例状态',