From 9b6f0ade46587f0b9fcbb659d491bae01c7e2649 Mon Sep 17 00:00:00 2001
From: quxin <592870522@qq.com>
Date: 星期五, 04 九月 2026 11:37:30 +0800
Subject: [PATCH] 修复: 生产领料后的退料应该是选择领料的记录,不是选择库存的记录(同时库存数据需要根据领料退料变动,比如库存100,领用80,然后领用80中退料30,库存应由原来的20变成50)

---
 yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/util/storage/StorageFileUtil.java |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/util/storage/StorageFileUtil.java b/yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/util/storage/StorageFileUtil.java
index abc79c1..111bf6d 100644
--- a/yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/util/storage/StorageFileUtil.java
+++ b/yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/util/storage/StorageFileUtil.java
@@ -41,7 +41,7 @@
  * - token浣跨敤娆℃暟鎺у埗锛圧edis锛�
  * - 鍥剧墖鍘嬬缉
  *
- * @author 鑺嬮亾婧愮爜
+ * @author 瓒呯骇绠$悊鍛�
  */
 @Component
 @RequiredArgsConstructor
@@ -104,21 +104,20 @@
             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;
         }
 

--
Gitblit v1.9.3