#
zjj
2024-06-19 37733cc39c04b863a0b997c7fa3d9ac6a24e08be
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/Utils.java
@@ -207,40 +207,4 @@
        return true;//有任务绑定
    }
    /**
     * 获取距离目标库位最近的提升机
     */
    public static Device getRecentTransferLift(String locNo, Integer shuttleNo) {
        BasLiftService basLiftService = SpringUtils.getBean(BasLiftService.class);
        DeviceService deviceService = SpringUtils.getBean(DeviceService.class);
        if (basLiftService == null) {
            return null;
        }
        Integer distance = Integer.MAX_VALUE;
        Long liftDeviceId = null;
        for (BasLift basLift : basLiftService.list(new LambdaQueryWrapper<BasLift>()
                .eq(BasLift::getStatus, 1)
                .eq(BasLift::getTransfer, 1))) {
            int lev = Utils.getLev(locNo);
            String liftLocNo = Utils.getLocNo(basLift.getRow(), basLift.getBay(), lev);
            List<NavigateNode> nodeList = NavigateUtils.calc(locNo, liftLocNo, NavigationMapType.NONE.id, Utils.getShuttlePoints(shuttleNo, Utils.getLev(locNo)));
            Integer originPathAllDistance = NavigateUtils.getOriginPathAllDistance(nodeList);//总距离
            if (originPathAllDistance < distance) {
                distance = originPathAllDistance;
                liftDeviceId = basLift.getDeviceId();
            }
        }
        if (liftDeviceId == null) {
            return null;
        }
        Device device = deviceService.getById(liftDeviceId);
        if (device == null) {
            return null;
        }
        return device;
    }
}