fix(测试计划): 修复接口用例重复关联case问题
--bug=1044413 --user=王旭 【测试计划】测试规划-接口用例-选中模块后再取消勾选一个接口关联数据错误 https://www.tapd.cn/55049933/s/1553561
This commit is contained in:
parent
63d9b09831
commit
6373a4a5f7
|
@ -108,5 +108,5 @@ public interface ExtApiTestCaseMapper {
|
|||
|
||||
List<ApiTestCase> getListBySelectIds(@Param("projectId") String projectId, @Param("ids") List<String> ids, @Param("testPlanId") String testPlanId, @Param("protocols") List<String> protocols);
|
||||
|
||||
List<ApiTestCase> getCaseListBySelectIds(@Param("projectId") String projectId, @Param("ids") List<String> ids, @Param("testPlanId") String testPlanId, @Param("protocols") List<String> protocols);
|
||||
List<ApiTestCase> getCaseListBySelectIds(@Param("isRepeat") boolean isRepeat, @Param("projectId") String projectId, @Param("ids") List<String> ids, @Param("testPlanId") String testPlanId, @Param("protocols") List<String> protocols);
|
||||
}
|
|
@ -712,6 +712,11 @@
|
|||
#{protocol}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="!isRepeat">
|
||||
AND api_test_case.id not in (
|
||||
select api_case_id from test_plan_api_case where test_plan_id = #{testPlanId}
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
@ -644,7 +644,7 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
|||
if (CollectionUtils.isNotEmpty(dto.getSelectIds())) {
|
||||
CollectionUtils.removeAll(dto.getSelectIds(), apiTestCaseList.stream().map(ApiTestCase::getId).toList());
|
||||
//获取选中的ids数据
|
||||
List<ApiTestCase> selectIdList = extApiTestCaseMapper.getCaseListBySelectIds(apiCase.getModules().getProjectId(), dto.getSelectIds(), testPlan.getId(), apiCase.getModules().getProtocols());
|
||||
List<ApiTestCase> selectIdList = extApiTestCaseMapper.getCaseListBySelectIds(isRepeat, apiCase.getModules().getProjectId(), dto.getSelectIds(), testPlan.getId(), apiCase.getModules().getProtocols());
|
||||
apiTestCaseList.addAll(selectIdList);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue