From 0a6532305b842185c85afd4e8c670f64700f2a6d Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 28 八月 2024 17:03:54 +0800
Subject: [PATCH] #

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java |   42 ++++++++++++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 10 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 c2592f2..d2125de 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
@@ -99,6 +99,11 @@
                 BasConveyor basConveyor = basConveyorService.getOne(new LambdaQueryWrapper<BasConveyor>().eq(BasConveyor::getDeviceId, devp.getId()).eq(BasConveyor::getHostId, devp.getHostId()));
                 // 閬嶅巻鍏ュ簱鍙�
                 for (StaDto inSta : JSON.parseArray(basConveyor.getInSta(), StaDto.class)) {
+                    BasConveyorSta basConveyorSta = basConveyorStaService.selectBySiteNo(inSta.getStaNo().toString());
+                    if(basConveyorSta == null) {
+                        continue;
+                    }
+
                     // 鑾峰彇鍏ュ簱绔欎俊鎭�
                     DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Conveyor, devp.getId().intValue());
                     StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo());
@@ -156,7 +161,7 @@
                     ) {
 
                         // 鑾峰彇鏉$爜鎵弿浠俊鎭�
-                        BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode());
+                        BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, basConveyorSta.getBarcodeId().intValue());
                         if (barcodeThread == null) {
                             continue;
                         }
@@ -306,6 +311,17 @@
                         mapNode.setNo(object.getString("row") + "-" + object.getString("bay"));
                         mapNode.setXBase(object.getInteger("refx"));
                         mapNode.setYBase(object.getInteger("refy"));
+
+                        if(mapNode.getValue() == MapNodeType.CONVEYOR.id) {
+                            //杈撻�佺嚎,鍒ゆ柇灏忚溅鏄惁鍙蛋
+                            if (object.containsKey("conveyorHasGo")) {
+                                if(object.getBoolean("conveyorHasGo")) {
+                                    //灏忚溅鍙蛋
+                                    mapNode.setValue(MapNodeType.CONVEYOR_CAR_GO.id);
+                                }
+                            }
+                        }
+
                         nodes.add(mapNode);
                     }
 
@@ -328,7 +344,7 @@
                         //瀛樺湪绌虹己鑺傜偣锛岃嚜鍔ㄨˉ瓒�
                         for (int i = defaultBay; i < node.getBay(); i++) {
                             MapNode mapNode = new MapNode();
-                            mapNode.setValue(-1);
+                            mapNode.setValue(MapNodeType.DISABLE.id);
                             mapNode.setTop(1000);
                             mapNode.setBottom(1000);
                             mapNode.setLeft(1000);
@@ -355,7 +371,7 @@
                 ArrayList<ArrayList<MapNode>> lists = entry.getValue();//鑾峰彇鍦板浘
 
                 MapNode mapNode = new MapNode();
-                mapNode.setValue(-1);
+                mapNode.setValue(MapNodeType.DISABLE.id);
                 mapNode.setTop(1000);
                 mapNode.setBottom(1000);
                 mapNode.setLeft(1000);
@@ -428,15 +444,21 @@
             if (basConveyor == null) {
                 continue;
             }
-            DeviceBarcode deviceBarcode = deviceBarcodeService.getById(basConveyorSta.getBarcodeId());
-            if (deviceBarcode == null) {
+//            DeviceBarcode deviceBarcode = deviceBarcodeService.getById(basConveyorSta.getBarcodeId());
+//            if (deviceBarcode == null) {
+//                continue;
+//            }
+//            BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, Integer.parseInt(deviceBarcode.getDeviceId()));
+//            if (barcodeThread == null) {
+//                continue;
+//            }
+//            if (!barcodeThread.getBarcode().equals(task.getZpallet())) {
+//                continue;
+//            }
+            if (Cools.isEmpty(basConveyorSta.getTaskNo())){
                 continue;
             }
-            BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, Integer.parseInt(deviceBarcode.getDeviceId()));
-            if (barcodeThread == null) {
-                continue;
-            }
-            if (!barcodeThread.getBarcode().equals(task.getZpallet())) {
+            if (!basConveyorSta.getTaskNo().toString().equals(task.getTaskNo())){
                 continue;
             }
             DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Conveyor, basConveyor.getDeviceId().intValue());

--
Gitblit v1.9.1