fix(性能测试): 修复性能测试批量删除时没有把查询条件带上的问题
--bug=1012991 --user=刘瑞斌 性能测试报告高级搜索后,批量删除全部,会将所的报告全部删除 https://www.tapd.cn/55049933/s/1153361
This commit is contained in:
parent
98c5fe6b9d
commit
72e4881cf7
|
@ -1,6 +1,5 @@
|
||||||
package io.metersphere.performance.controller.request;
|
package io.metersphere.performance.controller.request;
|
||||||
|
|
||||||
import io.metersphere.track.request.testplancase.TestPlanFuncCaseConditions;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -9,5 +8,5 @@ import java.util.List;
|
||||||
public class DeleteReportRequest {
|
public class DeleteReportRequest {
|
||||||
private List<String> ids;
|
private List<String> ids;
|
||||||
private String projectId;
|
private String projectId;
|
||||||
private TestPlanFuncCaseConditions condition;
|
private ReportRequest condition;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package io.metersphere.performance.controller.request;
|
package io.metersphere.performance.controller.request;
|
||||||
|
|
||||||
|
import io.metersphere.controller.request.BaseQueryRequest;
|
||||||
import io.metersphere.controller.request.OrderRequest;
|
import io.metersphere.controller.request.OrderRequest;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
@ -9,7 +10,7 @@ import java.util.Map;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class ReportRequest {
|
public class ReportRequest extends BaseQueryRequest {
|
||||||
private String name;
|
private String name;
|
||||||
private String workspaceId;
|
private String workspaceId;
|
||||||
private String testId;
|
private String testId;
|
||||||
|
|
|
@ -384,15 +384,13 @@ public class PerformanceReportService {
|
||||||
|
|
||||||
public void deleteReportBatch(DeleteReportRequest request) {
|
public void deleteReportBatch(DeleteReportRequest request) {
|
||||||
ServiceUtils.getSelectAllIds(request, request.getCondition(),
|
ServiceUtils.getSelectAllIds(request, request.getCondition(),
|
||||||
(query) -> getLoadTestReportIds(request.getProjectId()));
|
(query) -> getLoadTestReportIds(request.getCondition()));
|
||||||
|
|
||||||
List<String> ids = request.getIds();
|
List<String> ids = request.getIds();
|
||||||
ids.forEach(this::deleteReport);
|
ids.forEach(this::deleteReport);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> getLoadTestReportIds(String projectId) {
|
private List<String> getLoadTestReportIds(ReportRequest request) {
|
||||||
ReportRequest request = new ReportRequest();
|
|
||||||
request.setProjectId(projectId);
|
|
||||||
return this.getReportList(request).stream().map(LoadTestReport::getId).collect(Collectors.toList());
|
return this.getReportList(request).stream().map(LoadTestReport::getId).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue