fix(用例管理):用例评审详情页模块显示多个项目的模块树
This commit is contained in:
parent
9ebe3a657b
commit
21a711e954
|
@ -61,12 +61,12 @@ public class CaseReviewFunctionalCaseController {
|
|||
}
|
||||
|
||||
|
||||
@GetMapping("/tree/{projectId}/{reviewId}")
|
||||
@GetMapping("/tree/{reviewId}")
|
||||
@Operation(summary = "用例管理-用例评审-评审列表-评审详情-已关联用例列表模块树")
|
||||
@RequiresPermissions(PermissionConstants.CASE_REVIEW_READ)
|
||||
@CheckOwner(resourceId = "#projectId", resourceType = "project")
|
||||
public List<BaseTreeNode> getTree(@PathVariable String projectId, @PathVariable String reviewId) {
|
||||
return caseReviewFunctionalCaseService.getTree(projectId, reviewId);
|
||||
@CheckOwner(resourceId = "#reviewId", resourceType = "case_review")
|
||||
public List<BaseTreeNode> getTree(@PathVariable String reviewId) {
|
||||
return caseReviewFunctionalCaseService.getTree(reviewId);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package io.metersphere.functional.dto;
|
||||
|
||||
import io.metersphere.project.dto.ModuleCountDTO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FunctionalCaseModuleCountDTO extends ModuleCountDTO {
|
||||
@Schema(description = "项目id")
|
||||
private String projectId;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package io.metersphere.functional.dto;
|
||||
|
||||
import io.metersphere.functional.domain.FunctionalCaseModule;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FunctionalCaseModuleDTO extends FunctionalCaseModule {
|
||||
@Schema(description = "项目名称")
|
||||
private String projectName;
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
package io.metersphere.functional.mapper;
|
||||
|
||||
import io.metersphere.functional.domain.CaseReviewFunctionalCase;
|
||||
import io.metersphere.functional.dto.FunctionalCaseModuleCountDTO;
|
||||
import io.metersphere.functional.dto.FunctionalCaseReviewDTO;
|
||||
import io.metersphere.functional.dto.ReviewFunctionalCaseDTO;
|
||||
import io.metersphere.functional.request.BaseReviewCaseBatchRequest;
|
||||
import io.metersphere.functional.request.FunctionalCaseReviewListRequest;
|
||||
import io.metersphere.functional.request.ReviewFunctionalCasePageRequest;
|
||||
import io.metersphere.project.dto.ModuleCountDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -41,7 +41,8 @@ public interface ExtCaseReviewFunctionalCaseMapper {
|
|||
|
||||
List<CaseReviewFunctionalCase> getCaseIdsByIds(@Param("ids") List<String> ids);
|
||||
|
||||
List<ModuleCountDTO> countModuleIdByRequest(@Param("request") ReviewFunctionalCasePageRequest request, @Param("deleted") boolean deleted, @Param("userId") String userId);
|
||||
List<FunctionalCaseModuleCountDTO> countModuleIdByRequest(@Param("request") ReviewFunctionalCasePageRequest request, @Param("deleted") boolean deleted, @Param("userId") String userId);
|
||||
|
||||
long caseCount(@Param("request") ReviewFunctionalCasePageRequest request, @Param("deleted") boolean deleted, @Param("userId") String userId);
|
||||
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
WHERE
|
||||
review_id = #{request.reviewId}
|
||||
AND functional_case.deleted = #{deleted}
|
||||
AND functional_case.project_id = #{request.projectId}
|
||||
<if test="userId != null and userId != ''">
|
||||
AND crfc.case_id in (select case_id from case_review_functional_case_user crfcu where crfcu.review_id = #{request.reviewId} and crfcu.user_id = #{userId})
|
||||
</if>
|
||||
|
@ -382,14 +381,15 @@
|
|||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="countModuleIdByRequest" resultType="io.metersphere.project.dto.ModuleCountDTO">
|
||||
SELECT functional_case.module_id AS moduleId, count(functional_case.id) AS dataCount
|
||||
FROM case_review_functional_case crfc LEFT JOIN functional_case ON crfc.case_id = functional_case.id
|
||||
<select id="countModuleIdByRequest" resultType="io.metersphere.functional.dto.FunctionalCaseModuleCountDTO">
|
||||
SELECT functional_case.module_id AS moduleId, count(functional_case.id) AS dataCount, functional_case.project_id AS projectId, project.name AS projectName
|
||||
FROM case_review_functional_case crfc
|
||||
LEFT JOIN functional_case ON crfc.case_id = functional_case.id
|
||||
LEFT JOIN project ON functional_case.project_id = project.id
|
||||
WHERE crfc.review_id = #{request.reviewId}
|
||||
AND functional_case.deleted = #{deleted}
|
||||
AND functional_case.project_id = #{request.projectId}
|
||||
<if test="userId != null and userId != ''">
|
||||
AND crfc.case_id in (select case_id from case_review_functional_case_user crfcu where crfcu.review_id = #{request.reviewId} and crfcu.user_id = #{userId})
|
||||
AND crfc.case_id in (select crfcu.case_id from case_review_functional_case_user crfcu where crfcu.review_id = #{request.reviewId} and crfcu.user_id = #{userId})
|
||||
</if>
|
||||
<choose>
|
||||
<when test='request.searchMode == "AND"'>
|
||||
|
@ -410,7 +410,6 @@
|
|||
FROM case_review_functional_case crfc LEFT JOIN functional_case ON crfc.case_id = functional_case.id
|
||||
WHERE crfc.review_id = #{request.reviewId}
|
||||
AND functional_case.deleted = #{deleted}
|
||||
AND functional_case.project_id = #{request.projectId}
|
||||
<if test="userId != null and userId != ''">
|
||||
AND crfc.case_id in (select case_id from case_review_functional_case_user crfcu where crfcu.review_id = #{request.reviewId} and crfcu.user_id = #{userId})
|
||||
</if>
|
||||
|
@ -426,4 +425,5 @@
|
|||
</choose>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -1,5 +1,6 @@
|
|||
package io.metersphere.functional.mapper;
|
||||
|
||||
import io.metersphere.functional.dto.FunctionalCaseModuleDTO;
|
||||
import io.metersphere.project.dto.NodeSortQueryParam;
|
||||
import io.metersphere.request.AssociateCaseModuleRequest;
|
||||
import io.metersphere.system.dto.sdk.BaseModule;
|
||||
|
@ -11,7 +12,7 @@ import java.util.List;
|
|||
public interface ExtFunctionalCaseModuleMapper {
|
||||
List<BaseTreeNode> selectBaseByProjectId(@Param("projectId")String projectId);
|
||||
|
||||
List<String> selectBaseByProjectIdAndReviewId(@Param("projectId")String projectId, @Param("reviewId")String reviewId);
|
||||
List<FunctionalCaseModuleDTO> selectBaseByProjectIdAndReviewId(@Param("reviewId")String reviewId);
|
||||
|
||||
List<BaseTreeNode> selectBaseByIds(@Param("ids") List<String> ids);
|
||||
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
WHERE project_id = #{projectId}
|
||||
ORDER BY pos
|
||||
</select>
|
||||
<select id="selectBaseByProjectIdAndReviewId" resultType="java.lang.String">
|
||||
SELECT fcm.id
|
||||
<select id="selectBaseByProjectIdAndReviewId" resultType="io.metersphere.functional.dto.FunctionalCaseModuleDTO">
|
||||
SELECT fcm.id, fcm.project_id, p.name as projectName
|
||||
FROM functional_case_module fcm
|
||||
WHERE fcm.project_id = #{projectId}
|
||||
AND fcm.id IN
|
||||
LEFT JOIN project p ON fcm.project_id = p.id
|
||||
WHERE fcm.id IN
|
||||
(SELECT fc.module_id FROM functional_case fc LEFT JOIN case_review_functional_case crfc ON crfc.case_id = fc.id WHERE crfc.review_id = #{reviewId} AND fc.deleted = false)
|
||||
ORDER BY pos
|
||||
</select>
|
||||
|
@ -95,10 +95,9 @@
|
|||
</select>
|
||||
|
||||
<select id="selectIdByProjectIdAndReviewId" resultType="java.lang.String">
|
||||
SELECT fcm.id
|
||||
SELECT fcm.id, fcm.project_id
|
||||
FROM functional_case_module fcm
|
||||
WHERE fcm.project_id = #{projectId}
|
||||
AND fcm.id IN
|
||||
WHERE fcm.id IN
|
||||
(SELECT fc.module_id FROM functional_case fc LEFT JOIN case_review_functional_case crfc ON crfc.case_id = fc.id WHERE crfc.review_id = #{reviewId} AND fc.deleted = false)
|
||||
</select>
|
||||
|
||||
|
|
|
@ -6,11 +6,10 @@ import io.metersphere.functional.constants.CaseFileSourceType;
|
|||
import io.metersphere.functional.constants.CaseReviewPassRule;
|
||||
import io.metersphere.functional.constants.FunctionalCaseReviewStatus;
|
||||
import io.metersphere.functional.domain.*;
|
||||
import io.metersphere.functional.dto.CaseReviewHistoryDTO;
|
||||
import io.metersphere.functional.dto.ReviewFunctionalCaseDTO;
|
||||
import io.metersphere.functional.dto.ReviewsDTO;
|
||||
import io.metersphere.functional.dto.*;
|
||||
import io.metersphere.functional.mapper.*;
|
||||
import io.metersphere.functional.request.*;
|
||||
import io.metersphere.project.domain.Project;
|
||||
import io.metersphere.project.domain.ProjectApplication;
|
||||
import io.metersphere.project.domain.ProjectApplicationExample;
|
||||
import io.metersphere.project.domain.ProjectVersion;
|
||||
|
@ -18,8 +17,10 @@ import io.metersphere.project.dto.ModuleCountDTO;
|
|||
import io.metersphere.project.mapper.ExtBaseProjectVersionMapper;
|
||||
import io.metersphere.project.mapper.ProjectApplicationMapper;
|
||||
import io.metersphere.provider.BaseCaseProvider;
|
||||
import io.metersphere.sdk.constants.ModuleConstants;
|
||||
import io.metersphere.sdk.constants.ProjectApplicationType;
|
||||
import io.metersphere.sdk.exception.MSException;
|
||||
import io.metersphere.sdk.util.BeanUtils;
|
||||
import io.metersphere.sdk.util.LogUtils;
|
||||
import io.metersphere.sdk.util.Translator;
|
||||
import io.metersphere.system.dto.sdk.BaseTreeNode;
|
||||
|
@ -586,21 +587,51 @@ public class CaseReviewFunctionalCaseService {
|
|||
}
|
||||
}
|
||||
|
||||
public List<BaseTreeNode> getTree(String projectId, String reviewId) {
|
||||
List<String> functionalModuleIds = extFunctionalCaseModuleMapper.selectBaseByProjectIdAndReviewId(projectId, reviewId);
|
||||
List<BaseTreeNode> nodeByNodeIds = functionalCaseModuleService.getNodeByNodeIds(functionalModuleIds);
|
||||
return functionalCaseModuleService.buildTreeAndCountResource(nodeByNodeIds, true, Translator.get("default.module"));
|
||||
public List<BaseTreeNode> getTree(String reviewId) {
|
||||
List<BaseTreeNode> returnList = new ArrayList<>();
|
||||
List<FunctionalCaseModuleDTO> functionalModuleIds = extFunctionalCaseModuleMapper.selectBaseByProjectIdAndReviewId(reviewId);
|
||||
Map<String, List<FunctionalCaseModuleDTO>> projectModuleMap = functionalModuleIds.stream().collect(Collectors.groupingBy(FunctionalCaseModule::getProjectId));
|
||||
projectModuleMap.forEach((projectId,moduleList)->{
|
||||
BaseTreeNode projectNode = new BaseTreeNode(projectId, moduleList.get(0).getProjectName(), Project.class.getName());
|
||||
returnList.add(projectNode);
|
||||
List<String> projectModuleIds = moduleList.stream().map(FunctionalCaseModule::getId).toList();
|
||||
List<BaseTreeNode> nodeByNodeIds = functionalCaseModuleService.getNodeByNodeIds(projectModuleIds);
|
||||
List<BaseTreeNode> list = nodeByNodeIds.stream().filter(t -> StringUtils.equalsIgnoreCase(t.getId(), ModuleConstants.DEFAULT_NODE_ID.toString())).toList();
|
||||
boolean haveVirtualRootNode = list.isEmpty();
|
||||
List<BaseTreeNode> baseTreeNodes = functionalCaseModuleService.buildTreeAndCountResource(nodeByNodeIds, haveVirtualRootNode, Translator.get("default.module"));
|
||||
for (BaseTreeNode baseTreeNode : baseTreeNodes) {
|
||||
projectNode.addChild(baseTreeNode);
|
||||
}
|
||||
});
|
||||
return returnList;
|
||||
}
|
||||
|
||||
public Map<String, Long> moduleCount(ReviewFunctionalCasePageRequest request, boolean deleted, String userId) {
|
||||
//查出每个模块节点下的资源数量。 不需要按照模块进行筛选
|
||||
request.setModuleIds(null);
|
||||
List<ModuleCountDTO> moduleCountDTOList = extCaseReviewFunctionalCaseMapper.countModuleIdByRequest(request, deleted, userId);
|
||||
Map<String, Long> moduleCountMap = getModuleCountMap(request.getProjectId(), request.getReviewId(), moduleCountDTOList);
|
||||
List<FunctionalCaseModuleCountDTO> projectModuleCountDTOList = extCaseReviewFunctionalCaseMapper.countModuleIdByRequest(request, deleted, userId);
|
||||
Map<String, List<FunctionalCaseModuleCountDTO>> projectCountMap = projectModuleCountDTOList.stream().collect(Collectors.groupingBy(FunctionalCaseModuleCountDTO::getProjectId));
|
||||
Map<String, Long> projectModuleCountMap = new HashMap<>();
|
||||
projectCountMap.forEach((projectId,moduleCountDTOList)->{
|
||||
List<ModuleCountDTO>moduleCountDTOS = new ArrayList<>();
|
||||
for (FunctionalCaseModuleCountDTO functionalCaseModuleCountDTO : moduleCountDTOList) {
|
||||
ModuleCountDTO moduleCountDTO = new ModuleCountDTO();
|
||||
BeanUtils.copyBean(moduleCountDTO,functionalCaseModuleCountDTO);
|
||||
moduleCountDTOS.add(moduleCountDTO);
|
||||
}
|
||||
int sum = moduleCountDTOList.stream().mapToInt(FunctionalCaseModuleCountDTO::getDataCount).sum();
|
||||
Map<String, Long> moduleCountMap = getModuleCountMap(projectId, request.getReviewId(), moduleCountDTOS);
|
||||
moduleCountMap.forEach((k,v)->{
|
||||
if (projectModuleCountMap.get(k)==null || projectModuleCountMap.get(k) == 0L){
|
||||
projectModuleCountMap.put(k,v);
|
||||
}
|
||||
});
|
||||
projectModuleCountMap.put(projectId, (long)sum);
|
||||
});
|
||||
//查出全部用例数量
|
||||
long allCount = extCaseReviewFunctionalCaseMapper.caseCount(request, deleted, userId);
|
||||
moduleCountMap.put(CASE_MODULE_COUNT_ALL, allCount);
|
||||
return moduleCountMap;
|
||||
projectModuleCountMap.put(CASE_MODULE_COUNT_ALL, allCount);
|
||||
return projectModuleCountMap;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -609,6 +640,7 @@ public class CaseReviewFunctionalCaseService {
|
|||
public Map<String, Long> getModuleCountMap(String projectId, String reviewId, List<ModuleCountDTO> moduleCountDTOList) {
|
||||
//构建模块树,并计算每个节点下的所有数量(包含子节点)
|
||||
List<BaseTreeNode> treeNodeList = this.getTreeOnlyIdsAndResourceCount(projectId, reviewId, moduleCountDTOList);
|
||||
|
||||
//通过广度遍历的方式构建返回值
|
||||
return functionalCaseModuleService.getIdCountMapByBreadth(treeNodeList);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import io.metersphere.functional.domain.CaseReviewFunctionalCaseExample;
|
|||
import io.metersphere.functional.dto.ReviewFunctionalCaseDTO;
|
||||
import io.metersphere.functional.mapper.CaseReviewFunctionalCaseMapper;
|
||||
import io.metersphere.functional.request.*;
|
||||
import io.metersphere.sdk.constants.ModuleConstants;
|
||||
import io.metersphere.sdk.constants.SessionConstants;
|
||||
import io.metersphere.sdk.util.JSON;
|
||||
import io.metersphere.system.base.BaseTest;
|
||||
|
@ -142,17 +141,26 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest {
|
|||
@Test
|
||||
@Order(4)
|
||||
public void emptyDataTest() throws Exception {
|
||||
//空数据下,检查模块树
|
||||
List<BaseTreeNode> treeNodes = this.getCaseReviewModuleTreeNode("wx_test_project","wx_review_id_1");
|
||||
//检查有没有默认节点
|
||||
boolean hasNode = false;
|
||||
for (BaseTreeNode baseTreeNode : treeNodes) {
|
||||
if (StringUtils.equals(baseTreeNode.getId(), ModuleConstants.DEFAULT_NODE_ID)) {
|
||||
hasNode = true;
|
||||
}
|
||||
Assertions.assertNotNull(baseTreeNode.getParentId());
|
||||
}
|
||||
Assertions.assertTrue(hasNode);
|
||||
List<BaseTreeNode> treeNodes = this.getCaseReviewModuleTreeNode("wx_test_project","wx_review_id_2");
|
||||
String jsonString = JSON.toJSONString(treeNodes);
|
||||
System.out.println(jsonString);
|
||||
Assertions.assertTrue(CollectionUtils.isNotEmpty(treeNodes));
|
||||
ReviewFunctionalCasePageRequest request = new ReviewFunctionalCasePageRequest();
|
||||
request.setReviewId("wx_review_id_2");
|
||||
request.setProjectId("wx_test_project");
|
||||
request.setCurrent(1);
|
||||
request.setPageSize(10);
|
||||
MvcResult mvcResult = this.requestPostWithOkAndReturn(REVIEW_FUNCTIONAL_CASE_MODULE_COUNT, request);
|
||||
Map<String, Integer> moduleCountResult = JSON.parseObject(JSON.toJSONString(
|
||||
JSON.parseObject(mvcResult.getResponse().getContentAsString(StandardCharsets.UTF_8), ResultHolder.class).getData()),
|
||||
Map.class);
|
||||
System.out.println(JSON.toJSONString(moduleCountResult));
|
||||
|
||||
MvcResult mvcResultPage = this.requestPostWithOkAndReturn(REVIEW_CASE_PAGE, request);
|
||||
Pager<List<ReviewFunctionalCaseDTO>> tableData = JSON.parseObject(JSON.toJSONString(
|
||||
JSON.parseObject(mvcResultPage.getResponse().getContentAsString(StandardCharsets.UTF_8), ResultHolder.class).getData()),
|
||||
Pager.class);
|
||||
System.out.println(JSON.toJSONString(tableData.getList()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -404,7 +412,7 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest {
|
|||
|
||||
|
||||
private List<BaseTreeNode> getCaseReviewModuleTreeNode(String projectId, String reviewId) throws Exception {
|
||||
MvcResult result = mockMvc.perform(MockMvcRequestBuilders.get(URL_MODULE_TREE+"/"+projectId+"/"+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))
|
||||
|
|
|
@ -13,7 +13,12 @@ VALUES ('gyq_case_id_4', 106, 'TEST_MODULE_ID', 'wx_test_project', '100001', '
|
|||
INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time)
|
||||
VALUES ('gyq_case_id_5', 102, 'TEST_MODULE_ID', 'wx_test_project', '100001', '测试多版本', 'UN_REVIEWED', '["测试标签_1"]', 'STEP', 0, 'v1.0.0', 'gyq_case_id_4', 'UN_EXECUTED', b'0', b'0', b'1', 'admin', 'admin', '', 1698058347559, 1698058347559, NULL),
|
||||
('gyq_case_id_7', 102, 'TEST_MODULE_ID_COUNT_three', 'wx_test_project', '100001', '测试模块', 'UN_REVIEWED', '["测试标签_1"]', 'STEP', 0, 'v1.0.0', 'gyq_case_id_7', 'UN_EXECUTED', b'0', b'0', b'1', 'admin', 'admin', '', 1698058347559, 1698058347559, NULL),
|
||||
('gyq_case_id_8', 102, 'TEST_MODULE_ID_COUNT_three', 'wx_test_project', '100001', '测试模块2', 'UN_REVIEWED', '["测试标签_1"]', 'STEP', 0, 'v1.0.0', 'gyq_case_id_8', 'UN_EXECUTED', b'0', b'0', b'1', 'admin', 'admin', '', 1698058347559, 1698058347559, NULL);
|
||||
('gyq_case_id_8', 102, 'TEST_MODULE_ID_COUNT_three', 'wx_test_project', '100001', '测试模块2', 'UN_REVIEWED', '["测试标签_1"]', 'STEP', 0, 'v1.0.0', 'gyq_case_id_8', 'UN_EXECUTED', b'0', b'0', b'1', 'admin', 'admin', '', 1698058347559, 1698058347559, NULL),
|
||||
('gyq_case_id_9', 104, 'TEST_MODULE_ID_COUNT_four', 'wx_test_project_review_two', '100001', '测试模块2-1', 'UN_REVIEWED', '["测试标签_1"]', 'STEP', 0, 'v1.0.0', 'gyq_case_id_9', 'UN_EXECUTED', b'0', b'0', b'1', 'admin', 'admin', '', 1698058347559, 1698058347559, NULL),
|
||||
('gyq_case_id_a', 105, 'TEST_MODULE_ID_COUNT_five', 'wx_test_project_review_two', '100001', '测试模块2-2', 'UN_REVIEWED', '["测试标签_1"]', 'STEP', 0, 'v1.0.0', 'gyq_case_id_a', 'UN_EXECUTED', b'0', b'0', b'1', 'admin', 'admin', '', 1698058347559, 1698058347559, NULL),
|
||||
('gyq_case_id_b', 105, 'TEST_MODULE_ID_COUNT_six', 'wx_test_project_review_one', '100001', '测试模块2-2', 'UN_REVIEWED', '["测试标签_1"]', 'STEP', 0, 'v1.0.0', 'gyq_case_id_a', 'UN_EXECUTED', b'0', b'0', b'1', 'admin', 'admin', '', 1698058347559, 1698058347559, NULL),
|
||||
('gyq_case_id_c', 105, 'TEST_MODULE_ID_COUNT_seven', 'wx_test_project_review_one', '100001', '测试模块2-2', 'UN_REVIEWED', '["测试标签_1"]', 'STEP', 0, 'v1.0.0', 'gyq_case_id_a', 'UN_EXECUTED', b'0', b'0', b'1', 'admin', 'admin', '', 1698058347559, 1698058347559, NULL);
|
||||
|
||||
|
||||
INSERT INTO functional_case(id, num, module_id, project_id, template_id, name, review_status, tags, case_edit_type, pos, version_id, ref_id, last_execute_result, deleted, public_case, latest, create_user, update_user, delete_user, create_time, update_time, delete_time)
|
||||
VALUES ('wx_case_id_3', 104, 'TEST_MODULE_ID', 'wx_test_project', '100001', '测试多版本', 'UN_REVIEWED', '["测试标签_1"]', 'STEP', 0, 'v1.0.0', 'TEST_REF_ID', 'UN_EXECUTED', b'0', b'0', b'1', 'admin', 'admin', '', 1698058347559, 1698058347559, NULL);
|
||||
|
@ -51,7 +56,11 @@ VALUES ('wx_test_1', 'wx_review_id_1', 'wx_case_id_1', 'PASS', 1698058347559,'ad
|
|||
('gyq_test_5', 'wx_review_id_1', 'gyq_case_id_5', 'PASS', 1698058347559,'admin',1698058347559, 2000),
|
||||
('gyq_test_7', 'wx_review_id_1', 'gyq_case_id_7', 'PASS', 1698058347559,'admin',1698058347559, 2000),
|
||||
('gyq_test_8', 'wx_review_id_1', 'gyq_case_id_8', 'PASS', 1698058347559,'admin',1698058347559, 2000),
|
||||
('wx_test_2', 'wx_review_id_2', 'wx_case_id_2', 'PASS', 1698058347559,'admin',1698058347559, 3000),
|
||||
('gyq_test_9', 'wx_review_id_2', 'gyq_case_id_9', 'PASS', 1698058347559,'admin',1698058347559, 2000),
|
||||
('gyq_test_a', 'wx_review_id_2', 'gyq_case_id_a', 'PASS', 1698058347559,'admin',1698058347559, 2000),
|
||||
('gyq_test_b', 'wx_review_id_2', 'gyq_case_id_b', 'PASS', 1698058347559,'admin',1698058347559, 2000),
|
||||
('gyq_test_c', 'wx_review_id_2', 'gyq_case_id_c', 'PASS', 1698058347559,'admin',1698058347559, 2000),
|
||||
('wx_test_2', 'wx_review_id_2', 'wx_case_id_3', 'PASS', 1698058347559,'admin',1698058347559, 3000),
|
||||
('wx_test_3', 'wx_review_id_2', 'wx_case_id_1', 'PASS', 1698058347559,'admin',1698058347559, 3000),
|
||||
('wx_test_4', 'wx_review_id_2', 'wx_case_id_2', 'PASS', 1698058347559,'admin',1698058347559, 3000),
|
||||
('wx_test_5', 'wx_review_id_3', 'wx_case_id_1', 'PASS', 1698058347559,'admin',1698058347559, 3000),
|
||||
|
@ -83,8 +92,17 @@ INSERT INTO case_review_module(id, project_id, name, parent_id, pos, create_time
|
|||
INSERT INTO functional_case_module(id, project_id, name, parent_id, pos, create_time, update_time, create_user, update_user)
|
||||
VALUES ('TEST_MODULE_ID', 'wx_test_project', '测试所属模块', 'NONE', 1568, 1669174143999, 1669174143999, 'admin', 'admin'),
|
||||
('TEST_MODULE_ID_COUNT_ID', 'wx_test_project', '测试所属模块子集', 'TEST_MODULE_ID', 64, 1669174143999, 1669174143999, 'admin', 'admin'),
|
||||
('TEST_MODULE_ID_COUNT_three', 'wx_test_project', '测试所属模块子集2', 'TEST_MODULE_ID_COUNT_ID', 64, 1669174143999, 1669174143999, 'admin', 'admin');
|
||||
('TEST_MODULE_ID_COUNT_three', 'wx_test_project', '测试所属模块子集2', 'TEST_MODULE_ID_COUNT_ID', 64, 1669174143999, 1669174143999, 'admin', 'admin'),
|
||||
('TEST_MODULE_ID_COUNT_six', 'wx_test_project_review_one', '测试多项目模块3', 'NONE', 8, 1669174143999, 1669174143999, 'admin', 'admin'),
|
||||
('TEST_MODULE_ID_COUNT_seven', 'wx_test_project_review_one', '测试多项目模块4', 'TEST_MODULE_ID_COUNT_six', 16, 1669174143999, 1669174143999, 'admin', 'admin'),
|
||||
('TEST_MODULE_ID_COUNT_four', 'wx_test_project_review_two', '测试多项目模块', 'NONE', 56, 1669174143999, 1669174143999, 'admin', 'admin'),
|
||||
('TEST_MODULE_ID_COUNT_five', 'wx_test_project_review_two', '测试多项目模块2', 'TEST_MODULE_ID_COUNT_four', 48, 1669174143999, 1669174143999, 'admin', 'admin');
|
||||
|
||||
INSERT INTO project (id, num, organization_id, name, description, create_user, update_user, create_time, update_time)
|
||||
VALUES ('wx_test_project_review_one', null, 'organization-associate-case-test', '评审跨项目关联用例', '系统默认创建的项目',
|
||||
'admin', 'admin', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000),
|
||||
('wx_test_project_review_two', null, 'organization-associate-case-test', '评审跨项目关联用例2', '系统默认创建的项目',
|
||||
'admin', 'admin', UNIX_TIMESTAMP() * 1000, UNIX_TIMESTAMP() * 1000);
|
||||
|
||||
|
||||
INSERT INTO user(id, name, email, password, create_time, update_time, language, last_organization_id, phone, source,
|
||||
|
|
|
@ -59,6 +59,7 @@ public class BaseTreeNode {
|
|||
}
|
||||
|
||||
public void addChild(BaseTreeNode node) {
|
||||
node.setParentId(this.getId());
|
||||
children.add(node);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue