| | |
| | | } |
| | | |
| | | // 删除旧附件信息 |
| | | if (application == null) { |
| | | if (application == null || application.trim().isEmpty()) { |
| | | for (StorageBlobDTO storageBlobDTO : storageBlobDTOS) { |
| | | if (storageBlobDTO.getApplication() == null || storageBlobDTO.getApplication().trim().isEmpty()) { |
| | | throw new RuntimeException("文件用途不能为空"); |
| | | } |
| | | deleteStorageAttachmentsByApplicationAndRecordTypeAndRecordId(ApplicationTypeEnum.getByType(storageBlobDTO.getApplication()), recordType, recordId); |
| | | } |
| | | } else { |
| | |
| | | StorageBlobVO storageBlobVO = new StorageBlobVO(); |
| | | BeanUtils.copyProperties(storageBlob, storageBlobVO); |
| | | storageBlobVO.setPreviewURL(buildSignedPreviewUrl(storageBlobVO)); |
| | | storageBlobVO.setUrl(buildSignedPreviewUrl(storageBlobVO)); |
| | | storageBlobVO.setName(storageBlob.getOriginalFilename()); |
| | | storageBlobVO.setDownloadURL(buildSignedDownloadUrl(storageBlobVO)); |
| | | storageBlobVO.setStorageAttachmentId(blobIdToAttachmentIdMap.get(storageBlob.getId())); |
| | | storageBlobDTOS.add(storageBlobVO); |
| | |
| | | StorageBlobVO storageBlobVO = new StorageBlobVO(); |
| | | BeanUtils.copyProperties(storageBlob, storageBlobVO); |
| | | storageBlobVO.setPreviewURL(buildSignedPreviewUrl(storageBlobVO)); |
| | | storageBlobVO.setUrl(buildSignedPreviewUrl(storageBlobVO)); |
| | | storageBlobVO.setName(storageBlob.getOriginalFilename()); |
| | | storageBlobVO.setDownloadURL(buildSignedDownloadUrl(storageBlobVO)); |
| | | storageBlobVO.setStorageAttachmentId(blobIdToAttachmentIdMap.get(storageBlob.getId())); |
| | | storageBlobDTOS.add(storageBlobVO); |
| | |
| | | StorageBlobVO storageBlobVO = new StorageBlobVO(); |
| | | BeanUtils.copyProperties(storageBlob, storageBlobVO); |
| | | storageBlobVO.setPreviewURL(buildSignedPreviewUrl(storageBlobVO)); |
| | | storageBlobVO.setUrl(buildSignedPreviewUrl(storageBlobVO)); |
| | | storageBlobVO.setName(storageBlob.getOriginalFilename()); |
| | | storageBlobVO.setDownloadURL(buildSignedDownloadUrl(storageBlobVO)); |
| | | storageBlobDTOS.add(storageBlobVO); |
| | | } |