fix(接口测试): 修复case按标签全选后批量执行报错的缺陷

https://github.com/metersphere/metersphere/issues/22814
This commit is contained in:
wxg0103 2023-03-16 18:02:10 +08:00 committed by wxg0103
parent 12d15da2de
commit 98028b4ff9
2 changed files with 7 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import io.metersphere.service.ServiceUtils;
import io.metersphere.service.definition.ApiCaseResultService;
import io.metersphere.service.scenario.ApiScenarioReportStructureService;
import io.metersphere.utils.LoggerUtil;
import jakarta.annotation.Resource;
import org.apache.commons.beanutils.BeanComparator;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
@ -38,7 +39,6 @@ import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@ -248,6 +248,9 @@ public class ApiCaseExecuteService {
(query) -> extApiTestCaseMapper.selectIdsByQuery((ApiTestCaseRequest) query));
List<MsExecResponseDTO> responseDTOS = new LinkedList<>();
if (CollectionUtils.isEmpty(request.getIds())) {
return responseDTOS;
}
List<ApiTestCaseWithBLOBs> caseList = extApiTestCaseMapper.unTrashCaseListByIds(request.getIds());
// 检查执行内容合规性
PerformInspectionUtil.caseInspection(caseList);

View File

@ -787,7 +787,9 @@
<sql id="queryWhereCondition">
<where>
<if test="request.name != null and request.name!=''">
and t1.name like CONCAT('%', #{request.name},'%')
and (t1.name like CONCAT('%', #{request.name},'%')
or t1.tags like CONCAT('%', #{request.name},'%')
or t1.num like CONCAT('%', #{request.name},'%'))
</if>
<if test="request.id != null and request.id!=''">
AND t1.id = #{request.id}