From ee6e7a5260183a0ac977d6ff21fe3de6f70d3bdd Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期二, 18 六月 2024 16:56:40 +0800
Subject: [PATCH] #

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
index 7d42d63..41fe225 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
@@ -907,8 +907,13 @@
                     .eq(BasLed::getDeviceId, ledDevice.getId()));
             List<Integer> staArr = JSON.parseArray(led.getSta(), Integer.class);
 
+            BasConveyor basConveyor = basConveyorService.getById(led.getConveyorId().intValue());
+            if (basConveyor == null) {
+                continue;
+            }
+
             // 鑾峰彇杈撻�佺嚎plc绾跨▼
-            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Conveyor, led.getConveyorId().intValue());
+            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Conveyor, basConveyor.getDeviceId().intValue());
             // 鍛戒护闆嗗悎
             boolean reset = true;
             for (Integer staNo : staArr) {
@@ -937,8 +942,13 @@
                     .eq(BasLed::getDeviceId, ledDevice.getId()));
             List<Integer> staArr = JSON.parseArray(led.getSta(), Integer.class);
 
+            BasConveyor basConveyor = basConveyorService.getById(led.getConveyorId());
+            if (basConveyor == null) {
+                continue;
+            }
+
             // 鑾峰彇杈撻�佺嚎plc绾跨▼
-            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Conveyor, led.getConveyorId().intValue());
+            DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Conveyor, basConveyor.getDeviceId().intValue());
             // 鍛戒护闆嗗悎
             boolean reset = true;
             for (Integer staNo : staArr) {

--
Gitblit v1.9.1