fix(接口测试): 修复批量删除场景报告有时候无法生成日志的缺陷

--bug=1038891 --user=王孝刚 【接口测试】批量删除场景报告-未生成系统日志
https://www.tapd.cn/55049933/s/1492044
This commit is contained in:
wxg0103 2024-04-09 19:45:00 +08:00 committed by Craftsman
parent 440214b67a
commit dfe1d66e62
8 changed files with 9 additions and 10 deletions

View File

@ -17,7 +17,7 @@ public interface ExtApiReportMapper {
List<String> getIds(@Param("request") ApiReportBatchRequest request);
List<ApiReport> selectApiReportByIds(@Param("ids") List<String> ids, @Param("deleted") boolean deleted);
List<ApiReport> selectApiReportByIds(@Param("ids") List<String> ids);
List<ApiReportStepDTO> selectStepsByReportId(String id);

View File

@ -61,8 +61,7 @@
select
api_report.id,
api_report.name
from api_report where api_report.deleted = #{deleted}
and api_report.test_plan_id = 'NONE'
from api_report where api_report.test_plan_id = 'NONE'
and api_report.id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}

View File

@ -18,7 +18,7 @@ public interface ExtApiScenarioReportMapper {
List<String> getIds(@Param("request") ApiReportBatchRequest request);
List<ApiScenarioReport> selectApiReportByIds(@Param("ids") List<String> ids, @Param("deleted") boolean deleted);
List<ApiScenarioReport> selectApiReportByIds(@Param("ids") List<String> ids);
List<ApiScenarioReportStepDTO> selectStepByReportId(@Param("reportId") String reportId);

View File

@ -60,8 +60,8 @@
select
api_scenario_report.id,
api_scenario_report.name
from api_scenario_report where api_scenario_report.deleted = #{deleted}
and api_scenario_report.test_plan_id = 'NONE'
from api_scenario_report where
api_scenario_report.test_plan_id = 'NONE'
and api_scenario_report.id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}

View File

@ -68,7 +68,7 @@ public class ApiReportLogService {
public void batchDeleteLog(List<String> ids, String userId, String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId);
List<ApiReport> apiReports = extApiReportMapper.selectApiReportByIds(ids, true);
List<ApiReport> apiReports = extApiReportMapper.selectApiReportByIds(ids);
List<LogDTO> logs = new ArrayList<>();
apiReports.forEach(apiReport -> {
LogDTO dto = new LogDTO(

View File

@ -151,7 +151,7 @@ public class ApiReportService {
if (CollectionUtils.isEmpty(ids)) {
return;
}
SubListUtils.dealForSubList(ids, 2000, subList -> {
SubListUtils.dealForSubList(ids, 500, subList -> {
ApiReportExample example = new ApiReportExample();
example.createCriteria().andIdIn(subList);
ApiReport apiReport = new ApiReport();

View File

@ -70,7 +70,7 @@ public class ApiScenarioReportLogService {
@Async
public void batchDeleteLog(List<String> ids, String userId, String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId);
List<ApiScenarioReport> apiReports = extApiScenarioReportMapper.selectApiReportByIds(ids, true);
List<ApiScenarioReport> apiReports = extApiScenarioReportMapper.selectApiReportByIds(ids);
List<LogDTO> logs = new ArrayList<>();
apiReports.forEach(apiReport -> {
LogDTO dto = new LogDTO(

View File

@ -32,7 +32,7 @@ public class TaskCenterController {
@PostMapping("/project/schedule/page")
@Operation(summary = "项目-任务中心-定时任务列表")
@RequiresPermissions(PermissionConstants.SYSTEM_ORGANIZATION_PROJECT_READ)
@RequiresPermissions(PermissionConstants.PROJECT_BASE_INFO_READ)
public Pager<List<TaskCenterScheduleDTO>> projectScheduleList(@Validated @RequestBody TaskCenterSchedulePageRequest request) {
return taskCenterService.getProjectSchedulePage(request, SessionUtils.getCurrentProjectId());
}