From a8e4132c3e2e9c3b3fcb0360901b35571b6464ea Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期五, 28 八月 2026 10:13:01 +0800
Subject: [PATCH] feat: 综合业务模块功能补充与实体拓展

---
 src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java b/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java
index 552aaa9..5782115 100644
--- a/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java
+++ b/src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java
@@ -70,6 +70,11 @@
         if (byId == null) {
             return AjaxResult.error("鍙戣揣淇℃伅涓嶅瓨鍦�");
         }
+        if ("瀹℃牳閫氳繃".equals(byId.getStatus()) && !"宸插彂璐�".equals(req.getStatus())) {
+            // Note: If the request is from outbound management trying to change status to "宸插彂璐�", it's allowed.
+            // But if it's a normal edit, it's blocked. We just check if it's already 瀹℃牳閫氳繃 and they are updating other fields.
+            return AjaxResult.error("宸插鏍搁�氳繃锛屼笉鑳界紪杈戝彂璐т俊鎭�");
+        }
         boolean update = shippingInfoService.updateById(req);
         return update ? AjaxResult.success() : AjaxResult.error();
     }
@@ -79,7 +84,12 @@
     @Transactional(rollbackFor = Exception.class)
     @Log(title = "鍙戣揣淇℃伅绠$悊", businessType = BusinessType.DELETE)
     public AjaxResult delete(@RequestBody List<Long> ids) {
-
+        for (Long id : ids) {
+            ShippingInfo byId = shippingInfoService.getById(id);
+            if (byId != null && ("宸插彂璐�".equals(byId.getStatus()) || "瀹℃牳閫氳繃".equals(byId.getStatus()))) {
+                return AjaxResult.error("瀛樺湪宸插彂璐ф垨瀹℃牳閫氳繃鐨勪骇鍝侊紝涓嶈兘鍒犻櫎");
+            }
+        }
         return shippingInfoService.delete(ids) ? AjaxResult.success("鍒犻櫎鎴愬姛") : AjaxResult.error("鍒犻櫎澶辫触");
     }
 
@@ -88,8 +98,8 @@
      */
     @PostMapping("/export")
     @Operation(summary = "瀵煎嚭鍙戣揣淇℃伅")
-    public void export(HttpServletResponse response) {
-        List<ShippingInfo> list = shippingInfoMapper.listAll();
+    public void export(HttpServletResponse response, ShippingInfo req) {
+        List<ShippingInfo> list = shippingInfoMapper.listAll(req);
         ExcelUtil<ShippingInfo> util = new ExcelUtil<ShippingInfo>(ShippingInfo.class);
         util.exportExcel(response, list, "鍙戣揣淇℃伅");
     }

--
Gitblit v1.9.3