Junjie
2023-06-27 c2b0be1a368a88e4adb6dda12d0aa5d3bb0df838
src/main/java/com/zy/core/thread/LiftThread.java
@@ -375,6 +375,43 @@
        int size = commands.size();
        LiftAssignCommand assignCommand = redisCommand.getAssignCommand();
        if (commandStep != 0) {
            //判断上一条指令是否完成
            LiftCommand command = commands.get(commandStep - 1);
            if (command.getRun().intValue() == 1) {
                //提升机升降命令
                if (command.getDistPosition().intValue() == liftProtocol.getPositionArrivalFeedback().intValue()) {
                    //提升机目标楼层和实际楼层相同,则认定命令完成
                    command.setComplete(true);
                }
            } else if (command.getRun().intValue() == 2 || command.getRun().intValue() == 3) {
                //无货正转,有货正转
                if (!liftProtocol.getForwardRotationFeedback()) {
                    //输送线正转反馈不在运行中,认定命令完成
                    command.setComplete(true);
                }
            } else if (command.getRun().intValue() == 6 || command.getRun().intValue() == 7) {
                //有货反转,无货反转
                if (!liftProtocol.getReverseFeedback()) {
                    //输送线反转反馈不在运行中,认定命令完成
                    command.setComplete(true);
                }
            } else if (command.getRun().intValue() == 4) {
                //输送线停止
                if (!liftProtocol.getForwardRotationFeedback() && !liftProtocol.getReverseFeedback()) {
                    //输送线正转反转都不在运行中,认定命令完成
                    command.setComplete(true);
                }
            }
            //任务数据保存到redis
            redisUtil.set("lift_wrk_no_" + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand));
            if (!command.getComplete()) {
                //上一条任务未完成,禁止下发命令
                return false;
            }
        }
        //取出命令
        LiftCommand command = commands.get(commandStep);
        if (command.getOperaStaNo() != null && command.getDevpId() != null) {