| | |
| | | List<SystemStorageAttachmentDO> attachments = getStorageAttachmentsByApplicationAndRecordTypeAndRecordId( |
| | | application, recordType, recordId); |
| | | if (CollUtil.isEmpty(attachments)) { |
| | | return null; |
| | | // 返回空集合而非 null:调用方常把它直接塞进 Collectors.toMap 做分组(value 为 null 会抛 NPE) |
| | | return new ArrayList<>(); |
| | | } |
| | | Map<Long, Long> blobIdToAttachmentIdMap = attachments.stream() |
| | | .collect(Collectors.toMap(SystemStorageAttachmentDO::getStorageBlobId, SystemStorageAttachmentDO::getId)); |
| | |
| | | public List<SystemStorageBlobRespVO> getStorageBlobVOsByRecordTypeAndRecordId(String recordType, Long recordId) { |
| | | List<SystemStorageAttachmentDO> attachments = getStorageAttachmentsByRecordTypeAndRecordId(recordType, recordId); |
| | | if (CollUtil.isEmpty(attachments)) { |
| | | return null; |
| | | // 返回空集合而非 null,避免调用方直接使用返回值时抛 NPE |
| | | return new ArrayList<>(); |
| | | } |
| | | List<Long> storageBlobIds = attachments.stream() |
| | | .map(SystemStorageAttachmentDO::getStorageBlobId) |