zjj
7 天以前 314729da5f6f84a6112344a2210aadfeeb2bac0c
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/ShuttleCommandService.java
@@ -1,5 +1,6 @@
package com.zy.asrs.wcs.core.kernel.command;
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.exception.CoolException;
@@ -18,6 +19,7 @@
import com.zy.asrs.wcs.rcs.News;
import com.zy.asrs.wcs.rcs.cache.SlaveConnection;
import com.zy.asrs.wcs.core.entity.Motion;
import com.zy.asrs.wcs.rcs.entity.Device;
import com.zy.asrs.wcs.rcs.model.enums.ShuttleProtocolStatusType;
import com.zy.asrs.wcs.rcs.model.enums.SlaveType;
import com.zy.asrs.wcs.rcs.model.protocol.LiftProtocol;
@@ -58,6 +60,8 @@
    private LiftAction liftAction;
    @Autowired
    private LiftDispatcher liftDispatcher;
    @Autowired
    private ShuttleDispatcher shuttleDispatcher;
    // 计算
    public Boolean accept(Motion motion) {
@@ -70,7 +74,7 @@
        if (null == shuttleProtocol) {
            return false;
        }
        Device shuttleDevice = shuttleThread.getDevice();
        if (!shuttleThread.isIdle(new ExecuteSupport() {
            @Override
            public Boolean judgement() {
@@ -223,6 +227,21 @@
                shuttleTaskModeType = ShuttleTaskModeType.SHUTTLE_UPDATE_LOCATION;
                shuttleCommands.add(shuttleThread.getUpdateLocationCommand(motion.getTaskNo(), motion.getTarget()));
                break;
            case SHUTTLE_MOVE_STANDBY://穿梭车移动到待机位
                shuttleTaskModeType = ShuttleTaskModeType.SHUTTLE_MOVE_LOC_NO;
                //获取全部待机位
                List<String> standbyLocs = JSON.parseArray(motion.getTemp(), String.class);
                //获取可用待机位
                String shuttleFromLiftStandbyLoc = shuttleDispatcher.searchAvailableLocNo(Integer.valueOf(shuttleDevice.getDeviceNo()), shuttleDevice.getHostId(), shuttleThread.getStatus().getCurrentLocNo(), standbyLocs);
                shuttleCommands = this.shuttleAssignCommand(motion.getOrigin(), shuttleFromLiftStandbyLoc, NavigationMapType.NORMAL.id, assignCommand, shuttleThread);
                //更新动作可用待机位
                motion.setTarget(shuttleFromLiftStandbyLoc);
                motion.setUpdateTime(new Date());
                motionService.updateById(motion);
                break;
            default:
                throw new CoolException(motion.getMotionCtgEl() + "没有指定任务作业流程!!!");
        }