diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanCollectionMinderService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanCollectionMinderService.java index cde151dd59..6b9fc12150 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanCollectionMinderService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanCollectionMinderService.java @@ -272,7 +272,7 @@ public class TestPlanCollectionMinderService { if (CollectionUtils.isNotEmpty(updateList)) { //处理删除 - deleteCollection(updateList); + deleteCollection(updateList, request.getPlanId()); //处理更新 for (TestPlanCollectionMinderEditDTO testPlanCollectionMinderEditDTO : updateList) { TestPlanCollection testPlanCollection = updateCollection(request, userId, testPlanCollectionMinderEditDTO, parentMap, collectionMapper); @@ -281,10 +281,10 @@ public class TestPlanCollectionMinderService { } } - private void deleteCollection(List updateList) { + private void deleteCollection(List updateList, String planId) { List existIds = updateList.stream().map(TestPlanCollectionMinderEditDTO::getId).toList(); TestPlanCollectionExample example = new TestPlanCollectionExample(); - example.createCriteria().andIdNotIn(existIds); + example.createCriteria().andIdNotIn(existIds).andTestPlanIdEqualTo(planId); List collections = testPlanCollectionMapper.selectByExample(example); if (CollectionUtils.isNotEmpty(collections)) { List deletedIds = collections.stream().map(TestPlanCollection::getId).toList(); diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java index 04b1ac679f..dde7cc328e 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java @@ -19,7 +19,6 @@ import io.metersphere.system.uid.IDGenerator; import jakarta.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.ListOperations; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; @@ -64,7 +63,7 @@ public class TestPlanExecuteService { public static final String QUEUE_PREFIX_TEST_PLAN_COLLECTION = "test-plan-collection-execute:"; public static final String LAST_QUEUE_PREFIX = "last-queue:"; - @Autowired + @Resource private TestPlanReportMapper testPlanReportMapper; // 停止测试计划的执行 @@ -146,6 +145,8 @@ public class TestPlanExecuteService { executionQueue.setSourceID(request.getExecuteId()); executionQueue.setRunMode(request.getRunMode()); executionQueue.setExecutionSource(request.getExecutionSource()); + executionQueue.setQueueId(IDGenerator.nextStr()); + executionQueue.setQueueType(QUEUE_PREFIX_TEST_PLAN_BATCH_EXECUTE); executionQueue.setCreateUser(userId); executionQueue.setPrepareReportId(IDGenerator.nextStr()); return executeTestPlanOrGroup(executionQueue);