From e046347e21a3bb4aa4ae4eb80f54bbfadb652132 Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期四, 15 一月 2026 09:11:49 +0800
Subject: [PATCH] Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management-after into dev_New
---
src/main/java/com/ruoyi/basic/service/impl/StorageAttachmentServiceImpl.java | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/ruoyi/basic/service/impl/StorageAttachmentServiceImpl.java b/src/main/java/com/ruoyi/basic/service/impl/StorageAttachmentServiceImpl.java
index 78c8647..9b1980a 100644
--- a/src/main/java/com/ruoyi/basic/service/impl/StorageAttachmentServiceImpl.java
+++ b/src/main/java/com/ruoyi/basic/service/impl/StorageAttachmentServiceImpl.java
@@ -43,11 +43,11 @@
private MinioUtils minioUtils;
@Override
- public List<StorageAttachment> selectStorageAttachments(Long recordId, StorageAttachmentRecordType recordType, StorageAttachmentConstants fileType) {
+ public List<StorageAttachment> selectStorageAttachments(Long recordId, StorageAttachmentRecordType recordType, String fileType) {
List<StorageAttachment> storageAttachments = storageAttachmentMapper.selectList(new LambdaQueryWrapper<StorageAttachment>()
.eq(StorageAttachment::getRecordId, recordId)
.eq(StorageAttachment::getRecordType, recordType.ordinal())
- .eq(StorageAttachment::getName, fileType.toString()));
+ .eq(StorageAttachment::getName, fileType));
if (storageAttachments != null) {
for (StorageAttachment storageAttachment : storageAttachments) {
StorageBlob storageBlob = storageBlobMapper.selectById(storageAttachment.getStorageBlobId());
@@ -78,6 +78,22 @@
}
@Override
+ public void saveStorageAttachment(List<StorageAttachment> attachments, Long recordId, StorageAttachmentRecordType recordType, String fileType) {
+ // 鍒犻櫎鏃у浘
+// deleteStorageAttachment(new StorageAttachment(fileType, (long) recordType.ordinal(), recordId));
+ for (StorageAttachment attachment : attachments) {
+ // 鑾峰彇鍏宠仈璁板綍
+ StorageBlob storageBlob = attachment.getStorageBlobDTO();
+ attachment.setName(fileType);
+ attachment.setRecordType((long) recordType.ordinal());
+ attachment.setRecordId(recordId);
+ attachment.setStorageBlobId(storageBlob.getId());
+ storageAttachmentMapper.insert(attachment);
+ }
+
+ }
+
+ @Override
public int deleteStorageAttachment(StorageAttachment storageAttachment) {
// 鍏堝垹闄ゆ槑缁嗚〃
storageBlobService.deleteStorageBlobs(storageAttachment);
--
Gitblit v1.9.3