From b6681bc12173c1179d0185805ba461211472ac18 Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期日, 04 一月 2026 09:31:16 +0800
Subject: [PATCH] 1.完善出库任务呼叫agv 2.完善agv任务下发 3.等等

---
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java |   31 ++++++++++++++++++++-----------
 1 files changed, 20 insertions(+), 11 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 b48d5d9..59f9de5 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -22,6 +22,8 @@
 import com.zy.common.model.enums.WorkNoType;
 import com.zy.common.service.CommonService;
 import com.zy.common.utils.HttpHandler;
+import com.zy.system.entity.Config;
+import com.zy.system.service.impl.ConfigServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -114,6 +116,8 @@
     private BasStationService basStationService;
     @Autowired
     private BasContainerService basContainerService;
+    @Autowired
+    private ConfigServiceImpl configService;
 
     @Override
     @Transactional
@@ -606,9 +610,9 @@
                 if (Cools.isEmpty(mat)) {
                     throw new CoolException(detlDto.getMatnr() + "鍟嗗搧妗f涓嶅瓨鍦�");
                 }
-                if (mat.getUpQty().compareTo(detlDto.getAnfme()) < 0) {
-                    throw new CoolException("鐗╂枡锛�" + detlDto.getMatnr() + "鍗曟鏈�澶х粍鎵樹笂闄愪负锛�" + mat.getUpQty());
-                }
+//                if (mat.getUpQty().compareTo(detlDto.getAnfme()) < 0) {
+//                    throw new CoolException("鐗╂枡锛�" + detlDto.getMatnr() + "鍗曟鏈�澶х粍鎵樹笂闄愪负锛�" + mat.getUpQty());
+//                }
                 WaitPakin waitPakin = new WaitPakin();
                 BeanUtils.copyProperties(mat, waitPakin);
                 waitPakin.setBatch(detlDto.getBatch());
@@ -704,6 +708,9 @@
 //                if (suplus < 0) {
 //                    throw new CoolException("鐗╂枡锛�" + detlDto.getMatnr() + ", 瓒呭嚭褰撳墠鎵樼洏瑁呰浇涓婇檺锛侊紒");
 //                }
+                OrderDetlPakin detls = orderDetlPakinService.selectOne(new EntityWrapper<OrderDetlPakin>()
+                        .eq("order_no", param.getOrderNo())
+                        .eq("matnr", detlDto.getMatnr()));
 
                 WaitPakin waitPakin = new WaitPakin();
                 BeanUtils.copyProperties(mat, waitPakin);
@@ -719,6 +726,7 @@
                 waitPakin.setAppeTime(now);
                 waitPakin.setModiUser(userId);
                 waitPakin.setModiTime(now);
+                waitPakin.setStandby1(detls.getStandby1());//閰嶇洏鍙�
                 if (!waitPakinService.insert(waitPakin)) {
                     throw new CoolException("淇濆瓨鍏ュ簱閫氱煡妗eけ璐�");
                 }
@@ -729,7 +737,7 @@
                 Order order = OrderInAndOutUtil.selectByNo(Boolean.TRUE, orderNo);
                 OrderInAndOutUtil.updateOrder(Boolean.TRUE, order.getId(), 2L, userId);
             });
-            if(!Cools.isEmpty(param.getLocNo())){
+            if(!Cools.isEmpty(param.getRsta()) && param.getRsta().contains("-")){
                 //鐢熸垚AGV鎼繍浠诲姟
                 //鐢熸垚AGV鎼繍鍑哄簱浠诲姟
                 // 淇濆瓨宸ヤ綔妗�
@@ -739,12 +747,12 @@
                 if (param.getBarcode().charAt(0) == '3'){
                     s = "307";
                 }else if (param.getBarcode().charAt(0) == '4'){
-                    s = "401";
-                }else if (param.getBarcode().charAt(0) == '5'){
                     s = "402";
+                }else if (param.getBarcode().charAt(0) == '5'){
+                    s = "401";
                 }
-                String TaskNo = param.getBarcode()+"-"+date.getTime();
-                task.setWrkNo(Integer.getInteger(param.getBarcode()))
+                String TaskNo = param.getBarcode()+"aa"+date.getTime();
+                task.setWrkNo((int) date.getTime())
                         .setTaskNo(TaskNo)
                         .setIoTime(date)
                         .setWrkSts(301L) // 宸ヤ綔鐘舵�侊細301.浠诲姟涓嬪彂
@@ -755,7 +763,7 @@
                         .setPicking("N") // 鎷f枡
                         .setExitMk("N")// 閫�鍑�
                         .setStaNo(s)
-                        .setSourceStaNo(param.getLocNo())//绌烘枡鏋剁紦瀛樺尯E1
+                        .setSourceStaNo(param.getRsta())//agv鍙栬揣浣�
                         .setEmptyMk("N")// 绌烘澘
                         .setBarcode(param.getBarcode())// 鎵樼洏鐮�
                         .setLinkMis("N")
@@ -1330,8 +1338,9 @@
         //婊戝潡搴�
         if(locMast.getLocType3()==1){
             if(locMast.getLocType2()==1){
-
-
+                sta = "402";
+            }else if(locMast.getLocType2()==2){
+                sta = "401";
             }
         }else if(locMast.getLocType3()==2){
             sta="307";

--
Gitblit v1.9.1