diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java index 75d80d7f69..9966349b6f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.java @@ -2,6 +2,7 @@ package io.metersphere.base.mapper.ext; import io.metersphere.base.domain.FileMetadata; import io.metersphere.base.domain.LoadTest; +import io.metersphere.controller.request.BaseQueryRequest; import io.metersphere.dto.LoadTestDTO; import io.metersphere.performance.request.QueryProjectFileRequest; import io.metersphere.performance.request.QueryTestPlanRequest; @@ -39,4 +40,6 @@ public interface ExtLoadTestMapper { List selectRefIdsForVersionChange(@Param("versionId") String versionId, @Param("projectId") String projectId); List getFileMetadataByIds(@Param("testId") String testId); + + List selectIds(@Param("request") BaseQueryRequest request); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml index bdd040787b..6d52431ea6 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtLoadTestMapper.xml @@ -225,6 +225,53 @@ + + + + + + + and load_test.status in + + #{value} + + + + and load_test.method in + + #{value} + + + + and load_test.user_id in + + #{value} + + + + and load_test.user_id in + + #{value} + + + + and load_test.case_status in + + #{value} + + + + and load_test.version_id in + + #{value} + + + + + + + + @@ -234,6 +281,37 @@ + + and (load_test.name like CONCAT('%', #{request.name},'%') + or load_test.num like CONCAT('%', #{request.name},'%') + + + + and (load_test.status is null or load_test.status != #{request.notEqStatus}) + + + + AND load_test.id = #{request.id} + + + AND load_test.user_id = #{request.userId} + + + AND load_test.create_time >= #{request.createTime} + + + and load_test.id not in + + #{id} + + + + AND load_test.project_id = #{request.projectId} + + + + + @@ -349,4 +427,11 @@ WHERE test_id = #{testId} ORDER BY sort + + diff --git a/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java b/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java index 21bcfff96c..8e930da6c7 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java +++ b/backend/src/main/java/io/metersphere/performance/controller/PerformanceTestController.java @@ -22,6 +22,7 @@ import io.metersphere.dto.ScheduleDao; import io.metersphere.log.annotation.MsAuditLog; import io.metersphere.notice.annotation.SendNotice; import io.metersphere.performance.dto.LoadModuleDTO; +import io.metersphere.performance.dto.LoadTestBatchRequest; import io.metersphere.performance.dto.LoadTestExportJmx; import io.metersphere.performance.request.*; import io.metersphere.performance.service.PerformanceTestService; @@ -69,6 +70,11 @@ public class PerformanceTestController { return performanceTestService.getLoadTestByProjectId(projectId); } + @PostMapping("/list/batch") + @RequiresPermissions("PROJECT_PERFORMANCE_TEST:READ") + public List listBatch(@RequestBody LoadTestBatchRequest request) { + return performanceTestService.listBatch(request); + } @GetMapping("/state/get/{testId}") @RequiresPermissions("PROJECT_PERFORMANCE_TEST:READ") diff --git a/backend/src/main/java/io/metersphere/performance/dto/LoadTestBatchRequest.java b/backend/src/main/java/io/metersphere/performance/dto/LoadTestBatchRequest.java new file mode 100644 index 0000000000..ed5152dbfa --- /dev/null +++ b/backend/src/main/java/io/metersphere/performance/dto/LoadTestBatchRequest.java @@ -0,0 +1,19 @@ +package io.metersphere.performance.dto; + +import io.metersphere.base.domain.LoadTestWithBLOBs; +import io.metersphere.controller.request.OrderRequest; +import lombok.Data; + +import java.util.List; + +@Data +public class LoadTestBatchRequest extends LoadTestWithBLOBs { + private List ids; + private String name; + private List orders; + private String projectId; + private String moduleId; + private String protocol; + + private LoadTestRequest condition; +} diff --git a/backend/src/main/java/io/metersphere/performance/dto/LoadTestRequest.java b/backend/src/main/java/io/metersphere/performance/dto/LoadTestRequest.java new file mode 100644 index 0000000000..148ad7db67 --- /dev/null +++ b/backend/src/main/java/io/metersphere/performance/dto/LoadTestRequest.java @@ -0,0 +1,42 @@ +package io.metersphere.performance.dto; + +import io.metersphere.controller.request.BaseQueryRequest; +import lombok.Data; + +@Data +public class LoadTestRequest extends BaseQueryRequest { + private String id; + + private String projectId; + + private String name; + + private String description; + + private Long createTime; + + private Long updateTime; + + private String status; + + private String testResourcePoolId; + + private String userId; + + private Integer num; + + private String createUser; + + private Integer scenarioVersion; + + private String scenarioId; + + private Long order; + + private String refId; + + private String versionId; + + private Boolean latest; + +} diff --git a/backend/src/main/java/io/metersphere/performance/service/PerformanceTestService.java b/backend/src/main/java/io/metersphere/performance/service/PerformanceTestService.java index 16642430af..e217315c03 100644 --- a/backend/src/main/java/io/metersphere/performance/service/PerformanceTestService.java +++ b/backend/src/main/java/io/metersphere/performance/service/PerformanceTestService.java @@ -35,6 +35,7 @@ import io.metersphere.log.vo.performance.PerformanceReference; import io.metersphere.performance.base.GranularityData; import io.metersphere.performance.base.VumProcessedStatus; import io.metersphere.performance.dto.LoadModuleDTO; +import io.metersphere.performance.dto.LoadTestBatchRequest; import io.metersphere.performance.dto.LoadTestExportJmx; import io.metersphere.performance.engine.Engine; import io.metersphere.performance.engine.EngineFactory; @@ -1124,4 +1125,17 @@ public class PerformanceTestService { } + public List listBatch(LoadTestBatchRequest request) { + ServiceUtils.getSelectAllIds(request, request.getCondition(), + (query) -> extLoadTestMapper.selectIds(query)); + if (org.apache.commons.collections.CollectionUtils.isEmpty(request.getIds())) { + return new ArrayList<>(); + } + + QueryTestPlanRequest request2 = new QueryTestPlanRequest(); + Map> param = new HashMap<>(); + param.put("id", request.getIds()); + request2.setFilters(param); + return this.list(request2); + } } diff --git a/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue b/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue index 6509691b2c..ee091c8b85 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/RelevanceScenarioList.vue @@ -13,17 +13,28 @@ ref="envPopover" class="env-popover"/> - - - - + + @@ -52,7 +63,8 @@ @@ -64,13 +76,17 @@ - + @@ -79,221 +95,222 @@ diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestCaseApiRelevance.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestCaseApiRelevance.vue index 97d9f8e82c..c33dd77962 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestCaseApiRelevance.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestCaseApiRelevance.vue @@ -28,6 +28,7 @@ :versionFilters="versionFilters" :version-enable="versionEnable" @isApiListEnableChange="isApiListEnableChange" + @selectCountChange="setSelectCounts" ref="apiList">