From e45a2aafabf9e76bf6556922c90104ea69ecae5a Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期二, 23 四月 2024 13:16:56 +0800
Subject: [PATCH] #

---
 /dev/null                                                                   |   79 --------------------------
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/ShuttleDispatcher.java |   80 --------------------------
 2 files changed, 0 insertions(+), 159 deletions(-)

diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/LiftCodeType.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/LiftCodeType.java
deleted file mode 100644
index 22465ab..0000000
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/LiftCodeType.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.zy.asrs.wcs.core.model.enums;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.zy.asrs.framework.common.SpringUtils;
-import com.zy.asrs.wcs.core.entity.Loc;
-import com.zy.asrs.wcs.core.service.LocService;
-import com.zy.asrs.wcs.core.utils.Utils;
-
-public enum LiftCodeType {
-
-    NONE(-1, -1, "鏈煡", "0402001"),
-    LIFT_2(2, 198, "2鍙锋彁鍗囨満浜岀淮鐮�", "0402001"),
-    LIFT_1(1, 0, "1鍙锋彁鍗囨満鏃犱簩缁寸爜", "0800701"),
-    ;
-
-    public Integer liftNo;
-    public Integer code;
-    public String desc;
-    public String standbyLocNo;//寰呮満搴撲綅
-
-    LiftCodeType(Integer liftNo, Integer code, String desc, String standbyLocNo) {
-        this.liftNo = liftNo;
-        this.code = code;
-        this.desc = desc;
-        this.standbyLocNo = standbyLocNo;
-    }
-
-    public static LiftCodeType query(Integer code) {
-        for (LiftCodeType value : LiftCodeType.values()) {
-            if (value.code.equals(code)) {
-                return value;
-            }
-        }
-        return NONE;
-    }
-
-    public static String getLocNo(Integer liftNo, Integer lev, Long hostId) {
-        LiftCodeType type = null;
-        for (LiftCodeType value : LiftCodeType.values()) {
-            if (value.liftNo.equals(liftNo)) {
-                type = value;
-                break;
-            }
-        }
-
-        if (type == null) {
-            return null;
-        }
-
-        LocService locService = SpringUtils.getBean(LocService.class);
-        Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>()
-                .eq(Loc::getHostId, hostId)
-                .eq(Loc::getCode, type.code)
-                .eq(Loc::getLev, lev));
-        if (loc == null) {
-            return null;
-        }
-
-        return loc.getLocNo();
-    }
-
-
-    public static String getStandbyLocNo(Integer liftNo, Integer lev) {
-        LiftCodeType type = null;
-        for (LiftCodeType value : LiftCodeType.values()) {
-            if (value.liftNo.equals(liftNo)) {
-                type = value;
-                break;
-            }
-        }
-
-        if (type == null) {
-            return null;
-        }
-
-        return Utils.getLocNo(Utils.getRow(type.standbyLocNo), Utils.getBay(type.standbyLocNo), lev);
-    }
-
-}
diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/ShuttleDispatcher.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/ShuttleDispatcher.java
index 1135d69..b56b3ff 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/ShuttleDispatcher.java
+++ b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/ShuttleDispatcher.java
@@ -10,7 +10,6 @@
 import com.zy.asrs.wcs.core.kernel.AnalyzeService;
 import com.zy.asrs.wcs.core.model.NavigateNode;
 import com.zy.asrs.wcs.core.model.enums.DeviceCtgType;
-import com.zy.asrs.wcs.core.model.enums.LiftCodeType;
 import com.zy.asrs.wcs.core.model.enums.NavigationMapType;
 import com.zy.asrs.wcs.core.model.enums.TaskStsType;
 import com.zy.asrs.wcs.core.service.*;
@@ -53,85 +52,6 @@
     private TaskCtgService taskCtgService;
     @Autowired
     private ShuttleStandbyService shuttleStandbyService;
-
-    public ShuttleThread queryShuttleWhichConvenient(Task task, Integer liftNo) {
-        String locNo = taskService.judgeInbound(task) ? task.getDestLoc() : task.getOriginLoc();
-        ShuttleThread resThread = null;
-        Integer finalDistance = ShuttleDispatcher.INF;
-
-        List<Device> list = deviceService.list(new LambdaQueryWrapper<Device>()
-                .eq(Device::getDeviceType, DeviceCtgType.SHUTTLE.val())
-                .eq(Device::getHostId, task.getHostId())
-                .eq(Device::getStatus, 1));
-
-        for (Device device : list) {
-            if (taskService.hasBusyOutboundByShuttle(Integer.parseInt(device.getDeviceNo()))) {
-                continue;
-            }
-            //鑾峰彇鍥涘悜绌挎杞︾嚎绋�
-            ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getId().intValue());
-            ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
-            if (shuttleProtocol == null || shuttleProtocol.getShuttleNo() == null) {
-                continue;
-            }
-
-            if (!shuttleThread.isIdle()) {
-                continue;
-            }
-
-            //妫�娴嬫槸鍚﹀瓨鍦ㄥ厖鐢典换鍔�
-            Task taskCharge = taskService.selectChargeWorking(Integer.valueOf(device.getDeviceNo()));
-            if (taskCharge != null) {
-                continue;
-            }
-
-            // 鏈夋病鏈夎鍏朵粬浠诲姟璋冨害
-            int currentLev = Utils.getLev(shuttleProtocol.getCurrentLocNo());//灏忚溅褰撳墠灞傞珮
-            String currentLocNo = shuttleProtocol.getCurrentLocNo();//灏忚溅褰撳墠搴撲綅鍙�
-
-            if (currentLocNo.equals(locNo)) {
-                resThread = shuttleThread;
-                break;
-            }
-
-            String targetLocNo = LiftCodeType.getStandbyLocNo(liftNo, currentLev);//榛樿鍒版彁鍗囨満寰呮満浣�
-            // 鍚屾ゼ灞傜洿鎺ヨ绠楀埌鐩爣搴撲綅
-            if (currentLev == Utils.getLev(locNo)) {
-                targetLocNo = locNo;
-            }
-
-            //褰撳墠绌挎杞︾嚎绋嬪埌褰撳墠杞﹀瓙鎵�鍦ㄦゼ灞傜殑鎻愬崌鏈哄彛璺濈
-            List<NavigateNode> currentShuttlePath = NavigateUtils.calc(
-                    currentLocNo
-                    , targetLocNo
-                    , NavigationMapType.NORMAL.id
-                    , Utils.getShuttlePoints(Integer.parseInt(shuttleThread.getDevice().getDeviceNo()), currentLev)
-            );//鎼滅储绌洪棽绌挎杞︼紝浣跨敤姝e父閫氶亾鍦板浘
-            if (currentShuttlePath == null) {
-                continue;
-            }
-
-            Integer currDistance = NavigateUtils.getOriginPathAllDistance(currentShuttlePath);//璁$畻褰撳墠璺緞琛岃蛋鎬昏窛绂�
-
-            // 涓嶅悓妤煎眰鏉冮噸
-            if (currentLev != Utils.getLev(locNo)) {
-                currDistance += WEIGHT;
-            }
-
-            // 鎸傝浇浠诲姟鏉冮噸
-            List<Task> tasks = taskService.selectWorkingByShuttle(Integer.valueOf(device.getDeviceNo()));
-            if (!Cools.isEmpty(tasks)) {
-                currDistance += tasks.size() * WEIGHT;
-            }
-
-            if (currDistance < finalDistance) {
-                finalDistance = currDistance;
-                resThread = shuttleThread;
-            }
-        }
-
-        return resThread;
-    }
 
     public synchronized ShuttleThread searchIdleShuttle(Task task) {
         String locNo = taskService.judgeInbound(task) ? task.getDestLoc() : task.getOriginLoc();

--
Gitblit v1.9.1