From 2bc10d832acd06bc6511e50405202fde99b0e7c2 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期六, 18 一月 2025 10:20:25 +0800
Subject: [PATCH] java 优化库位检索逻辑,添加AGV工作明细服务,修复定时任务

---
 src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java
index 05605cf..49d9eee 100644
--- a/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java
@@ -179,6 +179,7 @@
             // 鏇存柊璁㈠崟
             OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("order_no", pick.getOrderNo()).eq("matnr", pick.getMatnr()).eq("three_code", pick.getThreeCode()));
             orderDetl.setQty(orderDetl.getQty() + pick.getCount());
+            orderDetl.setUpdateTime(new Date());
             if (!orderDetlService.update(orderDetl, new EntityWrapper<OrderDetl>().eq("order_no", pick.getOrderNo()).eq("matnr", pick.getMatnr()).eq("three_code", pick.getThreeCode()))) {
                 throw new CoolException("淇敼璁㈠崟鏄庣粏澶辫触锛岃鑱旂郴绠$悊鍛�" + pick.getOrderNo() + pick.getMatnr());
             }
@@ -353,6 +354,10 @@
 
         AgvBasDevp agvBasDevp = agvBasDevpService.selectOne(new EntityWrapper<AgvBasDevp>().eq("dev_no", stationCode));
 
+        if (agvBasDevp == null) {
+            throw new CoolException(stationCode + "绔欑偣淇℃伅閿欒");
+        }
+
         if (Cools.eq(agvBasDevp.getBarcode(), barcode)) {
             return;
         }
@@ -367,9 +372,7 @@
             throw new CoolException(barcode + "宸茬粡缁戝畾鍦�" + agvBasDevp.getDevNo() + "绔欑偣");
         }
 
-        if (agvBasDevp == null) {
-            throw new CoolException(stationCode + "绔欑偣淇℃伅閿欒");
-        }
+
         if (!"O".equals(agvBasDevp.getLocSts())) {
             throw new CoolException(stationCode + "璇ョ珯鐐硅揣浣嶇姸鎬侀潪绌�");
         }
@@ -651,6 +654,9 @@
     @Transactional
     public String allocationIn(AgvMobileStartPakin param, Long userId) {
         Date now = new Date();
+        if (Cools.isEmpty(param.getBarcode())) {
+            throw new CoolException("璇疯緭鍏ヨ揣鏋剁爜");
+        }
         AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode", param.getBarcode()));
         if (Cools.isEmpty(agvWrkMast)) {
             throw new CoolException("鏆傛棤褰撳墠璐ф灦鐮佺殑浠诲姟");
@@ -699,6 +705,9 @@
             throw new CoolException("璇疯緭鍏ヨ揣鏋剁爜");
         }
         AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("source_loc_no", param.getDevNo()));
+        if (agvWrkMast == null) {
+            throw new CoolException("褰撳墠璐ф灦鐮佹病鏈変换鍔�");
+        }
         Integer oldWrkNo = agvWrkMast.getWrkNo();
         if (Cools.isEmpty(agvWrkMast)) {
             throw new CoolException("宸ヤ綔妗d腑娌℃湁姝ょ珯鐐逛换鍔�");
@@ -725,6 +734,9 @@
     @Synchronized
     public String empIn(AgvMobileStartPakin param, Long userId) {
         Date now = new Date();
+        if (Cools.isEmpty(param.getBarcode())) {
+            throw new CoolException("璇疯緭鍏ヨ揣鏋剁爜");
+        }
         AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode", param.getBarcode()));
         if (Cools.isEmpty(agvWrkMast)) {
             throw new CoolException("宸ヤ綔妗d腑娌℃湁姝ょ珯鐐逛换鍔�");
@@ -754,6 +766,9 @@
     public String handBack(AgvMobileStartPakin param, Long userId) {
         Date now = new Date();
         AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("source_loc_no", param.getDevNo()));
+        if (agvWrkMast == null){
+            throw new CoolException("宸ヤ綔妗d腑娌℃湁姝ょ珯鐐逛换鍔�");
+        }
         agvWrkMast.setIoType(113);
         agvWrkMast.setModiUser(userId);
         agvWrkMast.setModiTime(now);
@@ -782,6 +797,9 @@
         agvWrkDetlLogService.save(agvWrkMast.getWrkNo());
         String sourceLocNo = agvWrkMast.getSourceLocNo();
         AgvLocMast newLocMast = agvCommonService.getLocNo(3, 1, false, false);
+        if (newLocMast==null){
+            throw new CoolException("鏃犲彲鐢ㄥ簱浣�");
+        }
         agvWrkMast.setSourceLocNo(agvWrkMast.getLocNo());
         agvWrkMast.setLocNo(newLocMast.getLocNo());
         agvWrkMast.setIoType(57);

--
Gitblit v1.9.1