From 69e1880e5486ebc62da4806642ca817afda9c84c Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期四, 05 十月 2023 14:09:45 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/thread/NyShuttleThread.java | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zy/core/thread/NyShuttleThread.java b/src/main/java/com/zy/core/thread/NyShuttleThread.java index e627a9f..1ba299f 100644 --- a/src/main/java/com/zy/core/thread/NyShuttleThread.java +++ b/src/main/java/com/zy/core/thread/NyShuttleThread.java @@ -336,6 +336,7 @@ ); opt.setSend(1);//宸蹭笅鍙� opt.setResponse(JSON.toJSONString(result));//璇锋眰鍝嶅簲 + opt.setDeviceWrk(command.getWrkNo().toString());//璁惧宸ヤ綔鍙� shuttleOptService.insert(opt); } @@ -446,8 +447,9 @@ } if (shuttleProtocol.getFree() == ShuttleStatusType.BUSY.id) { - //鍋滄鍏呯數 - if(!(command.getRequest().getBody().get("requestType").equals("stopCharge") && shuttleProtocol.getChargState() == 1)){ + String requestType = command.getRequest().getBody().get("requestType").toString(); + //鍋滄鍏呯數 绠″埗鍛戒护 + if(!(requestType.equals("stopCharge") && shuttleProtocol.getChargState() == 1) && !requestType.equals("resume")){ return false;//灏忚溅鐘舵�佸繖锛岀姝㈡墽琛屽懡浠� } } @@ -705,6 +707,19 @@ return; } + if (shuttleProtocol.getYCurrent() > shuttleProtocol.getYTarget()) { + //璺戝簱缁撴潫 + shuttleProtocol.setMoveLoc(false); + shuttleProtocol.setMoveType(0); + shuttleProtocol.setXStart(0); + shuttleProtocol.setXTarget(0); + shuttleProtocol.setXCurrent(0); + shuttleProtocol.setYStart(0); + shuttleProtocol.setYTarget(0); + shuttleProtocol.setYCurrent(0); + return; + } + if (shuttleProtocol.getMoveType() == 0) {//璺戣建閬� ArrayList<String> locs = new ArrayList<>(); for (int i = shuttleProtocol.getXCurrent(); i <= shuttleProtocol.getXTarget(); i++) { @@ -735,7 +750,35 @@ } } }else {//璺戝簱浣� + Integer xCurrent = shuttleProtocol.getXCurrent(); + if (xCurrent > shuttleProtocol.getXTarget()) {//褰揦鍊煎ぇ浜嶺鐩爣鍊硷紝杩涜褰掗浂涓擸鏂瑰悜+1 + shuttleProtocol.setXCurrent(shuttleProtocol.getXStart()); + shuttleProtocol.setYCurrent(shuttleProtocol.getYCurrent() + 1); + return; + } + Integer yCurrent = shuttleProtocol.getYCurrent(); + String locNo = Utils.getLocNo(xCurrent, yCurrent, lev); + LocMast target = locMastService.selectById(locNo); + if (target == null) { + shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1); + return; + } + + if (!target.getLocSts().equals("O")) { + shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1); + return; + } + + //璋冨害鍘荤洰鏍囦綅缃� + if (shuttleProtocol.getCurrentLocNo().equals(target.getLocNo())) { + shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1);//灏忚溅鍜岀洰鏍囦綅缃竴鑷达紝璺宠繃 + }else { + boolean result = shuttleDispatchUtils.dispatchShuttle(commonService.getWorkNo(3), target.getLocNo()); + if (result) {//璋冨害鎴愬姛 + shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1); + } + } } } -- Gitblit v1.9.1