From 11d097884349345e3bdbdc5f0c421bd7f0243bc8 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期六, 31 八月 2024 16:50:33 +0800 Subject: [PATCH] # --- zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java | 66 +++++++++++++++++++++++++++++++-- 1 files changed, 62 insertions(+), 4 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 c8e4bfd..149dbc5 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 @@ -82,6 +82,8 @@ private BasConveyorPathService basConveyorPathService; @Autowired private BasLedService basLedService; + @Autowired + private DeviceBarcodeService deviceBarcodeService; /** * 缁勬墭 @@ -97,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()); @@ -154,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; } @@ -209,7 +216,7 @@ param.setLocType1(staProtocol.getLocType1().shortValue()); String response = new HttpHandler.Builder() .setUri(wmsUrl) - .setPath("/rpc/pakin/loc/v2") + .setPath("/rpc/pakin/loc/v1") .setJson(JSON.toJSONString(param)) .build() .doPost(); @@ -304,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); } @@ -326,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); @@ -353,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); @@ -418,6 +436,46 @@ // 瑙f瀽鍏ュ簱宸ヤ綔妗� public synchronized void analyzeInBoundTask() { for (Task task : taskService.selectWaitAnalyzeInBoundTask()) { + BasConveyorSta basConveyorSta = basConveyorStaService.getOne(new LambdaQueryWrapper<BasConveyorSta>().eq(BasConveyorSta::getSiteNo, task.getDestSite())); + if (basConveyorSta == null) { + continue; + } + BasConveyor basConveyor = basConveyorService.getById(basConveyorSta.getConveyorId()); + if (basConveyor == null) { + continue; + } +// 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; + } + if (!basConveyorSta.getTaskNo().toString().equals(task.getTaskNo())){ + continue; + } + DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Conveyor, basConveyor.getDeviceId().intValue()); + if (devpThread == null) { + continue; + } + StaProtocol staProtocol = devpThread.getStation().get(basConveyorSta.getSiteNo()); + if (staProtocol == null) { + continue; + } + if (!(staProtocol.isAutoing() + && staProtocol.isLoading() + && staProtocol.isInEnable())) { + continue; + } + + if (Cools.isEmpty(task.getShuttleNo())) { //鍒嗛厤灏忚溅 //鎼滅储绌洪棽杞� -- Gitblit v1.9.1