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 49b350c623..611ca95c10 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 @@ -12,7 +12,9 @@ import io.metersphere.functional.excel.domain.FunctionalCaseExcelData; import io.metersphere.functional.mapper.*; import io.metersphere.functional.request.*; import io.metersphere.functional.result.CaseManagementResultCode; +import io.metersphere.plan.domain.TestPlanCaseExecuteHistoryExample; import io.metersphere.plan.domain.TestPlanFunctionalCaseExample; +import io.metersphere.plan.mapper.TestPlanCaseExecuteHistoryMapper; import io.metersphere.plan.mapper.TestPlanFunctionalCaseMapper; import io.metersphere.project.domain.*; import io.metersphere.project.dto.ModuleCountDTO; @@ -166,6 +168,8 @@ public class FunctionalCaseService { @Resource private CaseReviewHistoryMapper caseReviewHistoryMapper; @Resource + private TestPlanCaseExecuteHistoryMapper testPlanCaseExecuteHistoryMapper; + @Resource private FunctionalCaseCommentMapper functionalCaseCommentMapper; @Resource private ProjectService projectService; @@ -420,9 +424,12 @@ public class FunctionalCaseService { FunctionalCaseCommentExample functionalCaseCommentExample = new FunctionalCaseCommentExample(); functionalCaseCommentExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId()); long caseComment = functionalCaseCommentMapper.countByExample(functionalCaseCommentExample); - long commentCount = caseComment + reviewComment; + //获取关联测试计划的执行评论数量 + TestPlanCaseExecuteHistoryExample testPlanCaseExecuteHistoryExample = new TestPlanCaseExecuteHistoryExample(); + testPlanCaseExecuteHistoryExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId()); + long testPlanExecuteComment = testPlanCaseExecuteHistoryMapper.countByExample(testPlanCaseExecuteHistoryExample); + long commentCount = caseComment + reviewComment + testPlanExecuteComment; functionalCaseDetailDTO.setCommentCount((int) commentCount); - //获取变更历史数量数量 OperationHistoryExample operationHistoryExample = new OperationHistoryExample(); List types = List.of(OperationLogType.ADD.name(), OperationLogType.IMPORT.name(), OperationLogType.UPDATE.name()); diff --git a/frontend/src/api/modules/case-management/featureCase.ts b/frontend/src/api/modules/case-management/featureCase.ts index b353b04c44..c75058acb6 100644 --- a/frontend/src/api/modules/case-management/featureCase.ts +++ b/frontend/src/api/modules/case-management/featureCase.ts @@ -52,6 +52,7 @@ import { GetDependOnRelationUrl, GetDetailCaseReviewUrl, GetFileIsUpdateUrl, + GetPlanExecuteCommentListUrl, GetRecycleCaseListUrl, GetRecycleCaseModulesCountUrl, GetReviewCommentListUrl, @@ -435,4 +436,9 @@ export function getLinkedCaseTestPlanList(data: TableQueryParams) { return MSR.post>({ url: GetAssociatedTestPlanUrl, data }); } +// 获取执行评论 +export function getTestPlanExecuteCommentList(caseId: string) { + return MSR.get({ url: `${GetPlanExecuteCommentListUrl}/${caseId}` }); +} + export default {}; diff --git a/frontend/src/api/requrls/case-management/featureCase.ts b/frontend/src/api/requrls/case-management/featureCase.ts index 83721fd205..f91138ffd9 100644 --- a/frontend/src/api/requrls/case-management/featureCase.ts +++ b/frontend/src/api/requrls/case-management/featureCase.ts @@ -154,3 +154,6 @@ export const associatedProjectOptionsUrl = '/project/list/options'; // 获取详情已关联测试计划列表 export const GetAssociatedTestPlanUrl = '/functional/case/test/has/associate/plan/page'; + +// 评审评论 +export const GetPlanExecuteCommentListUrl = '/functional/case/test/plan/comment'; diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabComment/tabCommentIndex.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabComment/tabCommentIndex.vue index 30b858d74d..d5613236f5 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabComment/tabCommentIndex.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabComment/tabCommentIndex.vue @@ -4,7 +4,7 @@ {{ t('caseManagement.featureCase.caseComment') }} {{ t('caseManagement.featureCase.reviewComment') }} - + {{ t('caseManagement.featureCase.executiveReview') }}
@@ -21,13 +21,20 @@
-
+
-
{{ item.userName }}
+ +
{{ + item.userName + }}
+
@@ -45,24 +52,53 @@ {{ t('caseManagement.caseReview.reReview') }}
+
+ + {{ t('caseManagement.featureCase.execute.success') }} +
+
+ + {{ t('caseManagement.featureCase.execute.blocked') }} +
+
+ + {{ t('caseManagement.featureCase.execute.failed') }} +
-
+
{{ dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss') }} - - - {{ characterLimit(item.reviewName) }} - +
+ + + {{ characterLimit(item.reviewName) }} + - - {{ characterLimit(item.reviewName) }} - - + + {{ characterLimit(item.reviewName) }} + + +
+
+ + + {{ characterLimit(item.testPlanName) }} + + + + {{ characterLimit(item.testPlanName) }} + + +
@@ -88,15 +124,15 @@ editorUploadFile, getCommentList, getReviewCommentList, + getTestPlanExecuteCommentList, } from '@/api/modules/case-management/featureCase'; import { PreviewEditorImageUrl } from '@/api/requrls/case-management/featureCase'; import { useI18n } from '@/hooks/useI18n'; import useModal from '@/hooks/useModal'; import useFeatureCaseStore from '@/store/modules/case/featureCase'; import { characterLimit } from '@/utils'; - import { hasAnyPermission } from '@/utils/permission'; - import { CaseManagementRouteEnum } from '@/enums/routeEnum'; + import { CaseManagementRouteEnum, TestPlanRouteEnum } from '@/enums/routeEnum'; const featureCaseStore = useFeatureCaseStore(); const router = useRouter(); @@ -133,6 +169,16 @@ } } + // 初始化执行评论 + async function initTestPlanExecuteCommentList() { + try { + const result = await getTestPlanExecuteCommentList(props.caseId); + reviewCommentList.value = result; + } catch (error) { + console.log(error); + } + } + async function getAllCommentList() { switch (activeComment.value) { case 'caseComment': @@ -144,7 +190,7 @@ featureCaseStore.getCaseCounts(props.caseId); break; case 'executiveComment': - await initCommentList(); + await initTestPlanExecuteCommentList(); featureCaseStore.getCaseCounts(props.caseId); break; default: @@ -204,6 +250,20 @@ }); } + // 去测试计划页面 + function toPlan(record: CommentItem) { + router.push({ + name: TestPlanRouteEnum.TEST_PLAN_INDEX_DETAIL, + query: { + ...route.query, + id: record.testPlanId, + }, + state: { + params: JSON.stringify(record.moduleName), + }, + }); + } + watch( () => activeComment.value, (val) => { diff --git a/frontend/src/views/case-management/caseManagementFeature/locale/en-US.ts b/frontend/src/views/case-management/caseManagementFeature/locale/en-US.ts index c5de188fde..bb07de77e0 100644 --- a/frontend/src/views/case-management/caseManagementFeature/locale/en-US.ts +++ b/frontend/src/views/case-management/caseManagementFeature/locale/en-US.ts @@ -277,4 +277,7 @@ export default { 'caseManagement.featureCase.deleteFileTip': 'After deletion, the file cannot be restored. Please operate with caution!', 'caseManagement.featureCase.nameNotNull': 'The name can not be null!', + 'caseManagement.featureCase.execute.success': 'SUCCESS', + 'caseManagement.featureCase.execute.failed': 'ERROR', + 'caseManagement.featureCase.execute.blocked': 'BLOCKED', }; diff --git a/frontend/src/views/case-management/caseManagementFeature/locale/zh-CN.ts b/frontend/src/views/case-management/caseManagementFeature/locale/zh-CN.ts index 29fe82b94b..5454b7c2fe 100644 --- a/frontend/src/views/case-management/caseManagementFeature/locale/zh-CN.ts +++ b/frontend/src/views/case-management/caseManagementFeature/locale/zh-CN.ts @@ -272,4 +272,7 @@ export default { 'caseManagement.featureCase.deleteFile': '确认删除文件 {name} 吗', 'caseManagement.featureCase.deleteFileTip': '删除后,文件无法恢复,请谨慎操作!', 'caseManagement.featureCase.nameNotNull': '用例名称不能为空!', + 'caseManagement.featureCase.execute.success': '成功', + 'caseManagement.featureCase.execute.failed': '失败', + 'caseManagement.featureCase.execute.blocked': '阻塞', };