| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateAttachments(String application, String recordType, Long recordId, List<Long> newBlobIds) { |
| | | if (newBlobIds == null) { |
| | | return; |
| | | } |
| | | if (newBlobIds.isEmpty()) { |
| | | // 清空所有附件 |
| | | systemStorageAttachmentService.deleteAttachmentsByApplicationAndRecordTypeAndRecordId( |
| | | application != null ? application : "file", recordType, recordId); |
| | | return; |
| | | } |
| | | // 全量替换:bindAttachments 内部先删后插,直接传入全部新 blobId 即可 |
| | | bindAttachments(application, recordType, recordId, newBlobIds); |
| | | } |
| | | |
| | | @Override |
| | | public List<StorageBlobRespDTO> listAttachments(String recordType, Long recordId) { |
| | | SystemStorageAttachmentListReqVO reqVO = new SystemStorageAttachmentListReqVO(); |
| | | reqVO.setApplication("file"); |
| | | reqVO.setRecordType(recordType); |
| | | reqVO.setRecordId(recordId); |
| | | List<SystemStorageBlobRespVO> list = systemStorageAttachmentService.listAttachments(reqVO); |