From 8bcec29715251194f7358bd1035033293e955ce1 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 04 十一月 2026 18:11:25 +0800
Subject: [PATCH] feat(mes): 重构质检完成与来源关联流程并新增工单技术文件快照

---
 yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/util/storage/StorageFileUtil.java |    8 ++++++++
 1 files changed, 8 insertions(+), 0 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 111bf6d..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
@@ -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