diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTaskMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTaskMapper.java index 1a6efe9cf0..b07d0aa78c 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTaskMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTaskMapper.java @@ -8,8 +8,6 @@ import java.util.List; public interface ExtTaskMapper { - void deleteByResourceId(String id); - List getTasks(@Param("request") TaskCenterRequest request); int getRunningTasks(@Param("request") TaskCenterRequest request); @@ -18,6 +16,6 @@ public interface ExtTaskMapper { List getScenario(@Param("id") String id); - int checkActuator (@Param("actuator") String actuator); + List checkActuator (@Param("actuator") String actuator); } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTaskMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTaskMapper.xml index 43000e71ae..aebdf0af9c 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTaskMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTaskMapper.xml @@ -89,25 +89,23 @@ )tt ORDER BY tt.executionTime DESC; - SELECT - sum( sum_actuator ) + name FROM - ( - SELECT - count( id ) AS sum_actuator - FROM - api_scenario_report - WHERE - actuator =#{actuator} - AND `status` in ('Running','Waiting') UNION ALL - SELECT - count( id ) AS sum_actuator - FROM - api_definition_exec_result - WHERE - actuator = #{actuator} + api_scenario_report + WHERE + actuator =#{actuator} AND `status` in ('Running','Waiting') - ) AS total + + UNION ALL + + SELECT + name + FROM + api_definition_exec_result + WHERE + actuator = #{actuator} + AND `status` in ('Running','Waiting') \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/service/TestResourcePoolService.java b/backend/src/main/java/io/metersphere/service/TestResourcePoolService.java index d0d4d5e305..0779d49249 100644 --- a/backend/src/main/java/io/metersphere/service/TestResourcePoolService.java +++ b/backend/src/main/java/io/metersphere/service/TestResourcePoolService.java @@ -105,9 +105,6 @@ public class TestResourcePoolService { testResourcePool.setStatus(status); // 禁用/删除 资源池 if (INVALID.name().equals(status) || DELETE.name().equals(status)) { - if(extTaskMapper.checkActuator(testResourcePool.getId())>0){ - MSException.throwException("当前资源池正在使用中不能删除"); - } testResourcePoolMapper.updateByPrimaryKeySelective(testResourcePool); return; } @@ -154,6 +151,9 @@ public class TestResourcePoolService { } }); } + // api + List apiNames = extTaskMapper.checkActuator(testResourcePool.getId()); + builder.append(StringUtils.join(apiNames, "; ")); result.setTestName(builder.toString()); return result; }