From ea531a6f0efba09ca671fee7e406e42955d1f0d1 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 27 五月 2026 17:48:26 +0800
Subject: [PATCH] 编辑采购台账报错异常+供应商往来查询入库金额sql调整优化

---
 src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java
index 8d16029..0a84bf9 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/ShippingInfoServiceImpl.java
@@ -26,6 +26,7 @@
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
@@ -89,10 +90,14 @@
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean delete(List<Long> ids) {
         List<ShippingInfo> shippingInfos = shippingInfoMapper.selectList(new LambdaQueryWrapper<ShippingInfo>()
                 .in(ShippingInfo::getId, ids));
         if (CollectionUtils.isEmpty(shippingInfos)) return false;
+        // 鍙湁寰呭鏍哥姸鎬佹墠鑳藉垹闄�
+        boolean allPending = shippingInfos.stream().allMatch(s -> "寰呭鏍�".equals(s.getStatus()));
+        if (!allPending) throw new RuntimeException("鍙湁寰呭鏍哥姸鎬佹墠鑳藉垹闄�");
         // 鍒犻櫎闄勪欢
         commonFileService.deleteByBusinessIds(ids, FileNameType.SHIP.getValue());
         // 鍒犻櫎鍙戣揣瀹℃壒

--
Gitblit v1.9.3