diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseDetailDTO.java b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseDetailDTO.java index f716996c36..a427a4c5ed 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseDetailDTO.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/dto/FunctionalCaseDetailDTO.java @@ -1,5 +1,6 @@ package io.metersphere.functional.dto; +import io.metersphere.system.dto.sdk.OptionDTO; import io.metersphere.system.dto.sdk.TemplateCustomFieldDTO; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -116,6 +117,9 @@ public class FunctionalCaseDetailDTO implements Serializable { @Schema(description = "评论总数量") private Integer commentCount; + @Schema(description = "各种评论数量集合") + private List commentList; + @Schema(description = "变更历史数量") private Integer historyCount; diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java index cbea95d49a..7e1bc80152 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseMinderService.java @@ -450,7 +450,7 @@ public class FunctionalCaseMinderService { List updateList = resourceMap.get(OperationLogType.UPDATE.toString()); if (CollectionUtils.isNotEmpty(updateList)) { List nodes = new ArrayList<>(); - Map> parentModuleMap = getParentNodeMap(addList); + Map> parentModuleMap = getParentNodeMap(updateList); for (MindAdditionalNodeRequest mindAdditionalNodeRequest : updateList) { MindAdditionalNode updateModule = updateNode(userId, mindAdditionalNodeRequest, additionalNodeMapper); nodes.add(updateModule); 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 8d52838cc3..95248dcec7 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 @@ -428,16 +428,30 @@ public class FunctionalCaseService { } //获取评论总数量数量 - CaseReviewHistoryExample caseReviewHistoryExample = new CaseReviewHistoryExample(); - caseReviewHistoryExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId()); - long reviewComment = caseReviewHistoryMapper.countByExample(caseReviewHistoryExample); + ListcommentList = new ArrayList<>(); FunctionalCaseCommentExample functionalCaseCommentExample = new FunctionalCaseCommentExample(); functionalCaseCommentExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId()); long caseComment = functionalCaseCommentMapper.countByExample(functionalCaseCommentExample); + OptionDTO caseOption = new OptionDTO(); + caseOption.setId("caseComment"); + caseOption.setName(String.valueOf(caseComment)); + commentList.add(0,caseOption); + CaseReviewHistoryExample caseReviewHistoryExample = new CaseReviewHistoryExample(); + caseReviewHistoryExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId()); + long reviewComment = caseReviewHistoryMapper.countByExample(caseReviewHistoryExample); + OptionDTO reviewOption = new OptionDTO(); + reviewOption.setId("reviewComment"); + reviewOption.setName(String.valueOf(reviewComment)); + commentList.add(1,reviewOption); //获取关联测试计划的执行评论数量 TestPlanCaseExecuteHistoryExample testPlanCaseExecuteHistoryExample = new TestPlanCaseExecuteHistoryExample(); testPlanCaseExecuteHistoryExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId()); long testPlanExecuteComment = testPlanCaseExecuteHistoryMapper.countByExample(testPlanCaseExecuteHistoryExample); + OptionDTO executeOption = new OptionDTO(); + executeOption.setId("executiveComment"); + executeOption.setName(String.valueOf(reviewComment)); + commentList.add(2,executeOption); + functionalCaseDetailDTO.setCommentList(commentList); long commentCount = caseComment + reviewComment + testPlanExecuteComment; functionalCaseDetailDTO.setCommentCount((int) commentCount); //获取变更历史数量数量