From 38ca6237e0375e77b11c05b1ae0b1c9fe0dd94ec Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期二, 17 六月 2025 10:33:05 +0800
Subject: [PATCH] Merge branch 'jbly' into zkd

---
 zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/CodeServiceImpl.java    |   10 +++++++---
 zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/FuncStaServiceImpl.java |    7 ++-----
 zy-acs-manager/src/main/java/com/zy/acs/manager/core/constant/AreaConstant.java              |    2 ++
 zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/MissionServiceImpl.java |    9 ++++++++-
 4 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/constant/AreaConstant.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/constant/AreaConstant.java
index 25f5d31..36098be 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/core/constant/AreaConstant.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/core/constant/AreaConstant.java
@@ -251,6 +251,8 @@
         add("00001704");
         add("00001705");
         add("00001706");
+        add("00001850");
+        add("00001851");
     }};
 
     public static final ArrayList<String> LEFT_AREA  = new ArrayList<String>(){{
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/CodeServiceImpl.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/CodeServiceImpl.java
index cf2a240..35c0024 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/CodeServiceImpl.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/CodeServiceImpl.java
@@ -179,8 +179,8 @@
         Double maxY = Double.parseDouble(String.valueOf(map.get("max_y")));
 
         // 缂╂斁鍚庨渶瑕佺殑鍋忕Щ閲�
-        double scaleOffsetX = width *  (1 -CodeUtils.ADAPTATION_SCALE) / 2;
-        double scaleOffsetY = height *  (1 -CodeUtils.ADAPTATION_SCALE) / 2;
+        double scaleOffsetX = width * (1 - CodeUtils.ADAPTATION_SCALE) / 2;
+        double scaleOffsetY = height * (1 - CodeUtils.ADAPTATION_SCALE) / 2;
 
         List<Code> codeList = this.list();
         for (Code code : codeList) {
@@ -213,7 +213,11 @@
         List<Long> ids = this.baseMapper.selectAllLocCode();
         List<Code> codeList = new ArrayList<>();
         for (Long id : ids) {
-            codeList.add(this.getById(id));
+            Code byId = this.getById(id);
+            if (byId != null) {
+                codeList.add(byId);
+            }
+
         }
         return codeList;
     }
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/FuncStaServiceImpl.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/FuncStaServiceImpl.java
index b5c2bf0..b98f6bb 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/FuncStaServiceImpl.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/FuncStaServiceImpl.java
@@ -7,10 +7,7 @@
 import com.zy.acs.manager.common.utils.CommonUtil;
 import com.zy.acs.manager.core.constant.AgvAreaDispatcher;
 import com.zy.acs.manager.manager.entity.*;
-import com.zy.acs.manager.manager.enums.FuncStaType;
-import com.zy.acs.manager.manager.enums.StatusType;
-import com.zy.acs.manager.manager.enums.TaskStsType;
-import com.zy.acs.manager.manager.enums.TaskTypeType;
+import com.zy.acs.manager.manager.enums.*;
 import com.zy.acs.manager.manager.mapper.FuncStaMapper;
 import com.zy.acs.manager.manager.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -56,7 +53,7 @@
     @Override
     public List<FuncSta> findInIdleStatus(FuncStaType type, Long agvId) {
         LambdaQueryWrapper<FuncSta> wrapper = new LambdaQueryWrapper<FuncSta>()
-                .eq(FuncSta::getType, type).eq(FuncSta::getStatus, StatusType.ENABLE.val);
+                .eq(FuncSta::getType, type).eq(FuncSta::getStatus, StatusType.ENABLE.val).eq(FuncSta::getState, FuncStaStateType.IDLE.toString());
         List<FuncSta> funcStaList = this.list(wrapper);
 
         if (Cools.isEmpty(funcStaList)) {
diff --git a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/MissionServiceImpl.java b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/MissionServiceImpl.java
index 630daac..f205ea9 100644
--- a/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/MissionServiceImpl.java
+++ b/zy-acs-manager/src/main/java/com/zy/acs/manager/manager/service/impl/MissionServiceImpl.java
@@ -2,6 +2,7 @@
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.zy.acs.framework.common.Cools;
+import com.zy.acs.framework.exception.CoolException;
 import com.zy.acs.manager.common.exception.BusinessException;
 import com.zy.acs.manager.manager.controller.result.MissionVo;
 import com.zy.acs.manager.manager.entity.*;
@@ -70,7 +71,13 @@
         Long recentCode = agvDetail.getRecentCode();
         String currCode = null;
         if (null != recentCode) {
-            currCode = codeService.getCacheById(recentCode).getData();
+            Code cacheById = codeService.getCacheById(recentCode);
+            if (cacheById != null) {
+                currCode = cacheById.getData();
+            } else {
+                throw new CoolException(segment.getAgvId() + "灏忚溅杩樺湪鍒犻櫎鐨勭偣浣嶄腑");
+            }
+
         }
 
         // action -------------------------------

--
Gitblit v1.9.1