自动化立体仓库 - WCS系统
#
Junjie
2025-01-08 1ff4b70e59b8c9ceb80d0a695d26b4419ed349f1
src/main/java/com/zy/common/utils/NavigateMapData.java
@@ -272,53 +272,57 @@
        //过滤数据
        LocMastService locMastService = SpringUtils.getBean(LocMastService.class);
        //获取当前楼层库位数据
        List<LocMast> locMasts = locMastService.selectLocByLev(lev);
        for (LocMast locMast : locMasts) {
            Integer row = locMast.getRow1();
            Integer bay = locMast.getBay1();
        try {
            //获取当前楼层库位数据
            List<LocMast> locMasts = locMastService.selectLocByLev(lev);
            for (LocMast locMast : locMasts) {
                Integer row = locMast.getRow1();
                Integer bay = locMast.getBay1();
            boolean whiteFlag = false;//默认不存在白名单
            if (whitePoints != null) {
                for (int[] whitePoint : whitePoints) {
                    if (whitePoint[0] == row && whitePoint[1] == bay) {
                        //存在白名单
                        whiteFlag = true;
                        break;
                boolean whiteFlag = false;//默认不存在白名单
                if (whitePoints != null) {
                    for (int[] whitePoint : whitePoints) {
                        if (whitePoint[0] == row && whitePoint[1] == bay) {
                            //存在白名单
                            whiteFlag = true;
                            break;
                        }
                    }
                }
            }
            if (whiteFlag) {
                continue;//存在白名单,不执行下列过滤方案
            }
            List<MapNode> list = lists.get(row);
            MapNode mapNode = list.get(bay);
            if (mapType == NavigationMapType.NONE.id) {
                //不过滤任何数据
            } else if (mapType == NavigationMapType.DFX.id) {
                //车辆有货
                //读取对应库位数据,将DFX库位状态的节点置为-1(障碍物)
                if (locMast.getLocSts().equals("F")
                        || locMast.getLocSts().equals("D")
                        || locMast.getLocSts().equals("X")
                        || locMast.getLocSts().equals("R")
                        || locMast.getLocSts().equals("P")
                ) {
                    mapNode.setValue(MapNodeType.DISABLE.id);//禁用节点
                if (whiteFlag) {
                    continue;//存在白名单,不执行下列过滤方案
                }
            } else if (mapType == NavigationMapType.NORMAL.id) {
                //过滤库位状态X
                if (locMast.getLocSts().equals("X")) {
                    mapNode.setValue(MapNodeType.DISABLE.id);//禁用节点
                }
            }
            //更新list
            list.set(bay, mapNode);
            lists.set(row, list);
                List<MapNode> list = lists.get(row);
                MapNode mapNode = list.get(bay);
                if (mapType == NavigationMapType.NONE.id) {
                    //不过滤任何数据
                } else if (mapType == NavigationMapType.DFX.id) {
                    //车辆有货
                    //读取对应库位数据,将DFX库位状态的节点置为-1(障碍物)
                    if (locMast.getLocSts().equals("F")
                            || locMast.getLocSts().equals("D")
                            || locMast.getLocSts().equals("X")
                            || locMast.getLocSts().equals("R")
                            || locMast.getLocSts().equals("P")
                    ) {
                        mapNode.setValue(MapNodeType.DISABLE.id);//禁用节点
                    }
                } else if (mapType == NavigationMapType.NORMAL.id) {
                    //过滤库位状态X
                    if (locMast.getLocSts().equals("X")) {
                        mapNode.setValue(MapNodeType.DISABLE.id);//禁用节点
                    }
                }
                //更新list
                list.set(bay, mapNode);
                lists.set(row, list);
            }
        }catch (Exception e) {
            e.printStackTrace();
        }
        //加载车辆坐标到地图中
@@ -355,36 +359,40 @@
            }
        }
        //加载货叉提升机放货点位数据
        for (ForkLiftSlave forkLiftSlave : slaveProperties.getForkLift()) {
            ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, forkLiftSlave.getId());
            if (forkLiftThread == null) {
                continue;
            }
            for (ForkLiftStaProtocol staProtocol : forkLiftThread.getForkLiftStaProtocols()) {
                int row = Utils.getRow(staProtocol.getLocNo());
                int bay = Utils.getBay(staProtocol.getLocNo());
                List<MapNode> list = lists.get(row);
                MapNode mapNode = list.get(bay);
                if (mapType == NavigationMapType.DFX.id) {
                    //车辆有货
                    if (staProtocol.getHasTray() != null && staProtocol.getHasTray()) {
                        mapNode.setValue(MapNodeType.DISABLE.id);
                    }
                }else {
                    if (staProtocol.getHasCar() != null && staProtocol.getHasCar()) {
                        mapNode.setValue(MapNodeType.CAR.id);
                    }
        try {
            //加载货叉提升机放货点位数据
            for (ForkLiftSlave forkLiftSlave : slaveProperties.getForkLift()) {
                ForkLiftThread forkLiftThread = (ForkLiftThread) SlaveConnection.get(SlaveType.ForkLift, forkLiftSlave.getId());
                if (forkLiftThread == null) {
                    continue;
                }
                //更新list
                list.set(bay, mapNode);
                lists.set(row, list);
            }
                for (ForkLiftStaProtocol staProtocol : forkLiftThread.getForkLiftStaProtocols()) {
                    int row = Utils.getRow(staProtocol.getLocNo());
                    int bay = Utils.getBay(staProtocol.getLocNo());
                    List<MapNode> list = lists.get(row);
                    MapNode mapNode = list.get(bay);
                    if (mapType == NavigationMapType.DFX.id) {
                        //车辆有货
                        if (staProtocol.getHasTray() != null && staProtocol.getHasTray()) {
                            mapNode.setValue(MapNodeType.DISABLE.id);
                        }
                    }else {
                        if (staProtocol.getHasCar() != null && staProtocol.getHasCar()) {
                            mapNode.setValue(MapNodeType.CAR.id);
                        }
                    }
                    //更新list
                    list.set(bay, mapNode);
                    lists.set(row, list);
                }
            }
        }catch (Exception e) {
            e.printStackTrace();
        }
        return lists;