fix(测试计划): 测试计划搜索问题
--bug=1045573 --user=王旭 【测试测试】功能用例列表-按执行人筛选后-全选所有页-批量修改执行人报500 https://www.tapd.cn/55049933/s/1577066
This commit is contained in:
parent
beb9298dd9
commit
f1c07a1872
|
@ -30,4 +30,7 @@ public class BasePlanCaseBatchRequest extends TableBatchProcessDTO implements Se
|
||||||
|
|
||||||
@Schema(description = "项目Id")
|
@Schema(description = "项目Id")
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
|
||||||
|
@Schema(description = "是否包含空执行人")
|
||||||
|
private boolean nullExecutorKey;
|
||||||
}
|
}
|
||||||
|
|
|
@ -685,8 +685,9 @@
|
||||||
<if test="request.collectionId != null and request.collectionId != ''">
|
<if test="request.collectionId != null and request.collectionId != ''">
|
||||||
and t.test_plan_collection_id = #{request.collectionId}
|
and t.test_plan_collection_id = #{request.collectionId}
|
||||||
</if>
|
</if>
|
||||||
<include refid="filters">
|
<include refid="apiCaseFilters">
|
||||||
<property name="filter" value="request.condition.filter"/>
|
<property name="filter" value="request.condition.filter"/>
|
||||||
|
<property name="nullExecutorKey" value="request.nullExecutorKey"/>
|
||||||
</include>
|
</include>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
|
@ -499,6 +499,7 @@
|
||||||
</if>
|
</if>
|
||||||
<include refid="filters">
|
<include refid="filters">
|
||||||
<property name="filter" value="request.condition.filter"/>
|
<property name="filter" value="request.condition.filter"/>
|
||||||
|
<property name="nullExecutorKey" value="request.nullExecutorKey"/>
|
||||||
</include>
|
</include>
|
||||||
<if test="request.condition.combine != null and request.condition.combine != ''">
|
<if test="request.condition.combine != null and request.condition.combine != ''">
|
||||||
<include refid="combine">
|
<include refid="combine">
|
||||||
|
|
|
@ -204,6 +204,7 @@
|
||||||
</if>
|
</if>
|
||||||
<include refid="filters">
|
<include refid="filters">
|
||||||
<property name="filter" value="request.condition.filter"/>
|
<property name="filter" value="request.condition.filter"/>
|
||||||
|
<property name="nullExecutorKey" value="request.nullExecutorKey"/>
|
||||||
</include>
|
</include>
|
||||||
<choose>
|
<choose>
|
||||||
<when test='request.condition.searchMode == "AND"'>
|
<when test='request.condition.searchMode == "AND"'>
|
||||||
|
|
|
@ -245,7 +245,7 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<TestPlanApiCasePageResponse> hasRelateApiCaseList(TestPlanApiCaseRequest request, boolean deleted, String currentProjectId) {
|
public List<TestPlanApiCasePageResponse> hasRelateApiCaseList(TestPlanApiCaseRequest request, boolean deleted, String currentProjectId) {
|
||||||
filterCaseRequest(request);
|
request.setNullExecutorKey(filterCaseRequest(request.getFilter()));
|
||||||
if (CollectionUtils.isEmpty(request.getProtocols())) {
|
if (CollectionUtils.isEmpty(request.getProtocols())) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
@ -356,7 +356,7 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||||
if (CollectionUtils.isEmpty(request.getProtocols())) {
|
if (CollectionUtils.isEmpty(request.getProtocols())) {
|
||||||
return Collections.emptyMap();
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
filterCaseRequest(request);
|
request.setNullExecutorKey(filterCaseRequest(request.getFilter()));
|
||||||
switch (request.getTreeType()) {
|
switch (request.getTreeType()) {
|
||||||
case TreeTypeEnums.MODULE:
|
case TreeTypeEnums.MODULE:
|
||||||
return getModuleCount(request);
|
return getModuleCount(request);
|
||||||
|
@ -545,6 +545,7 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||||
|
|
||||||
public List<String> doSelectIds(TestPlanApiCaseBatchRequest request) {
|
public List<String> doSelectIds(TestPlanApiCaseBatchRequest request) {
|
||||||
if (request.isSelectAll()) {
|
if (request.isSelectAll()) {
|
||||||
|
request.setNullExecutorKey(filterCaseRequest(request.getCondition().getFilter()));
|
||||||
List<String> ids = extTestPlanApiCaseMapper.getIds(request, false);
|
List<String> ids = extTestPlanApiCaseMapper.getIds(request, false);
|
||||||
if (CollectionUtils.isNotEmpty(request.getExcludeIds())) {
|
if (CollectionUtils.isNotEmpty(request.getExcludeIds())) {
|
||||||
ids.removeAll(request.getExcludeIds());
|
ids.removeAll(request.getExcludeIds());
|
||||||
|
@ -919,17 +920,16 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||||
/**
|
/**
|
||||||
* 处理执行人为空过滤参数
|
* 处理执行人为空过滤参数
|
||||||
*
|
*
|
||||||
* @param request 请求参数
|
* @param filter 请求参数
|
||||||
*/
|
*/
|
||||||
protected void filterCaseRequest(TestPlanApiCaseRequest request) {
|
protected boolean filterCaseRequest(Map<String, List<String>> filter) {
|
||||||
Map<String, List<String>> filter = request.getFilter();
|
|
||||||
if (filter != null && filter.containsKey(EXECUTOR)) {
|
if (filter != null && filter.containsKey(EXECUTOR)) {
|
||||||
List<String> filterExecutorIds = filter.get(EXECUTOR);
|
List<String> filterExecutorIds = filter.get(EXECUTOR);
|
||||||
if (CollectionUtils.isNotEmpty(filterExecutorIds)) {
|
if (CollectionUtils.isNotEmpty(filterExecutorIds)) {
|
||||||
boolean containNullKey = filterExecutorIds.removeIf(id -> StringUtils.equals(id, "-"));
|
return filterExecutorIds.contains("-");
|
||||||
request.setNullExecutorKey(containNullKey);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void batchAssociateBug(TestPlanApiCaseBatchAddBugRequest request, String bugId, String userId) {
|
public void batchAssociateBug(TestPlanApiCaseBatchAddBugRequest request, String bugId, String userId) {
|
||||||
|
|
|
@ -387,7 +387,7 @@ public class TestPlanApiScenarioService extends TestPlanResourceService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<TestPlanApiScenarioPageResponse> hasRelateApiScenarioList(TestPlanApiScenarioRequest request, boolean deleted, String currentProjectId) {
|
public List<TestPlanApiScenarioPageResponse> hasRelateApiScenarioList(TestPlanApiScenarioRequest request, boolean deleted, String currentProjectId) {
|
||||||
filterCaseRequest(request);
|
request.setNullExecutorKey(filterCaseRequest(request.getFilter()));
|
||||||
List<TestPlanApiScenarioPageResponse> list = extTestPlanApiScenarioMapper.relateApiScenarioList(request, deleted);
|
List<TestPlanApiScenarioPageResponse> list = extTestPlanApiScenarioMapper.relateApiScenarioList(request, deleted);
|
||||||
buildApiScenarioResponse(list, request.getTestPlanId(), currentProjectId);
|
buildApiScenarioResponse(list, request.getTestPlanId(), currentProjectId);
|
||||||
return list;
|
return list;
|
||||||
|
@ -505,7 +505,7 @@ public class TestPlanApiScenarioService extends TestPlanResourceService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Long> moduleCount(TestPlanApiScenarioModuleRequest request) {
|
public Map<String, Long> moduleCount(TestPlanApiScenarioModuleRequest request) {
|
||||||
filterCaseRequest(request);
|
request.setNullExecutorKey(filterCaseRequest(request.getFilter()));
|
||||||
switch (request.getTreeType()) {
|
switch (request.getTreeType()) {
|
||||||
case TreeTypeEnums.MODULE:
|
case TreeTypeEnums.MODULE:
|
||||||
return getModuleCount(request);
|
return getModuleCount(request);
|
||||||
|
@ -682,6 +682,7 @@ public class TestPlanApiScenarioService extends TestPlanResourceService {
|
||||||
|
|
||||||
public List<String> doSelectIds(BasePlanCaseBatchRequest request) {
|
public List<String> doSelectIds(BasePlanCaseBatchRequest request) {
|
||||||
if (request.isSelectAll()) {
|
if (request.isSelectAll()) {
|
||||||
|
request.setNullExecutorKey(filterCaseRequest(request.getCondition().getFilter()));
|
||||||
List<String> ids = extTestPlanApiScenarioMapper.getIds(request, false);
|
List<String> ids = extTestPlanApiScenarioMapper.getIds(request, false);
|
||||||
if (CollectionUtils.isNotEmpty(request.getExcludeIds())) {
|
if (CollectionUtils.isNotEmpty(request.getExcludeIds())) {
|
||||||
ids.removeAll(request.getExcludeIds());
|
ids.removeAll(request.getExcludeIds());
|
||||||
|
@ -774,17 +775,16 @@ public class TestPlanApiScenarioService extends TestPlanResourceService {
|
||||||
/**
|
/**
|
||||||
* 处理执行人为空过滤参数
|
* 处理执行人为空过滤参数
|
||||||
*
|
*
|
||||||
* @param request 请求参数
|
* @param filter 请求参数
|
||||||
*/
|
*/
|
||||||
protected void filterCaseRequest(TestPlanApiScenarioRequest request) {
|
protected boolean filterCaseRequest(Map<String, List<String>> filter) {
|
||||||
Map<String, List<String>> filter = request.getFilter();
|
|
||||||
if (filter != null && filter.containsKey(EXECUTOR)) {
|
if (filter != null && filter.containsKey(EXECUTOR)) {
|
||||||
List<String> filterExecutorIds = filter.get(EXECUTOR);
|
List<String> filterExecutorIds = filter.get(EXECUTOR);
|
||||||
if (CollectionUtils.isNotEmpty(filterExecutorIds)) {
|
if (CollectionUtils.isNotEmpty(filterExecutorIds)) {
|
||||||
boolean containNullKey = filterExecutorIds.removeIf(id -> StringUtils.equals(id, "-"));
|
return filterExecutorIds.contains("-");
|
||||||
request.setNullExecutorKey(containNullKey);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void batchAssociateBug(TestPlanScenarioBatchAddBugRequest request, String bugId, String userId) {
|
public void batchAssociateBug(TestPlanScenarioBatchAddBugRequest request, String bugId, String userId) {
|
||||||
|
|
|
@ -243,7 +243,7 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService {
|
||||||
|
|
||||||
|
|
||||||
public List<TestPlanCasePageResponse> getFunctionalCasePage(TestPlanCaseRequest request, boolean deleted, String projectId) {
|
public List<TestPlanCasePageResponse> getFunctionalCasePage(TestPlanCaseRequest request, boolean deleted, String projectId) {
|
||||||
filterCaseRequest(request);
|
request.setNullExecutorKey(filterCaseRequest(request.getFilter()));
|
||||||
List<TestPlanCasePageResponse> functionalCaseLists = extTestPlanFunctionalCaseMapper.getCasePage(request, deleted, request.getSortString());
|
List<TestPlanCasePageResponse> functionalCaseLists = extTestPlanFunctionalCaseMapper.getCasePage(request, deleted, request.getSortString());
|
||||||
if (CollectionUtils.isEmpty(functionalCaseLists)) {
|
if (CollectionUtils.isEmpty(functionalCaseLists)) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
|
@ -369,7 +369,7 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService {
|
||||||
|
|
||||||
|
|
||||||
public Map<String, Long> moduleCount(TestPlanCaseModuleRequest request) {
|
public Map<String, Long> moduleCount(TestPlanCaseModuleRequest request) {
|
||||||
filterCaseRequest(request);
|
request.setNullExecutorKey(filterCaseRequest(request.getFilter()));
|
||||||
switch (request.getTreeType()) {
|
switch (request.getTreeType()) {
|
||||||
case TreeTypeEnums.MODULE:
|
case TreeTypeEnums.MODULE:
|
||||||
return getModuleCount(request);
|
return getModuleCount(request);
|
||||||
|
@ -464,6 +464,7 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService {
|
||||||
|
|
||||||
public List<String> doSelectIds(BasePlanCaseBatchRequest request) {
|
public List<String> doSelectIds(BasePlanCaseBatchRequest request) {
|
||||||
if (request.isSelectAll()) {
|
if (request.isSelectAll()) {
|
||||||
|
request.setNullExecutorKey(filterCaseRequest(request.getCondition().getFilter()));
|
||||||
List<String> ids = extTestPlanFunctionalCaseMapper.getIds(request, false);
|
List<String> ids = extTestPlanFunctionalCaseMapper.getIds(request, false);
|
||||||
if (CollectionUtils.isNotEmpty(request.getExcludeIds())) {
|
if (CollectionUtils.isNotEmpty(request.getExcludeIds())) {
|
||||||
ids.removeAll(request.getExcludeIds());
|
ids.removeAll(request.getExcludeIds());
|
||||||
|
@ -932,17 +933,16 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService {
|
||||||
/**
|
/**
|
||||||
* 处理执行人为空过滤参数
|
* 处理执行人为空过滤参数
|
||||||
*
|
*
|
||||||
* @param request 请求参数
|
* @param filter 请求参数
|
||||||
*/
|
*/
|
||||||
protected void filterCaseRequest(TestPlanCaseRequest request) {
|
protected boolean filterCaseRequest(Map<String, List<String>> filter) {
|
||||||
Map<String, List<String>> filter = request.getFilter();
|
|
||||||
if (filter != null && filter.containsKey(EXECUTOR)) {
|
if (filter != null && filter.containsKey(EXECUTOR)) {
|
||||||
List<String> filterExecutorIds = filter.get(EXECUTOR);
|
List<String> filterExecutorIds = filter.get(EXECUTOR);
|
||||||
if (CollectionUtils.isNotEmpty(filterExecutorIds)) {
|
if (CollectionUtils.isNotEmpty(filterExecutorIds)) {
|
||||||
boolean containNullKey = filterExecutorIds.removeIf(id -> StringUtils.equals(id, "-"));
|
return filterExecutorIds.contains("-");
|
||||||
request.setNullExecutorKey(containNullKey);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void batchAssociateBug(TestPlanCaseBatchAddBugRequest request, String bugId, String userId) {
|
public void batchAssociateBug(TestPlanCaseBatchAddBugRequest request, String bugId, String userId) {
|
||||||
|
|
Loading…
Reference in New Issue