#
Junjie
2024-05-10 14a6067ac871ed3c0d73ee1d1939db7a7aefe13a
#
16个文件已修改
337 ■■■■ 已修改文件
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/ShuttleAction.java 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/BasShuttleController.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/map/service/MapService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/mapper/TaskMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/MotionService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/TaskService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MotionServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/TaskServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/timer/MotionTimer.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateSolution.java 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/ShuttleDispatcher.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/resources/mapper/core/TaskMapper.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/ShuttleAction.java
@@ -250,7 +250,7 @@
        if (shuttleThread == null) {
            return;
        }
        ShuttleProtocol shuttleProtocol = shuttleThread.getStatus();
        ShuttleProtocol shuttleProtocol = shuttleThread.getStatus(false);
        if (shuttleProtocol == null) {
            return;
        }
@@ -280,35 +280,6 @@
        }
        if (shuttleProtocol.getMoveType() == 0) {//跑轨道
            ArrayList<String> locs = new ArrayList<>();
            for (int i = shuttleProtocol.getXCurrent(); i <= shuttleProtocol.getXTarget(); i++) {
                String locNo = Utils.getLocNo(i, shuttleProtocol.getYCurrent(), lev);
                locs.add(locNo);
            }
            List<Loc> locList = locService.list(new LambdaQueryWrapper<Loc>()
                    .in(Loc::getLocNo, locs));
            if (locList.isEmpty()) {
                //空库位
                shuttleProtocol.setYCurrent(shuttleProtocol.getYCurrent() + 1);
                return;
            }
            Loc start = locList.get(0);
            Loc target = locList.get(locList.size() - 1);
            //判断小车是否在起点位置
            if (!shuttleProtocol.getCurrentLocNo().equals(start.getLocNo())) {//不在起点位置,调度去起点位置
                shuttleDispatcher.generateMoveTask(device, start.getLocNo());
            }else {
                //在起点位置,调度去目标位置
                if (shuttleProtocol.getCurrentLocNo().equals(target.getLocNo())) {
                    shuttleProtocol.setYCurrent(shuttleProtocol.getYCurrent() + 1);//小车和目标位置一致,跳过
                }else {
                    shuttleDispatcher.generateMoveTask(device, start.getLocNo());
                    shuttleProtocol.setYCurrent(shuttleProtocol.getYCurrent() + 1);
                }
            }
        } else if (shuttleProtocol.getMoveType() == 1) {//跑库位
            Integer xCurrent = shuttleProtocol.getXCurrent();
            if (xCurrent > shuttleProtocol.getXTarget()) {//当X值大于X目标值,进行归零且Y方向+1
                shuttleProtocol.setXCurrent(shuttleProtocol.getXStart());
@@ -338,6 +309,35 @@
                shuttleDispatcher.generateMoveTask(device, target.getLocNo());
                shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1);
            }
        } else if (shuttleProtocol.getMoveType() == 1) {//跑库位
            ArrayList<String> locs = new ArrayList<>();
            for (int i = shuttleProtocol.getXCurrent(); i <= shuttleProtocol.getXTarget(); i++) {
                String locNo = Utils.getLocNo(i, shuttleProtocol.getYCurrent(), lev);
                locs.add(locNo);
            }
            List<Loc> locList = locService.list(new LambdaQueryWrapper<Loc>()
                    .in(Loc::getLocNo, locs));
            if (locList.isEmpty()) {
                //空库位
                shuttleProtocol.setYCurrent(shuttleProtocol.getYCurrent() + 1);
                return;
            }
            Loc start = locList.get(0);
            Loc target = locList.get(locList.size() - 1);
            //判断小车是否在起点位置
            if (!shuttleProtocol.getCurrentLocNo().equals(start.getLocNo())) {//不在起点位置,调度去起点位置
                shuttleDispatcher.generateMoveTask(device, start.getLocNo());
            }else {
                //在起点位置,调度去目标位置
                if (shuttleProtocol.getCurrentLocNo().equals(target.getLocNo())) {
                    shuttleProtocol.setYCurrent(shuttleProtocol.getYCurrent() + 1);//小车和目标位置一致,跳过
                }else {
                    shuttleDispatcher.generateMoveTask(device, start.getLocNo());
                    shuttleProtocol.setYCurrent(shuttleProtocol.getYCurrent() + 1);
                }
            }
        } else if (shuttleProtocol.getMoveType() == 2) {//母轨道循环跑
            Integer xCurrent = shuttleProtocol.getXCurrent();
            Integer yCurrent = shuttleProtocol.getYCurrent();
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/controller/BasShuttleController.java
@@ -243,14 +243,7 @@
            return R.error("小车忙碌中");
        }
        shuttleProtocol.setMoveLoc(true);//开启跑库
        shuttleProtocol.setMoveType(param.getMoveType());
        shuttleProtocol.setXStart(param.getStartX());
        shuttleProtocol.setXTarget(param.getTargetX());
        shuttleProtocol.setXCurrent(param.getStartX());
        shuttleProtocol.setYStart(param.getStartY());
        shuttleProtocol.setYTarget(param.getTargetY());
        shuttleProtocol.setYCurrent(param.getStartY());
        shuttleThread.enableMoveLoc(param);
        return R.ok();
    }
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/map/service/MapService.java
@@ -190,6 +190,7 @@
        Device device = deviceService.getOne(new LambdaQueryWrapper<Device>()
                .eq(Device::getDeviceType, DeviceCtgType.SHUTTLE.val())
                .eq(Device::getDeviceNo, shuttleNo)
                .eq(Device::getStatus, 1)
        );
        if (null == device) {
            return vo;
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/mapper/TaskMapper.java
@@ -26,6 +26,10 @@
    List<Task> selectManualByExecuteSts();
    List<Task> selectMoveByAnalyzeSts();
    List<Task> selectMoveByExecuteSts();
    List<Task> selectWaitAnalyzeInBoundTask();
    List<Task> selectPakOut();
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/MotionService.java
@@ -23,4 +23,6 @@
    // 持久化 motion 并生产priority
    int batchInsert(List<Motion> motionList, String uuid, Integer taskNo);
    int batchInsert(List<Motion> motionList, String uuid, Integer taskNo, Long hostId);
}
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/TaskService.java
@@ -24,6 +24,10 @@
    List<Task> selectManualByExecuteSts();
    List<Task> selectMoveByAnalyzeSts();
    List<Task> selectMoveByExecuteSts();
    List<Task> selectWaitAnalyzeInBoundTask();
    List<Task> selectPakOut();
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MainServiceImpl.java
@@ -83,7 +83,7 @@
    public synchronized void initRealtimeBasMap() {
        try {
            List<Dict> dicts = dictService.list(new LambdaQueryWrapper<Dict>()
                    .like(Dict::getFlag, "map")
                    .like(Dict::getFlag, "map-")
                    .eq(Dict::getStatus, 1));
            TreeMap<Integer, ArrayList<ArrayList<MapNode>>> levData = new TreeMap<>();
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/MotionServiceImpl.java
@@ -77,12 +77,15 @@
    }
    @Override
    public int batchInsert(List<Motion> motionList, String uuid, Integer taskNo) {
    public int batchInsert(List<Motion> motionList, String uuid, Integer taskNo, Long hostId) {
        int i = motionList.size();
        for (Motion motion : motionList) {
            motion.setPriority(i);
            motion.setTaskNo(taskNo);
            motion.setUuid(uuid);
            if (hostId != null) {
                motion.setHostId(hostId);
            }
            if (!this.save(motion)) {
                throw new CoolException(JSON.toJSONString(motion) + "动作保存失败");
            }
@@ -90,4 +93,9 @@
        }
        return motionList.size();
    }
    @Override
    public int batchInsert(List<Motion> motionList, String uuid, Integer taskNo) {
        return batchInsert(motionList, uuid, taskNo, null);
    }
}
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/service/impl/TaskServiceImpl.java
@@ -87,6 +87,16 @@
    }
    @Override
    public List<Task> selectMoveByAnalyzeSts() {
        return this.baseMapper.selectMoveByAnalyzeSts();
    }
    @Override
    public List<Task> selectMoveByExecuteSts() {
        return this.baseMapper.selectMoveByExecuteSts();
    }
    @Override
    public List<Task> selectWaitAnalyzeInBoundTask() {
        return this.baseMapper.selectWaitAnalyzeInBoundTask();
    }
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/timer/MotionTimer.java
@@ -41,7 +41,7 @@
    @Autowired
    private ShuttleCommandService shuttleCommandService;
//    @Scheduled(cron = "0/1 * * * * ? ")
    @Scheduled(cron = "0/1 * * * * ? ")
    public synchronized void executeTask() {
        Date now = new Date();
        // ANALYZE_INBOUND
@@ -226,6 +226,63 @@
    }
    @Scheduled(cron = "0/1 * * * * ? ")
    public synchronized void executeMoveTask() {
        Date now = new Date();
        // ANALYZE_MOVE
        for (Task task : taskService.selectMoveByAnalyzeSts()) {
            Motion executingMotion = motionService.selectOfTop1(task.getUuid(), MotionStsType.EXECUTING.val(), task.getHostId());
            if (executingMotion != null) {//存在正在执行的motion
                continue;
            }
            Motion motion = motionService.selectOfTop1(task.getUuid(), MotionStsType.INIT.val(), task.getHostId());
            if (null != motion) {
                boolean result = this.executeMotion(motion);
                if (!result) {
                    continue;
                }
                // 更新Task
                switch (TaskStsType.query(task.getTaskSts())) {
                    case ANALYZE_MOVE:
                        task.setTaskSts(TaskStsType.EXECUTE_MOVE.sts);
                        break;
                }
                task.setUpdateTime(now);
                if (!taskService.updateById(task)) {
                    log.error("{}其他工作档更新状态失败!", task.getTaskNo());
                }
            }
        }
        // EXECUTE_MOVE
        for (Task task : taskService.selectMoveByExecuteSts()) {
            if (!motionService.hasRunningMotion(task.getUuid(), task.getHostId())) {
                Motion motion = motionService.selectOfTop1(task.getUuid(), MotionStsType.WAITING.val(), task.getHostId());
                if (null != motion) {
                    boolean result = this.executeMotion(motion);
                    if (!result) {
                        continue;
                    }
                } else {
                    if (motionService.selectOfTop1(task.getUuid(), MotionStsType.EXECUTING.val(), task.getHostId()) != null) {
                        continue;
                    }
                    // 更新Task
                    switch (TaskStsType.query(task.getTaskSts())) {
                        case EXECUTE_MOVE:
                            task.setTaskSts(TaskStsType.COMPLETE_MOVE.sts);
                            break;
                    }
                    task.setUpdateTime(now);
                    if (!taskService.updateById(task)) {
                        log.error("{}他工作档更新状态失败!", task.getTaskNo());
                    }
                }
            }
        }
    }
    @Scheduled(cron = "0/1 * * * * ? ")
    public void scanMotionByExecuting() {
        List<Motion> motionList = motionService.selectBySts(MotionStsType.EXECUTING.val());
        for (Motion motion : motionList) {
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/NavigateSolution.java
@@ -1,7 +1,10 @@
package com.zy.asrs.wcs.core.utils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.wcs.core.model.NavigateNode;
import com.zy.asrs.wcs.system.entity.Dict;
import com.zy.asrs.wcs.system.service.DictService;
import java.util.ArrayList;
import java.util.List;
@@ -13,7 +16,7 @@
 */
public class NavigateSolution {
    // -1 -> 墙壁, 1 -> 起点  2 -> 终点  3-> 母轨  4->站点
    // -1 -> 墙壁, 0 -> 货位, 1 -> 起点  2 -> 终点  3-> 母轨  4->站点
    int[][] map = {{}};
@@ -97,6 +100,18 @@
    public ArrayList<NavigateNode> extend_current_node(NavigateNode current_node) {
        //默认地图母轨方向x
        String mapDirection = "x";
        DictService dictService = SpringUtils.getBean(DictService.class);
        if (dictService != null) {
            Dict dict = dictService.getOne(new LambdaQueryWrapper<Dict>()
                    .eq(Dict::getFlag, "direction_map")
                    .eq(Dict::getStatus, 1));
            if (dict != null) {
                mapDirection = dict.getValue();
            }
        }
        //获取当前结点的x, y
        int x = current_node.getX();
        int y = current_node.getY();
@@ -129,31 +144,62 @@
//                neighbour_node.add(node);
//            }
//        }
        if (map[x][y] == 3) {
            //母轨才能进行左右移动
            if (is_valid(x, y + 1))
            {
                NavigateNode node = new NavigateNode(x, y + 1);
                neighbour_node.add(node);
            }
            if (is_valid(x, y - 1))
            {
                NavigateNode node = new NavigateNode(x, y - 1);
                neighbour_node.add(node);
            }
        }
        if (map[x][y] == 0 || map[x][y] == 3 || map[x][y] == 4 || map[x][y] == 5) {
            //子轨和母轨、输送线、充电桩才能进行上下移动
            if (is_valid(x + 1, y))
            {
                NavigateNode node = new NavigateNode(x + 1, y);
                neighbour_node.add(node);
        if (mapDirection.equals("x")) {//母轨x方向
            if (map[x][y] == 3) {
                //母轨才能进行上下移动
                if (is_valid(x + 1, y))
                {
                    NavigateNode node = new NavigateNode(x + 1, y);
                    neighbour_node.add(node);
                }
                if (is_valid(x - 1, y))
                {
                    NavigateNode node = new NavigateNode(x -1, y);
                    neighbour_node.add(node);
                }
            }
            if (is_valid(x - 1, y))
            {
                NavigateNode node = new NavigateNode(x -1, y);
                neighbour_node.add(node);
            if (map[x][y] == 0 || map[x][y] == 3 || map[x][y] == 4 || map[x][y] == 5) {
                //子轨和母轨、输送线、充电桩才能进行左右移动
                if (is_valid(x, y + 1))
                {
                    NavigateNode node = new NavigateNode(x, y + 1);
                    neighbour_node.add(node);
                }
                if (is_valid(x, y - 1))
                {
                    NavigateNode node = new NavigateNode(x, y - 1);
                    neighbour_node.add(node);
                }
            }
        }else if (mapDirection.equals("y")) {//母轨y方向
            if (map[x][y] == 3) {
                //母轨才能进行左右移动
                if (is_valid(x, y + 1))
                {
                    NavigateNode node = new NavigateNode(x, y + 1);
                    neighbour_node.add(node);
                }
                if (is_valid(x, y - 1))
                {
                    NavigateNode node = new NavigateNode(x, y - 1);
                    neighbour_node.add(node);
                }
            }
            if (map[x][y] == 0 || map[x][y] == 3 || map[x][y] == 4 || map[x][y] == 5) {
                //子轨和母轨、输送线、充电桩才能进行上下移动
                if (is_valid(x + 1, y))
                {
                    NavigateNode node = new NavigateNode(x + 1, y);
                    neighbour_node.add(node);
                }
                if (is_valid(x - 1, y))
                {
                    NavigateNode node = new NavigateNode(x -1, y);
                    neighbour_node.add(node);
                }
            }
        }
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/utils/ShuttleDispatcher.java
@@ -164,9 +164,6 @@
            return null;
        }
        //获取避让位置
        String standByLocNo = this.searchStandByLocNo(Integer.valueOf(device.getDeviceNo()), device.getHostId(), shuttleThread.getStatus().getCurrentLocNo());
        Task task = new Task();
        task.setUuid(String.valueOf(snowflakeIdWorker.nextId()));
        task.setTaskNo(String.valueOf(Utils.getTaskNo("MOVE")));
@@ -176,7 +173,7 @@
        task.setOriginSite(null);
        task.setOriginLoc(null);
        task.setDestSite(null);
        task.setDestLoc(standByLocNo); // 避让位置
        task.setDestLoc(locNo); // 迁移位置
        task.setIoTime(new Date());
        task.setStartTime(new Date());
        task.setHostId(device.getHostId());
@@ -189,7 +186,7 @@
            News.error("保存{}号四向穿梭车迁移任务失败!!!", device.getDeviceNo());
            return null;
        }
        motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()));
        motionService.batchInsert(motionList, task.getUuid(), Integer.valueOf(task.getTaskNo()), device.getHostId());
        task.setTaskSts(TaskStsType.ANALYZE_MOVE.sts);
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java
@@ -1,6 +1,7 @@
package com.zy.asrs.wcs.rcs.thread;
import com.zy.asrs.wcs.common.ExecuteSupport;
import com.zy.asrs.wcs.core.domain.param.ShuttleMoveLocParam;
import com.zy.asrs.wcs.core.model.NavigateNode;
import com.zy.asrs.wcs.core.model.command.ShuttleCommand;
import com.zy.asrs.wcs.core.model.enums.MotionCtgType;
@@ -12,7 +13,9 @@
public interface ShuttleThread extends ThreadHandler{
    ShuttleProtocol getStatus();//获取四向穿梭车状态
    ShuttleProtocol getStatus(boolean clone);//获取四向穿梭车状态
    ShuttleProtocol getStatus();//获取四向穿梭车状态-默认clone
    Device getDevice();//获取设备信息
@@ -50,6 +53,8 @@
    boolean setPakMk(boolean pakMk);//设置标记
    boolean enableMoveLoc(ShuttleMoveLocParam param);
    //***************获取命令*****************
    ShuttleCommand getMoveCommand(Integer taskNo, String startCodeNum, String distCodeNum, Integer allDistance, Integer runDirection, Integer runSpeed, List<NavigateNode> nodes);//获取移动命令
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java
@@ -9,6 +9,7 @@
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wcs.common.ExecuteSupport;
import com.zy.asrs.wcs.core.domain.param.ShuttleMoveLocParam;
import com.zy.asrs.wcs.core.entity.BasShuttle;
import com.zy.asrs.wcs.core.entity.Loc;
import com.zy.asrs.wcs.core.model.MapNode;
@@ -343,10 +344,15 @@
    @Override
    public ShuttleProtocol getStatus() {
        return getStatus(true);
    }
    @Override
    public ShuttleProtocol getStatus(boolean clone) {
        if (this.shuttleProtocol == null) {
            return null;
        }
        return this.shuttleProtocol.clone();
        return clone ? this.shuttleProtocol.clone() : this.shuttleProtocol;
    }
    @Override
@@ -652,6 +658,19 @@
    }
    @Override
    public boolean enableMoveLoc(ShuttleMoveLocParam param) {
        shuttleProtocol.setMoveLoc(true);//开启跑库
        shuttleProtocol.setMoveType(param.getMoveType());
        shuttleProtocol.setXStart(param.getStartX());
        shuttleProtocol.setXTarget(param.getTargetX());
        shuttleProtocol.setXCurrent(param.getStartX());
        shuttleProtocol.setYStart(param.getStartY());
        shuttleProtocol.setYTarget(param.getTargetY());
        shuttleProtocol.setYCurrent(param.getStartY());
        return true;
    }
    @Override
    public ShuttleCommand getMoveCommand(Integer taskNo, String startCodeNum, String distCodeNum, Integer allDistance, Integer runDirection, Integer runSpeed, List<NavigateNode> nodes) {
        NavigateMapData navigateMapData = SpringUtils.getBean(NavigateMapData.class);
        NyShuttleHttpCommand httpStandard = getHttpStandard(Integer.parseInt(device.getDeviceNo()), taskNo);
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
@@ -10,6 +10,7 @@
import com.zy.asrs.framework.common.SpringUtils;
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wcs.common.ExecuteSupport;
import com.zy.asrs.wcs.core.domain.param.ShuttleMoveLocParam;
import com.zy.asrs.wcs.core.entity.BasShuttle;
import com.zy.asrs.wcs.core.entity.Loc;
import com.zy.asrs.wcs.core.model.NavigateNode;
@@ -184,6 +185,7 @@
                    basShuttle.setStatus(1);
                    basShuttle.setDeleted(0);
                    basShuttle.setHostId(device.getHostId());
                    basShuttle.setDeviceId(device.getId().intValue());
                    shuttleService.save(basShuttle);
                }
                //任务号
@@ -217,10 +219,15 @@
    @Override
    public ShuttleProtocol getStatus() {
        return getStatus(true);
    }
    @Override
    public ShuttleProtocol getStatus(boolean clone) {
        if (this.shuttleProtocol == null) {
            return null;
        }
        return this.shuttleProtocol.clone();
        return clone ? this.shuttleProtocol.clone() : this.shuttleProtocol;
    }
    @Override
@@ -257,11 +264,11 @@
                NavigateNode targetPath = sectionNodes.get(sectionNodes.size() - 1);
                if (ShuttleRunDirection.get(startPath.getDirection()) == ShuttleRunDirection.LEFT
                        || ShuttleRunDirection.get(startPath.getDirection()) == ShuttleRunDirection.RIGHT) {
                    //母轨方向
                    oper = 5;
                } else {
                    //子轨方向
                    oper = 6;
                } else {
                    //母轨方向
                    oper = 5;
                }
                for (int i = 0; i < sectionNodes.size(); i++) {
@@ -299,7 +306,11 @@
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            Integer code = jsonObject.getInteger("code");
            System.out.println("路径下发" + taskNo);
            System.out.println(JSON.toJSONString(jsonObject));
            System.out.println(JSON.toJSONString(param));
            if (code.equals(200)) {
                System.out.println("路径下发" + taskNo);
                return true;
            }
        } catch (Exception e) {
@@ -329,6 +340,7 @@
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            Integer code = jsonObject.getInteger("code");
            System.out.println(JSON.toJSONString(command.getBody()));
            if (code.equals(200)) {
                this.shuttleProtocol.setSendTime(System.currentTimeMillis());//指令下发时间
                return true;
@@ -608,6 +620,19 @@
    }
    @Override
    public boolean enableMoveLoc(ShuttleMoveLocParam param) {
        shuttleProtocol.setMoveLoc(true);//开启跑库
        shuttleProtocol.setMoveType(param.getMoveType());
        shuttleProtocol.setXStart(param.getStartX());
        shuttleProtocol.setXTarget(param.getTargetX());
        shuttleProtocol.setXCurrent(param.getStartX());
        shuttleProtocol.setYStart(param.getStartY());
        shuttleProtocol.setYTarget(param.getTargetY());
        shuttleProtocol.setYCurrent(param.getStartY());
        return true;
    }
    @Override
    public ShuttleCommand getMoveCommand(Integer taskNo, String startCodeNum, String distCodeNum, Integer allDistance, Integer runDirection, Integer runSpeed, List<NavigateNode> nodes) {
        HashMap<String, Object> body = new HashMap<>();
        body.put("messageName", "runOrder");
zy-asrs-wcs/src/main/resources/mapper/core/TaskMapper.xml
@@ -52,6 +52,20 @@
        order by priority desc,start_time,task_no asc
    </select>
    <select id="selectMoveByAnalyzeSts" resultType="com.zy.asrs.wcs.core.entity.Task">
        select * from wcs_task
        where 1=1
          and task_sts in (302)
        order by priority desc,start_time,task_no asc
    </select>
    <select id="selectMoveByExecuteSts" resultType="com.zy.asrs.wcs.core.entity.Task">
        select * from wcs_task
        where 1=1
          and task_sts in (303)
        order by priority desc,start_time,task_no asc
    </select>
    <select id="selectWaitAnalyzeInBoundTask" resultType="com.zy.asrs.wcs.core.entity.Task">
        select * from wcs_task where task_ctg = 1 and task_sts = 1
    </select>