refactor(功能用例): 功能用例增加各个评论数量
This commit is contained in:
parent
86cbd0efbb
commit
430b0add87
|
@ -1,5 +1,6 @@
|
||||||
package io.metersphere.functional.dto;
|
package io.metersphere.functional.dto;
|
||||||
|
|
||||||
|
import io.metersphere.system.dto.sdk.OptionDTO;
|
||||||
import io.metersphere.system.dto.sdk.TemplateCustomFieldDTO;
|
import io.metersphere.system.dto.sdk.TemplateCustomFieldDTO;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -116,6 +117,9 @@ public class FunctionalCaseDetailDTO implements Serializable {
|
||||||
@Schema(description = "评论总数量")
|
@Schema(description = "评论总数量")
|
||||||
private Integer commentCount;
|
private Integer commentCount;
|
||||||
|
|
||||||
|
@Schema(description = "各种评论数量集合")
|
||||||
|
private List<OptionDTO> commentList;
|
||||||
|
|
||||||
@Schema(description = "变更历史数量")
|
@Schema(description = "变更历史数量")
|
||||||
private Integer historyCount;
|
private Integer historyCount;
|
||||||
|
|
||||||
|
|
|
@ -450,7 +450,7 @@ public class FunctionalCaseMinderService {
|
||||||
List<MindAdditionalNodeRequest> updateList = resourceMap.get(OperationLogType.UPDATE.toString());
|
List<MindAdditionalNodeRequest> updateList = resourceMap.get(OperationLogType.UPDATE.toString());
|
||||||
if (CollectionUtils.isNotEmpty(updateList)) {
|
if (CollectionUtils.isNotEmpty(updateList)) {
|
||||||
List<MindAdditionalNode> nodes = new ArrayList<>();
|
List<MindAdditionalNode> nodes = new ArrayList<>();
|
||||||
Map<String, List<MindAdditionalNode>> parentModuleMap = getParentNodeMap(addList);
|
Map<String, List<MindAdditionalNode>> parentModuleMap = getParentNodeMap(updateList);
|
||||||
for (MindAdditionalNodeRequest mindAdditionalNodeRequest : updateList) {
|
for (MindAdditionalNodeRequest mindAdditionalNodeRequest : updateList) {
|
||||||
MindAdditionalNode updateModule = updateNode(userId, mindAdditionalNodeRequest, additionalNodeMapper);
|
MindAdditionalNode updateModule = updateNode(userId, mindAdditionalNodeRequest, additionalNodeMapper);
|
||||||
nodes.add(updateModule);
|
nodes.add(updateModule);
|
||||||
|
|
|
@ -428,16 +428,30 @@ public class FunctionalCaseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取评论总数量数量
|
//获取评论总数量数量
|
||||||
CaseReviewHistoryExample caseReviewHistoryExample = new CaseReviewHistoryExample();
|
List<OptionDTO>commentList = new ArrayList<>();
|
||||||
caseReviewHistoryExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId());
|
|
||||||
long reviewComment = caseReviewHistoryMapper.countByExample(caseReviewHistoryExample);
|
|
||||||
FunctionalCaseCommentExample functionalCaseCommentExample = new FunctionalCaseCommentExample();
|
FunctionalCaseCommentExample functionalCaseCommentExample = new FunctionalCaseCommentExample();
|
||||||
functionalCaseCommentExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId());
|
functionalCaseCommentExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId());
|
||||||
long caseComment = functionalCaseCommentMapper.countByExample(functionalCaseCommentExample);
|
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 testPlanCaseExecuteHistoryExample = new TestPlanCaseExecuteHistoryExample();
|
||||||
testPlanCaseExecuteHistoryExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId());
|
testPlanCaseExecuteHistoryExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId());
|
||||||
long testPlanExecuteComment = testPlanCaseExecuteHistoryMapper.countByExample(testPlanCaseExecuteHistoryExample);
|
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;
|
long commentCount = caseComment + reviewComment + testPlanExecuteComment;
|
||||||
functionalCaseDetailDTO.setCommentCount((int) commentCount);
|
functionalCaseDetailDTO.setCommentCount((int) commentCount);
|
||||||
//获取变更历史数量数量
|
//获取变更历史数量数量
|
||||||
|
|
Loading…
Reference in New Issue