From 1da002910c1d9d44cd195bd24d951b4942a4e29c Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期二, 14 一月 2025 14:58:02 +0800
Subject: [PATCH] 优化定时任务间隔及字段命名,调整环境配置

---
 src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 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 46ced6e..21e2a1d 100644
--- a/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/AgvMobileServiceImpl.java
@@ -17,10 +17,7 @@
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Optional;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -91,6 +88,17 @@
         //鏌ョ湅宸ヤ綔妗f槸鍚︽湁鐩稿悓璐ф灦锛屽瓨鍦ㄥ垯鎶涘嚭寮傚父
         if (!Cools.isEmpty(agvWrkMastService.selectByContainerCode(param.getBarcode()))) {
             throw new CoolException(param.getBarcode() + "璐ф灦鐮佸凡瀛樺湪AGV宸ヤ綔妗d腑");
+        }
+        //鍒ゆ柇鏄惁鏈夌浉鍚屾槑缁�
+        List<CombParam.CombMat> combMats = param.getCombMats();
+        Map<String, String> data = new HashMap<>();
+        for (CombParam.CombMat combMat : combMats) {
+            String matnr = combMat.getMatnr();
+            String csocode = combMat.getCsocode();
+            if (data.get(matnr + csocode) != null) {
+                throw new CoolException("鏄庣粏涓瓨鍦ㄧ浉鍚岀墿鏂欏彿鍜岃鍗曞彿");
+            }
+            data.put(matnr + csocode, matnr + csocode);
         }
 
         if (Cools.isEmpty(param.getOrderNo())) {
@@ -691,6 +699,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腑娌℃湁姝ょ珯鐐逛换鍔�");
@@ -746,6 +757,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);
@@ -774,6 +788,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