From d39e4f7d839167c16425086dfa2f8747bccfdff9 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 05 十一月 2026 17:39:01 +0800
Subject: [PATCH] feat: 打通销售采购财务闭环并完成累计业务优化

---
 yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/util/storage/StorageFileUtil.java |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 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 c5ac949..6c804e6 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
@@ -141,6 +141,14 @@
         if (CollUtil.isEmpty(storageBlobIds)) {
             return;
         }
+        // 鐢熶骇宸ュ崟渚濊禆鍘熷鏂囦欢鍙嶆槧鍘嗗彶鐗堟湰锛屼笉鍏佽閫氳繃鍏朵粬闄勪欢鍏ュ彛鍒犻櫎杩欎簺鍏变韩鏂囦欢銆�
+        Long snapshotReferences = storageAttachmentMapper.selectCount(
+                new com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<SystemStorageAttachmentDO>()
+                        .eq(SystemStorageAttachmentDO::getRecordType, "mes_work_order_technical_file")
+                        .in(SystemStorageAttachmentDO::getStorageBlobId, storageBlobIds));
+        if (snapshotReferences != null && snapshotReferences > 0) {
+            throw new cn.iocoder.yudao.framework.common.exception.ServiceException(400, "鎶�鏈枃浠跺凡琚敓浜у伐鍗曠暀瀛橈紝涓嶈兘鍒犻櫎");
+        }
         // 鍚屾椂鍒犻櫎纾佺洏鏂囦欢
         List<SystemStorageBlobDO> blobs = storageBlobMapper.selectByIds(storageBlobIds);
         for (SystemStorageBlobDO blob : blobs) {

--
Gitblit v1.9.3