Junjie
2024-12-11 8ef2bb5e46d84594e6ed632c07ea0b47a1bf6c4d
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/AnalyzeService.java
@@ -1,19 +1,14 @@
package com.zy.asrs.wcs.core.kernel;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.framework.common.Cools;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.wcs.core.domain.dto.MotionDto;
import com.zy.asrs.wcs.core.entity.*;
import com.zy.asrs.wcs.core.model.enums.DeviceCtgType;
import com.zy.asrs.wcs.core.model.enums.MotionCtgType;
import com.zy.asrs.wcs.core.model.enums.TaskCtgType;
import com.zy.asrs.wcs.core.model.enums.TaskStsType;
import com.zy.asrs.wcs.core.model.NavigateNode;
import com.zy.asrs.wcs.core.model.enums.*;
import com.zy.asrs.wcs.core.service.*;
import com.zy.asrs.wcs.core.utils.ConveyorDispatcher;
import com.zy.asrs.wcs.core.utils.LiftDispatcher;
import com.zy.asrs.wcs.core.utils.ShuttleDispatcher;
import com.zy.asrs.wcs.core.utils.Utils;
import com.zy.asrs.wcs.core.utils.*;
import com.zy.asrs.wcs.rcs.News;
import com.zy.asrs.wcs.rcs.cache.SlaveConnection;
import com.zy.asrs.wcs.rcs.entity.Device;
import com.zy.asrs.wcs.rcs.model.enums.SlaveType;
@@ -26,6 +21,7 @@
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
@@ -54,7 +50,20 @@
    @Autowired
    private BasConveyorPathService basConveyorPathService;
    @Autowired
    private BasConveyorStaService basConveyorStaService;
    @Autowired
    private BasConveyorService basConveyorService;
    @Autowired
    private TaskCtgService taskCtgService;
    public Integer getStaByLev(Integer lev) {
        HashMap<Integer, Integer> map = new HashMap<>();
        map.put(1, 31006);
        map.put(2, 31007);
        map.put(3, 31008);
        return map.get(lev);
    }
    public List<Motion> generateMotion(Task task) {
        List<Motion> motionList = new ArrayList<>();
@@ -104,6 +113,11 @@
                return motionList;
            }
            BasConveyorSta basConveyorStaDest = basConveyorStaService.selectBySiteNo(task.getDestSite());
            if (basConveyorStaDest == null) {
                return motionList;
            }
            //检测穿梭车是否有任务绑定
            boolean shuttleResult = Utils.checkShuttleHasBinding(shuttleDevice, task.getTaskNo());
            if (shuttleResult) {
@@ -138,6 +152,9 @@
            //穿梭车出提升机待机位库位号
            String standbyLocNoFrom = shuttleStandbyFrom.getDeviceStandbyLoc();
            //换层需要锁定的路径
            List<String> lockPath = shuttleStandbyFrom.getLockPath$();
            // 入库目标层有穿梭车
            if (Utils.getLev(shuttleLocNo) == Utils.getLev(task.getDestLoc())) {
@@ -151,8 +168,9 @@
                        , MotionDto.build((dto -> {
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLev(Utils.getLev(task.getDestLoc()));
                            dto.setStaNo(Integer.parseInt(task.getDestSite()));
                            dto.setSync(0);//异步执行
                            dto.setStaNo(getStaByLev(Utils.getLev(task.getDestLoc())));
                            dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue());
                            dto.setReleaseLift(1);//执行完成后释放提升机
                        }))
                ));
@@ -164,6 +182,7 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLocNo(standbyLocNoTo);
                        })),
                        MotionCtgType.SHUTTLE_MOVE
@@ -178,7 +197,7 @@
                        MotionCtgType.SHUTTLE_PALLET_LIFT
                ));
                // 穿梭车走行至目标库位
                // 穿梭车载货走行至目标库位
                motionList.addAll(kernelService.shuttleMove(
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -186,10 +205,12 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLocNo(destLoc);
//                            dto.setReleaseLift(2);//执行中释放提升机
                        })),
                        MotionCtgType.SHUTTLE_MOVE
                        MotionCtgType.SHUTTLE_TRANSPORT
                ));
                // 穿梭车入库托盘下降
@@ -216,7 +237,9 @@
                        , MotionDto.build((dto -> {
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLev(Utils.getLev(task.getDestLoc()));
                            dto.setStaNo(Integer.parseInt(task.getDestSite()));
                            dto.setStaNo(getStaByLev(Utils.getLev(task.getDestLoc())));
                            dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue());
                            dto.setReleaseLift(1);//执行完成后释放提升机
                        }))
                ));
@@ -228,10 +251,20 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLocNo(standbyLocNoTo);
                        })),
                        MotionCtgType.SHUTTLE_MOVE
                ));
                // 锁定换层路径
                motionList.addAll(kernelService.mapLockPath(
                        null,
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setLocNo(JSON.toJSONString(lockPath));
                        }))
                ));
                // 提升机空载移动到穿梭车层
@@ -259,6 +292,7 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLocNo(liftLocNoTo);
                        })),
@@ -311,6 +345,7 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLocNo(standbyLocNoFrom);
                        })),
                        MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -325,6 +360,15 @@
                        }))
                ));
                // 解锁换层路径
                motionList.addAll(kernelService.mapUnlockPath(
                        null,
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setLocNo(JSON.toJSONString(lockPath));
                        }))
                ));
                // 穿梭车入库顶升
                motionList.addAll(kernelService.shuttleAction(
                        null,
@@ -334,7 +378,7 @@
                        MotionCtgType.SHUTTLE_PALLET_LIFT
                ));
                // 穿梭车走行至目标库位
                // 穿梭车载货走行至目标库位
                motionList.addAll(kernelService.shuttleMove(
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -342,10 +386,11 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLocNo(destLoc);
                        })),
                        MotionCtgType.SHUTTLE_MOVE
                        MotionCtgType.SHUTTLE_TRANSPORT
                ));
                // 穿梭车入库托盘下降
@@ -400,6 +445,11 @@
                return motionList;
            }
            BasConveyorSta basConveyorStaOrigin = basConveyorStaService.selectBySiteNo(task.getOriginSite());
            if (basConveyorStaOrigin == null) {
                return motionList;
            }
            //检测穿梭车是否有任务绑定
            boolean shuttleResult = Utils.checkShuttleHasBinding(shuttleDevice, task.getTaskNo());
            if (shuttleResult) {
@@ -434,8 +484,11 @@
            //穿梭车出提升机待机位库位号
            String standbyLocNoFrom = shuttleStandbyFrom.getDeviceStandbyLoc();
            //穿梭车出提升机后小车待机位
            String shuttleFromLiftStandbyLoc = shuttleStandbyFrom.getStandbyLoc();
            //穿梭车出提升机后全部待机位
            String standbyLocs = shuttleStandbyFrom.getStandbyLoc();//获取全部待机位
            //换层需要锁定的路径
            List<String> lockPath = shuttleStandbyFrom.getLockPath$();
            //获取出库任务类型
            TaskCtg taskCtg = taskCtgService.getOne(new LambdaQueryWrapper<TaskCtg>()
@@ -453,6 +506,12 @@
                return motionList;
            }
            //分析出库路径待机库位
            String lastPathStartLoc = shuttleDispatcher.analyzeOutPathWaitLoc(originLoc, standbyLocNoTo, shuttleDevice);
            if (lastPathStartLoc == null) {
                return motionList;//未分析成功
            }
            /**
             * 出库
             */
@@ -468,6 +527,7 @@
                            })),
                            MotionDto.build((dto -> {
                                dto.setShuttleNo(shuttleDevice.getId().intValue());
                                dto.setShuttleDevice(shuttleDevice);
                                dto.setLocNo(originLoc);
                            })),
                            MotionCtgType.SHUTTLE_MOVE
@@ -483,18 +543,36 @@
                        MotionCtgType.SHUTTLE_PALLET_LIFT
                ));
                // 穿梭车出库至提升机待机位
                if (!originLoc.equals(lastPathStartLoc)) {
                    // 穿梭车载货出库至最后一段路径等待
                    motionList.addAll(kernelService.shuttleMove(
                            MotionDto.build((dto -> {
                                dto.setShuttleNo(shuttleDevice.getId().intValue());
                                dto.setLocNo(originLoc);
                            })),
                            MotionDto.build((dto -> {
                                dto.setShuttleNo(shuttleDevice.getId().intValue());
                                dto.setShuttleDevice(shuttleDevice);
                                dto.setLocNo(lastPathStartLoc);
                            })),
                            MotionCtgType.SHUTTLE_TRANSPORT
                    ));
                }
                // 穿梭车载货至提升机待机位
                motionList.addAll(kernelService.shuttleMove(
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setLocNo(originLoc);
                            dto.setLocNo(lastPathStartLoc);
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLocNo(standbyLocNoTo);
                            dto.setStaNo(getStaByLev(Utils.getLev(task.getOriginLoc())));//输送站
                        })),
                        MotionCtgType.SHUTTLE_MOVE
                        MotionCtgType.SHUTTLE_TRANSPORT_TO_CONVEYOR
                ));
                // 穿梭车出库托盘下降
@@ -506,23 +584,7 @@
                        MotionCtgType.SHUTTLE_PALLET_DOWN
                ));
                // 提升机载货移动
                motionList.addAll(kernelService.liftMoveGoods(
                        MotionDto.build((dto -> {
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLev(Utils.getLev(task.getOriginLoc()));
                            dto.setStaNo(Integer.parseInt(task.getOriginSite()));//起始站点
                        }))
                        , MotionDto.build((dto -> {
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLev(1);//光泰1层是输送线层
                            dto.setStaNo(31004);//出库站点
                            dto.setSync(0);//异步执行
                            dto.setReleaseLift(1);//执行完成后释放提升机
                        }))
                ));
                // 穿梭车提升机待机位 - 到待机位
                // 穿梭车提升机待机位 - 到待机位(自动选择合适待机位)
                motionList.addAll(kernelService.shuttleMove(
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -530,23 +592,42 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setLocNo(shuttleFromLiftStandbyLoc);
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLocNo(standbyLocs);
                            dto.setSync(0);//异步执行
                            dto.setReleaseShuttle(1);//执行完成后释放小车
                        })),
                        MotionCtgType.SHUTTLE_MOVE
                        MotionCtgType.SHUTTLE_MOVE_STANDBY
                ));
                // 提升机载货移动
                motionList.addAll(kernelService.liftMoveGoods(
                        MotionDto.build((dto -> {
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLev(Utils.getLev(task.getOriginLoc()));
                            dto.setStaNo(getStaByLev(Utils.getLev(task.getOriginLoc())));//起始站点
                        }))
                        , MotionDto.build((dto -> {
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLev(1);//光泰1层是输送线层
                            dto.setStaNo(31001);//出库站点
                            dto.setDevpNo(basConveyorStaOrigin.getConveyorDeviceId().intValue());
                            dto.setReleaseLift(1);//执行完成后释放提升机
                        }))
                ));
                // 输送线运输至出库口
                motionList.addAll(kernelService.conveyorOutbound(
                        MotionDto.build((dto -> {
                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
                            dto.setStaNo(basConveyorPath.getDeviceStn());
                        })),
                        MotionDto.build((dto -> {
                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
                            dto.setStaNo(basConveyorPath.getStnNo());
                        })),
                        MotionCtgType.CONVEYOR_OUTBOUND
                ));
//                motionList.addAll(kernelService.conveyorOutbound(
//                        MotionDto.build((dto -> {
//                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
//                            dto.setStaNo(basConveyorPath.getDeviceStn());
//                        })),
//                        MotionDto.build((dto -> {
//                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
//                            dto.setStaNo(basConveyorPath.getStnNo());
//                        })),
//                        MotionCtgType.CONVEYOR_OUTBOUND
//                ));
            /**
             * 二、出库起始层没有穿梭车
@@ -561,10 +642,20 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLocNo(standbyLocNoTo);
                        })),
                        MotionCtgType.SHUTTLE_MOVE
                ));
                // 锁定换层路径
                motionList.addAll(kernelService.mapLockPath(
                        null,
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setLocNo(JSON.toJSONString(lockPath));
                        }))
                ));
                // 提升机空载移动到穿梭车层
@@ -592,6 +683,7 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLocNo(liftLocNoTo);
                        })),
@@ -644,6 +736,7 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLocNo(standbyLocNoFrom);
                        })),
                        MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -658,6 +751,15 @@
                        }))
                ));
                // 解锁换层路径
                motionList.addAll(kernelService.mapUnlockPath(
                        null,
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setLocNo(JSON.toJSONString(lockPath));
                        }))
                ));
                // 穿梭车提升机待机位至出库库位
                motionList.addAll(kernelService.shuttleMove(
                        MotionDto.build((dto -> {
@@ -667,6 +769,7 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLocNo(originLoc);
                        })),
                        MotionCtgType.SHUTTLE_MOVE
@@ -681,18 +784,36 @@
                        MotionCtgType.SHUTTLE_PALLET_LIFT
                ));
                // 穿梭车出库至提升机待机位
                if (!originLoc.equals(lastPathStartLoc)) {
                    // 穿梭车载货出库至最后一段路径等待
                    motionList.addAll(kernelService.shuttleMove(
                            MotionDto.build((dto -> {
                                dto.setShuttleNo(shuttleDevice.getId().intValue());
                                dto.setLocNo(originLoc);
                            })),
                            MotionDto.build((dto -> {
                                dto.setShuttleNo(shuttleDevice.getId().intValue());
                                dto.setShuttleDevice(shuttleDevice);
                                dto.setLocNo(lastPathStartLoc);
                            })),
                            MotionCtgType.SHUTTLE_TRANSPORT
                    ));
                }
                // 穿梭车载货至提升机待机位
                motionList.addAll(kernelService.shuttleMove(
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setLocNo(originLoc);
                            dto.setLocNo(lastPathStartLoc);
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLocNo(standbyLocNoFrom);
                            dto.setStaNo(getStaByLev(Utils.getLev(task.getOriginLoc())));//输送站
                        })),
                        MotionCtgType.SHUTTLE_MOVE
                        MotionCtgType.SHUTTLE_TRANSPORT_TO_CONVEYOR
                ));
                // 穿梭车出库托盘下降
@@ -704,23 +825,7 @@
                        MotionCtgType.SHUTTLE_PALLET_DOWN
                ));
                // 提升机载货移动
                motionList.addAll(kernelService.liftMoveGoods(
                        MotionDto.build((dto -> {
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLev(Utils.getLev(task.getOriginLoc()));
                            dto.setStaNo(Integer.parseInt(task.getOriginSite()));//起始站点
                        }))
                        , MotionDto.build((dto -> {
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLev(1);//光泰1层是输送线层
                            dto.setStaNo(31004);//出库站点
                            dto.setSync(0);//异步执行
                            dto.setReleaseLift(1);//执行完成后释放提升机
                        }))
                ));
                // 穿梭车提升机待机位 - 到待机位
                // 穿梭车提升机待机位 - 到待机位(自动选择合适待机位)
                motionList.addAll(kernelService.shuttleMove(
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
@@ -728,23 +833,42 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setLocNo(shuttleFromLiftStandbyLoc);
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLocNo(standbyLocs);
                            dto.setSync(0);//异步执行
                            dto.setReleaseShuttle(1);//执行完成后释放小车
                        })),
                        MotionCtgType.SHUTTLE_MOVE
                        MotionCtgType.SHUTTLE_MOVE_STANDBY
                ));
                // 提升机载货移动
                motionList.addAll(kernelService.liftMoveGoods(
                        MotionDto.build((dto -> {
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLev(Utils.getLev(task.getOriginLoc()));
                            dto.setStaNo(getStaByLev(Utils.getLev(task.getOriginLoc())));//起始站点
                        }))
                        , MotionDto.build((dto -> {
                            dto.setLiftNo(transferLiftDevice.getId().intValue());
                            dto.setLev(1);//光泰1层是输送线层
                            dto.setStaNo(31001);//出库站点
                            dto.setDevpNo(basConveyorStaOrigin.getConveyorDeviceId().intValue());
                            dto.setReleaseLift(1);//执行完成后释放提升机
                        }))
                ));
                // 输送线运输至出库口
                motionList.addAll(kernelService.conveyorOutbound(
                        MotionDto.build((dto -> {
                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
                            dto.setStaNo(basConveyorPath.getDeviceStn());
                        })),
                        MotionDto.build((dto -> {
                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
                            dto.setStaNo(basConveyorPath.getStnNo());
                        })),
                        MotionCtgType.CONVEYOR_OUTBOUND
                ));
//                motionList.addAll(kernelService.conveyorOutbound(
//                        MotionDto.build((dto -> {
//                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
//                            dto.setStaNo(basConveyorPath.getDeviceStn());
//                        })),
//                        MotionDto.build((dto -> {
//                            dto.setDevpNo(basConveyorPath.getDeviceId().intValue());
//                            dto.setStaNo(basConveyorPath.getStnNo());
//                        })),
//                        MotionCtgType.CONVEYOR_OUTBOUND
//                ));
            }
@@ -843,6 +967,7 @@
                    })),
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setShuttleDevice(shuttleDevice);
                        dto.setLocNo(chargeLocNo);
                    })),
                    MotionCtgType.SHUTTLE_MOVE
@@ -858,6 +983,7 @@
                    })),
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setShuttleDevice(shuttleDevice);
                        dto.setLocNo(standbyLocNoTo);
                    })),
                    MotionCtgType.SHUTTLE_MOVE
@@ -888,6 +1014,7 @@
                    })),
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setShuttleDevice(shuttleDevice);
                        dto.setLiftNo(transferLiftDevice.getId().intValue());
                        dto.setLocNo(liftLocNoTo);
                    })),
@@ -940,6 +1067,7 @@
                    })),
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setShuttleDevice(shuttleDevice);
                        dto.setLocNo(standbyLocNoFrom);
                    })),
                    MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -961,6 +1089,7 @@
                    })),
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setShuttleDevice(shuttleDevice);
                        dto.setLocNo(chargeLocNo);
                    })),
                    MotionCtgType.SHUTTLE_MOVE
@@ -1029,6 +1158,7 @@
                    })),
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setShuttleDevice(shuttleDevice);
                        dto.setLocNo(locNo);
                    })),
                    MotionCtgType.SHUTTLE_MOVE
@@ -1083,6 +1213,7 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(shuttleDevice.getId().intValue());
                            dto.setShuttleDevice(shuttleDevice);
                            dto.setLocNo(locNo);
                        })),
                        MotionCtgType.SHUTTLE_MOVE
@@ -1111,6 +1242,9 @@
            //穿梭车出提升机待机位库位号
            String standbyLocNoFrom = liftDispatcher.getLiftStandByLocNo(liftThread, Utils.getLev(task.getDestLoc()));
            //换层需要锁定的路径
            List<String> lockPath = liftDispatcher.getLockPathByLocNo(liftThread, Utils.getLev(task.getDestLoc()));
            // 穿梭车走行至提升机库位待机位
            motionList.addAll(kernelService.shuttleMove(
@@ -1120,10 +1254,20 @@
                    })),
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setShuttleDevice(shuttleDevice);
                        dto.setLiftNo(liftDevice.getId().intValue());
                        dto.setLocNo(standbyLocNoTo);
                    })),
                    MotionCtgType.SHUTTLE_MOVE
            ));
            // 锁定换层路径
            motionList.addAll(kernelService.mapLockPath(
                    null,
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setLocNo(JSON.toJSONString(lockPath));
                    }))
            ));
            // 提升机空载移动到穿梭车层
@@ -1151,6 +1295,7 @@
                    })),
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setShuttleDevice(shuttleDevice);
                        dto.setLiftNo(liftDevice.getId().intValue());
                        dto.setLocNo(liftLocNoTo);
                    })),
@@ -1203,6 +1348,7 @@
                    })),
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setShuttleDevice(shuttleDevice);
                        dto.setLocNo(standbyLocNoFrom);
                    })),
                    MotionCtgType.SHUTTLE_MOVE_FROM_LIFT
@@ -1216,6 +1362,15 @@
                    }))
            ));
            // 解锁换层路径
            motionList.addAll(kernelService.mapUnlockPath(
                    null,
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setLocNo(JSON.toJSONString(lockPath));
                    }))
            ));
            // 穿梭车提升机待机位至目标位置
            motionList.addAll(kernelService.shuttleMove(
                    MotionDto.build((dto -> {
@@ -1225,6 +1380,7 @@
                    })),
                    MotionDto.build((dto -> {
                        dto.setShuttleNo(shuttleDevice.getId().intValue());
                        dto.setShuttleDevice(shuttleDevice);
                        dto.setLocNo(locNo);
                    })),
                    MotionCtgType.SHUTTLE_MOVE
@@ -1280,6 +1436,7 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(device.getId().intValue());
                            dto.setShuttleDevice(device);
                            dto.setLocNo(targetLoc);
                        })),
                        MotionCtgType.SHUTTLE_MOVE
@@ -1332,6 +1489,7 @@
                            })),
                            MotionDto.build((dto -> {
                                dto.setShuttleNo(device.getId().intValue());
                                dto.setShuttleDevice(device);
                                dto.setLocNo(sourceLoc);
                            })),
                            MotionCtgType.SHUTTLE_MOVE
@@ -1345,7 +1503,7 @@
                    motion.setMotionCtg(MotionCtgType.SHUTTLE_PALLET_LIFT.val());
                }));
                // 穿梭车走行至目标库位
                // 穿梭车载货走行至目标库位
                motionList.addAll(kernelService.shuttleMove(
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(device.getId().intValue());
@@ -1353,9 +1511,10 @@
                        })),
                        MotionDto.build((dto -> {
                            dto.setShuttleNo(device.getId().intValue());
                            dto.setShuttleDevice(device);
                            dto.setLocNo(targetLoc);
                        })),
                        MotionCtgType.SHUTTLE_MOVE
                        MotionCtgType.SHUTTLE_TRANSPORT
                ));
                //托盘下降
@@ -1404,17 +1563,23 @@
        } else if (destSite.equals("movePallet")) {
            //移动托盘
            BasConveyorSta basConveyorStaOrigin = basConveyorStaService.selectBySiteNo(task.getOriginSite());
            BasConveyorSta basConveyorStaDest = basConveyorStaService.selectBySiteNo(task.getDestSite());
            if(basConveyorStaOrigin == null || basConveyorStaDest == null) {
                return motionList;
            }
            // 提升机移动托盘
            motionList.addAll(kernelService.liftMoveGoods(
                    MotionDto.build((dto -> {
                        dto.setLiftNo(device.getId().intValue());
                        dto.setLev(0);
                        dto.setLev(Utils.getLev(basConveyorStaOrigin.getLocNo()));
                        dto.setStaNo(Integer.parseInt(task.getOriginSite()));
                    }))
                    , MotionDto.build((dto -> {
                        dto.setLiftNo(device.getId().intValue());
                        dto.setLev(0);
                        dto.setLev(Utils.getLev(basConveyorStaDest.getLocNo()));
                        dto.setDevpNo(basConveyorStaDest.getConveyorDeviceId().intValue());
                        dto.setStaNo(Integer.parseInt(task.getDestSite()));
                    }))
            ));