refactor(测试计划): 增加测试集脑图关联用例参数
This commit is contained in:
parent
e48c01a8aa
commit
a498986752
|
@ -19,4 +19,7 @@ public class TestPlanCaseMinderRequest extends BasePlanCaseBatchRequest {
|
||||||
|
|
||||||
@Schema(description = "脑图选中的项目id集合")
|
@Schema(description = "脑图选中的项目id集合")
|
||||||
private List<String> minderProjectIds;
|
private List<String> minderProjectIds;
|
||||||
|
|
||||||
|
@Schema(description = "脑图选中的测试集id集合")
|
||||||
|
private List<String> minderCollectionIds;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ public interface ExtTestPlanFunctionalCaseMapper {
|
||||||
|
|
||||||
List<TestPlanResourceExecResultDTO> selectDistinctExecResultByTestPlanIds(@Param("testPlanIds") List<String> testPlanIds);
|
List<TestPlanResourceExecResultDTO> selectDistinctExecResultByTestPlanIds(@Param("testPlanIds") List<String> testPlanIds);
|
||||||
|
|
||||||
Collection<String> selectIdsByProjectIds(@Param("request") TestPlanCaseMinderRequest request);
|
Collection<String> selectIdsByProjectIdsOrCollectionIds(@Param("request") TestPlanCaseMinderRequest request);
|
||||||
|
|
||||||
List<FunctionalCaseModule> selectProjectByModuleIds(@Param("moduleIds") List<String> moduleIds);
|
List<FunctionalCaseModule> selectProjectByModuleIds(@Param("moduleIds") List<String> moduleIds);
|
||||||
|
|
||||||
|
|
|
@ -672,7 +672,7 @@
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectIdsByProjectIds" resultType="java.lang.String">
|
<select id="selectIdsByProjectIdsOrCollectionIds" resultType="java.lang.String">
|
||||||
SELECT
|
SELECT
|
||||||
test_plan_functional_case.id
|
test_plan_functional_case.id
|
||||||
FROM
|
FROM
|
||||||
|
@ -682,10 +682,18 @@
|
||||||
test_plan_functional_case.test_plan_id = #{request.testPlanId}
|
test_plan_functional_case.test_plan_id = #{request.testPlanId}
|
||||||
AND functional_case.deleted = false
|
AND functional_case.deleted = false
|
||||||
<include refid="queryWhereConditionByBatchQueryRequest"/>
|
<include refid="queryWhereConditionByBatchQueryRequest"/>
|
||||||
and functional_case.project_id in
|
<if test="request.getMinderProjectIds() != null and request.getMinderProjectIds().size() > 0">
|
||||||
<foreach collection="request.getMinderProjectIds()" item="projectId" open="(" separator="," close=")">
|
and functional_case.project_id in
|
||||||
#{projectId}
|
<foreach collection="request.getMinderProjectIds()" item="projectId" open="(" separator="," close=")">
|
||||||
</foreach>
|
#{projectId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="request.getMinderCollectionIds() != null and request.getMinderCollectionIds().size() > 0">
|
||||||
|
and test_plan_functional_case.test_plan_collection_id IN
|
||||||
|
<foreach collection="request.getMinderCollectionIds()" item="collectionId" separator="," open="(" close=")">
|
||||||
|
#{collectionId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectProjectByModuleIds" resultType="io.metersphere.functional.domain.FunctionalCaseModule">
|
<select id="selectProjectByModuleIds" resultType="io.metersphere.functional.domain.FunctionalCaseModule">
|
||||||
|
|
|
@ -56,9 +56,9 @@ public class TestPlanFunctionalCaseMinderService {
|
||||||
return ids;
|
return ids;
|
||||||
} else {
|
} else {
|
||||||
List<String> ids = new ArrayList<>();
|
List<String> ids = new ArrayList<>();
|
||||||
//项目
|
//项目 或 测试集
|
||||||
if (CollectionUtils.isNotEmpty(request.getMinderProjectIds())) {
|
if (CollectionUtils.isNotEmpty(request.getMinderProjectIds()) || CollectionUtils.isNotEmpty(request.getMinderCollectionIds())) {
|
||||||
ids.addAll(extTestPlanFunctionalCaseMapper.selectIdsByProjectIds(request));
|
ids.addAll(extTestPlanFunctionalCaseMapper.selectIdsByProjectIdsOrCollectionIds(request));
|
||||||
}
|
}
|
||||||
//模块
|
//模块
|
||||||
if (CollectionUtils.isNotEmpty(request.getMinderModuleIds())) {
|
if (CollectionUtils.isNotEmpty(request.getMinderModuleIds())) {
|
||||||
|
|
|
@ -529,6 +529,7 @@ public class TestPlanCaseControllerTests extends BaseTest {
|
||||||
request.setMinderProjectIds(List.of("123"));
|
request.setMinderProjectIds(List.of("123"));
|
||||||
request.setMinderModuleIds(List.of("t_1"));
|
request.setMinderModuleIds(List.of("t_1"));
|
||||||
request.setMinderCaseIds(List.of("fc_1"));
|
request.setMinderCaseIds(List.of("fc_1"));
|
||||||
|
request.setMinderCollectionIds(List.of("123"));
|
||||||
paramMap = new LinkedMultiValueMap<>();
|
paramMap = new LinkedMultiValueMap<>();
|
||||||
paramMap.add("request", JSON.toJSONString(request));
|
paramMap.add("request", JSON.toJSONString(request));
|
||||||
paramMap.add("files", files);
|
paramMap.add("files", files);
|
||||||
|
|
Loading…
Reference in New Issue