From 786e52f559698f57a1e91aad2abc16c5453bd140 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期四, 16 五月 2024 14:14:05 +0800
Subject: [PATCH] # 手动移库生成

---
 src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java
index 33ff9a9..a8263ce 100644
--- a/src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java
@@ -326,7 +326,7 @@
         if (Cools.isEmpty(agvBasDevp)) {
             throw new CoolException("鏆傛棤"+ station + "绔欑偣");
         }
-        if (containerType == 40 && agvBasDevp.getFloor() == 3) {
+        if (containerType == 40) {
             locType = 5;
         } else if (containerType == 21 && agvBasDevp.getFloor() == 3) {
             locType = 4;
@@ -616,6 +616,15 @@
             String targetLocNo = wrkMast.getLocNo();
             agvLocMastService.updateLocStsByLocNo(locNo,"F",wrkMast.getBarcode(),(short)getContainerTypeByloc(locNo),"",(short)0);
             agvLocMastService.updateLocStsByLocNo(targetLocNo,"O","",null);
+            List<AgvLocDetl> agvLocDetls = agvLocDetlService.selectList(new EntityWrapper<AgvLocDetl>().eq("loc_no", locNo));
+            // 鏇存柊璁㈠崟
+            for (AgvLocDetl agvLocDetl : agvLocDetls) {
+                OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("order_no", "DB" + agvLocDetl.getOrderNo()).eq("matnr", agvLocDetl.getMatnr()).eq("three_code",agvLocDetl.getThreeCode()));
+                orderDetl.setQty(orderDetl.getQty() - agvLocDetl.getAnfme());
+                if (!orderDetlService.update(orderDetl,new EntityWrapper<OrderDetl>().eq("order_no","DB" + agvLocDetl.getOrderNo()).eq("matnr", agvLocDetl.getMatnr()).eq("three_code",agvLocDetl.getThreeCode()))){
+                    throw new CoolException("淇敼璁㈠崟鏄庣粏澶辫触锛岃鑱旂郴绠$悊鍛�"+agvLocDetl.getOrderNo()+agvLocDetl.getMatnr());
+                }
+            }
             //鍑哄簱鍙栨秷
         } else {
             //婧愬簱浣�

--
Gitblit v1.9.1