#
Junjie
2024-07-25 2cfa8856fb1fd1ad7f642fd998d1644879abcdb5
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/command/LiftCommandService.java
@@ -17,6 +17,8 @@
import com.zy.asrs.wcs.rcs.model.enums.LiftProtocolStatusType;
import com.zy.asrs.wcs.rcs.model.enums.SlaveType;
import com.zy.asrs.wcs.rcs.model.protocol.LiftProtocol;
import com.zy.asrs.wcs.rcs.model.protocol.StaProtocol;
import com.zy.asrs.wcs.rcs.thread.DevpThread;
import com.zy.asrs.wcs.rcs.thread.LiftThread;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -61,7 +63,7 @@
        }
        //检测提升机是否有任务绑定
        boolean liftResult = Utils.checkLiftHasBinding(deviceNo, String.valueOf(motion.getTaskNo()));
        boolean liftResult = Utils.checkLiftHasBinding(liftProtocol.getLiftNo(), String.valueOf(motion.getTaskNo()));
        if (liftResult) {
            //存在任务,禁止执行
            return false;
@@ -204,7 +206,7 @@
                }
                if (motion.getReleaseLift() == 1) {//释放提升机
                    task.setLiftNo(null);
                    task.setLiftNo(0);
                    task.setUpdateTime(new Date());
                    if (!taskService.updateById(task)) {
                        return false;
@@ -222,18 +224,27 @@
                    return false;
                }
                if (task.getTaskSts() < 100) {//入库判断托盘是否进入提升机
                    if (!liftProtocol.getHasTray()) {
                        return false;
                    }
                } else if (task.getTaskSts() >= 100 && task.getTaskSts() < 200) {//出库判断托盘是否离开提升机
                    if (liftProtocol.getHasTray()) {
                        return false;
                    }
                //判断提升机托盘是否存在
                if (liftProtocol.getHasTray()) {
                    return false;
                }
                //判断目标站是否有托盘
                Integer conveyorDeviceId = Integer.parseInt(motion.getDockNo());
                DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Conveyor, conveyorDeviceId);
                if (devpThread == null) {
                    return false;
                }
                StaProtocol staProtocol = devpThread.getStation().get(motion.getTarDrt());
                if(staProtocol == null) {
                    return false;
                }
                if (!staProtocol.isLoading()) {
                    return false;
                }
                if (motion.getReleaseLift() == 1) {//释放提升机
                    task.setLiftNo(null);
                    task.setLiftNo(0);
                    task.setUpdateTime(new Date());
                    if (!taskService.updateById(task)) {
                        return false;
@@ -289,7 +300,7 @@
                }
                if (motion.getReleaseLift() == 1) {//释放提升机
                    task.setLiftNo(null);
                    task.setLiftNo(0);
                    task.setUpdateTime(new Date());
                    if (!taskService.updateById(task)) {
                        return false;