From 9f1da5a5ad0cdc826ca8dcbb5b9690a6a17208ee Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 20 三月 2023 13:05:33 +0800
Subject: [PATCH] 入出库对外接口增加weight字段

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index 8f7de88..7450d05 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -92,16 +92,24 @@
         }
 
         int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode()));
-        int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode()));
-        if (countLoc > 0 || countWrk > 0) {
+        WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode());
+        if (wrkMast != null && wrkMast.getIoType() < 100){
+            throw new CoolException("宸ヤ綔妗�/搴撳瓨鏉$爜鏁版嵁宸插瓨鍦�===>>" + param.getBarcode());
+
+        }
+        if (countLoc > 0 ) {
             throw new CoolException("宸ヤ綔妗�/搴撳瓨鏉$爜鏁版嵁宸插瓨鍦�===>>" + param.getBarcode());
         }
+
+
         //璁剧疆闈瀗ull鎵瑰彿锛�
         for (CombParam.CombMat combMat : param.getCombMats()) {
             if (combMat.getBatch() == null){
                 combMat.setBatch("");
             }
         }
+
+
 
 
         Date now = new Date();
@@ -145,6 +153,18 @@
             }
         // 鍏宠仈缁勬墭
         } else {
+            for (CombParam.CombMat combMat : param.getCombMats()) {
+                Integer sum = orderDetlService.sameOrderComb(param.getOrderNo(), combMat.getMatnr(),combMat.getBatch());
+                OrderDetl orderDetl = orderDetlService.selectItem(param.getOrderNo(), combMat.getMatnr(), combMat.getBatch());
+                if (orderDetl == null) {
+                    throw new CoolException("鎵句笉鍒扮粍鎵樼殑鍗曟嵁鏄庣粏");
+
+                }
+                Double anfme = orderDetl.getAnfme();
+                if ( anfme > (anfme - sum)) {
+                    throw new CoolException("缁勬墭鏁伴噺宸茶秴鍑鸿鍗曢渶姹傞噺锛岃妫�鏌ユ槸鍚︽湁鍏朵粬鐨勭粍鎵樺凡瀹屾垚");
+                }
+            }
             Order order = orderService.selectByNo(param.getOrderNo());
             if (order.getSettle() > 2) {
                 throw new CoolException("鍗曟嵁缂栧彿宸茶繃鏈�");

--
Gitblit v1.9.1