#
Junjie
2025-06-05 fbd5f0994201614d801a099198ab7766b54cedff
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateSolution.java
@@ -2,9 +2,12 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wcs.core.model.NavigateNode;
import com.zy.asrs.wcs.core.model.enums.MapNodeType;
import com.zy.asrs.wcs.system.entity.Dict;
import com.zy.asrs.wcs.system.service.DictService;
import java.util.ArrayList;
import java.util.List;
@@ -16,7 +19,7 @@
 */
public class NavigateSolution {
    // -1 -> 墙壁, 0 -> 货位, 1 -> 起点  2 -> 终点  3-> 母轨  4->站点
    // -1 -> 墙壁, 0 -> 货位, 1 -> 起点  2 -> 终点  3-> 母轨  4->输送站点  5->充电桩  66->小车  67->提升机
    int[][] map = {{}};
@@ -34,7 +37,7 @@
        mapData.setLev(lev);
        int[][] data = mapData.getDataFromRedis(mapType, whitePoints, shuttlePoints);
        if (data == null) {
            data = mapData.getData(mapType, whitePoints, shuttlePoints);
            throw new CoolException("地图未载入!");
        }
        this.map = data;
    }
@@ -151,8 +154,8 @@
                }
            }
            if (map[x][y] == 0 || map[x][y] == 3 || map[x][y] == 4 || map[x][y] == 5) {
                //子轨和母轨、输送线、充电桩才能进行左右移动
            if (map[x][y] == 0 || map[x][y] == 3 || map[x][y] == 4 || map[x][y] == 5 || map[x][y] == 67) {
                //子轨和母轨、输送线、充电桩、提升机才能进行左右移动
                if (is_valid(x, y + 1))
                {
                    NavigateNode node = new NavigateNode(x, y + 1);
@@ -179,8 +182,8 @@
                }
            }
            if (map[x][y] == 0 || map[x][y] == 3 || map[x][y] == 4 || map[x][y] == 5) {
                //子轨和母轨、输送线、充电桩才能进行上下移动
            if (map[x][y] == 0 || map[x][y] == 3 || map[x][y] == 4 || map[x][y] == 5 || map[x][y] == 67) {
                //子轨和母轨、输送线、充电桩、提升机才能进行上下移动
                if (is_valid(x + 1, y))
                {
                    NavigateNode node = new NavigateNode(x + 1, y);
@@ -203,7 +206,13 @@
            return false;
        }
        // 如果结点的位置小于0,则不合法
        if (map[x][y] < 0) return false;
        if (map[x][y] < 0) {
            return false;
        }
        if (map[x][y] == MapNodeType.CAR.id) {//节点是小车
            return false;
        }
        NavigateNode navigateNode = new NavigateNode(x, y);
        if (is_exist(navigateNode)) {
            return false;