From 72e4881cf7614c8da85527380375138fbac195d0 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Fri, 6 May 2022 14:24:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E5=88=A0=E9=99=A4=E6=97=B6=E6=B2=A1=E6=9C=89=E6=8A=8A?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E5=B8=A6=E4=B8=8A=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1012991 --user=刘瑞斌 性能测试报告高级搜索后,批量删除全部,会将所的报告全部删除 https://www.tapd.cn/55049933/s/1153361 --- .../performance/controller/request/DeleteReportRequest.java | 3 +-- .../performance/controller/request/ReportRequest.java | 3 ++- .../performance/service/PerformanceReportService.java | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/io/metersphere/performance/controller/request/DeleteReportRequest.java b/backend/src/main/java/io/metersphere/performance/controller/request/DeleteReportRequest.java index 27581363f9..060abb1a00 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/request/DeleteReportRequest.java +++ b/backend/src/main/java/io/metersphere/performance/controller/request/DeleteReportRequest.java @@ -1,6 +1,5 @@ package io.metersphere.performance.controller.request; -import io.metersphere.track.request.testplancase.TestPlanFuncCaseConditions; import lombok.Data; import java.util.List; @@ -9,5 +8,5 @@ import java.util.List; public class DeleteReportRequest { private List ids; private String projectId; - private TestPlanFuncCaseConditions condition; + private ReportRequest condition; } diff --git a/backend/src/main/java/io/metersphere/performance/controller/request/ReportRequest.java b/backend/src/main/java/io/metersphere/performance/controller/request/ReportRequest.java index dac96b1de8..c597be93fe 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/request/ReportRequest.java +++ b/backend/src/main/java/io/metersphere/performance/controller/request/ReportRequest.java @@ -1,5 +1,6 @@ package io.metersphere.performance.controller.request; +import io.metersphere.controller.request.BaseQueryRequest; import io.metersphere.controller.request.OrderRequest; import lombok.Getter; import lombok.Setter; @@ -9,7 +10,7 @@ import java.util.Map; @Getter @Setter -public class ReportRequest { +public class ReportRequest extends BaseQueryRequest { private String name; private String workspaceId; private String testId; diff --git a/backend/src/main/java/io/metersphere/performance/service/PerformanceReportService.java b/backend/src/main/java/io/metersphere/performance/service/PerformanceReportService.java index bfe07d5e95..045582a513 100644 --- a/backend/src/main/java/io/metersphere/performance/service/PerformanceReportService.java +++ b/backend/src/main/java/io/metersphere/performance/service/PerformanceReportService.java @@ -384,15 +384,13 @@ public class PerformanceReportService { public void deleteReportBatch(DeleteReportRequest request) { ServiceUtils.getSelectAllIds(request, request.getCondition(), - (query) -> getLoadTestReportIds(request.getProjectId())); + (query) -> getLoadTestReportIds(request.getCondition())); List ids = request.getIds(); ids.forEach(this::deleteReport); } - private List getLoadTestReportIds(String projectId) { - ReportRequest request = new ReportRequest(); - request.setProjectId(projectId); + private List getLoadTestReportIds(ReportRequest request) { return this.getReportList(request).stream().map(LoadTestReport::getId).collect(Collectors.toList()); }