#
Junjie
2024-06-12 e028a49bb9047969de47ce3c6b005b332020249e
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigatePositionConvert.java
@@ -15,14 +15,15 @@
        String locNo = Utils.getLocNo(x, y, z);
        //库位号转小车二维码
        LocService locMastService = SpringUtils.getBean(LocService.class);
        Loc locMast = locMastService.getOne(new LambdaQueryWrapper<Loc>()
        LocService locService = SpringUtils.getBean(LocService.class);
        Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>()
                .eq(Loc::getLocNo, locNo)
                .eq(Loc::getHostId, hostId));
        if (locMast == null) {
                .eq(Loc::getHostId, hostId)
                .eq(Loc::getStatus, 1));
        if (loc == null) {
            return null;
        }
        return locMast.getCode();
        return loc.getCode();
    }
    //坐标编号转xy轴
@@ -45,6 +46,19 @@
        return node;
    }
    //小车条形码转路径算法节点
    public static NavigateNode codeToNode(String code, Long hostId) {
        LocService locService = SpringUtils.getBean(LocService.class);
        Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>()
                .eq(Loc::getCode, code)
                .eq(Loc::getHostId, hostId)
                .eq(Loc::getStatus, 1));
        NavigateNode node = new NavigateNode(loc.getRow(), loc.getBay());
        node.setZ(loc.getLev());
        return node;
    }
    //路径算法节点转WCS系统库位号
    public static String nodeToLocNo(NavigateNode node) {
        return xyzToLocNo(node.getX(), node.getY(), node.getZ());