REQ-3754: 避免查询空列表

This commit is contained in:
yanglin 2025-03-04 15:13:40 +08:00
parent 3c05e5f5c1
commit 6241988df9

View File

@ -43,6 +43,8 @@ public class PushDeviceService {
} }
public PushDeviceSnapshots createDeviceSnapshots(Collection<Long> personIds) { public PushDeviceSnapshots createDeviceSnapshots(Collection<Long> personIds) {
if (CollectionUtils.isNotEmpty(personIds))
return new PushDeviceSnapshots(this, Collections.emptyList());
ArrayList<Long> uniquePersonIds = new ArrayList<>(new HashSet<>(personIds)); ArrayList<Long> uniquePersonIds = new ArrayList<>(new HashSet<>(personIds));
BatchFetchDeviceByPersonIdAndTerminalReq request = new BatchFetchDeviceByPersonIdAndTerminalReq(); BatchFetchDeviceByPersonIdAndTerminalReq request = new BatchFetchDeviceByPersonIdAndTerminalReq();
request.setPersonIds(uniquePersonIds); request.setPersonIds(uniquePersonIds);