diff --git a/backend/src/main/java/io/metersphere/service/ScheduleService.java b/backend/src/main/java/io/metersphere/service/ScheduleService.java index 7b0349a479..9e3ec165bb 100644 --- a/backend/src/main/java/io/metersphere/service/ScheduleService.java +++ b/backend/src/main/java/io/metersphere/service/ScheduleService.java @@ -27,10 +27,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.stream.Collectors; @Service @@ -92,6 +89,9 @@ public class ScheduleService { public List getScheduleByResourceIds(ListresourceIds, String group) { ScheduleExample example = new ScheduleExample(); + if(resourceIds.size()==0){ + return new ArrayList<>(); + } example.createCriteria().andResourceIdIn(resourceIds).andGroupEqualTo(group); List schedules = scheduleMapper.selectByExample(example); if (schedules.size() > 0) { diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index 85e97e028c..5d1668db8d 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -429,6 +429,9 @@ public class TestPlanService { request.setProjectId(request.getProjectId()); } List testPlans = extTestPlanMapper.list(request); + if(testPlans.size()==0){ + return new ArrayList<>(); + } Set ids = testPlans.stream().map(TestPlan::getId).collect(Collectors.toSet()); Map planTestCaseCountMap = extTestPlanMapper.testPlanTestCaseCount(ids); Map planApiCaseMap = extTestPlanMapper.testPlanApiCaseCount(ids);