| | |
| | | throw new IllegalArgumentException("关联记录id不能为空"); |
| | | } |
| | | |
| | | // 删除旧附件信息 |
| | | // 只删除旧的附件关联记录,保留 blob 记录(文件本身不删除) |
| | | if (application == null || application.trim().isEmpty()) { |
| | | for (SystemStorageAttachmentSaveReqVO.BlobItem item : blobItems) { |
| | | String itemApp = item.getApplication(); |
| | | if (itemApp == null || itemApp.trim().isEmpty()) { |
| | | throw new IllegalArgumentException("文件用途不能为空"); |
| | | } |
| | | deleteStorageAttachmentsByApplicationAndRecordTypeAndRecordId(itemApp, recordType.getType(), recordId); |
| | | storageAttachmentMapper.deleteByApplicationAndRecordTypeAndRecordId(itemApp, recordType.getType(), recordId); |
| | | } |
| | | } else { |
| | | deleteStorageAttachmentsByApplicationAndRecordTypeAndRecordId(application, recordType.getType(), recordId); |
| | | storageAttachmentMapper.deleteByApplicationAndRecordTypeAndRecordId(application, recordType.getType(), recordId); |
| | | } |
| | | |
| | | if (CollUtil.isEmpty(blobItems)) { |
| | | deleteStorageAttachmentsByRecordTypeAndRecordId(recordType.getType(), recordId); |
| | | return; |
| | | } |
| | | |