From a19133219811f9286fa71a0fb8c1deb628cf74a3 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期四, 28 十一月 2024 16:51:08 +0800
Subject: [PATCH] #

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/OrderServiceImpl.java |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/OrderServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/OrderServiceImpl.java
index e050386..6defe8e 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/OrderServiceImpl.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/asrs/service/impl/OrderServiceImpl.java
@@ -10,6 +10,7 @@
 import com.zy.asrs.wms.asrs.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zy.asrs.wms.utils.OrderUtils;
+import com.zy.asrs.wms.utils.Utils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -122,6 +123,11 @@
                 }
             }
 
+            orderDetl.setStockIndex(Utils.getMatUniqueKey(matnr, batch, orderDetl.getUniqueField()));
+            if (!orderDetlService.updateById(orderDetl)) {
+                throw new CoolException("鏇存柊鏄庣粏绱㈠紩澶辫触");
+            }
+
         }
 
         return true;
@@ -130,6 +136,14 @@
     @Override
     public boolean updateOrder(UpdateOrderParam param) {
         Order order = this.getOne(new LambdaQueryWrapper<Order>().eq(Order::getId, param.getOrderId()));
+        if (order == null) {
+            throw new CoolException("璁㈠崟涓嶅瓨鍦�");
+        }
+
+        if (order.getHasWave() == 1) {
+            throw new CoolException("璁㈠崟宸茬粡鐢熸垚娉㈡锛屾棤娉曚慨鏀�");
+        }
+
         order.setOrderType(param.getOrderType());
         order.setOrderSettle(param.getOrderSettle());
         order.setUpdateTime(new Date());
@@ -207,6 +221,11 @@
                 }
             }
 
+            orderDetl.setStockIndex(Utils.getMatUniqueKey(matnr, batch, orderDetl.getUniqueField()));
+            if (!orderDetlService.updateById(orderDetl)) {
+                throw new CoolException("鏇存柊鏄庣粏绱㈠紩澶辫触");
+            }
+
         }
 
         List<Long> deleteDetlId = param.getDeleteDetlId();
@@ -224,6 +243,11 @@
 
     @Override
     public boolean deleteOrder(Long orderId) {
+        Order order = this.getById(orderId);
+        if (order.getHasWave() == 1) {
+            throw new CoolException("璁㈠崟宸茬粡鐢熸垚娉㈡锛屽垹闄ゅけ璐�");
+        }
+
         //鍒犻櫎璁㈠崟
         this.removeById(orderId);
         //鍒犻櫎鏄庣粏

--
Gitblit v1.9.1