自动化立体仓库 - WCS系统
#
Junjie
2023-11-20 83449fef571c247a2d73194b8063638349d0076a
src/main/java/com/zy/core/thread/LiftThread.java
@@ -329,7 +329,7 @@
        redisCommand.setCommandStep(0);//命令执行步序
        redisCommand.setAssignCommand(assignCommand);//命令
        //任务数据保存到redis
        redisUtil.set("lift_wrk_no_" + assignCommand.getTaskNo(), JSON.toJSONString(redisCommand));
        redisUtil.set(RedisKeyType.LIFT.key + assignCommand.getTaskNo(), JSON.toJSONString(redisCommand));
        liftProtocol.setAssignCommand(assignCommand);
        liftProtocol.setProtocolStatus(LiftProtocolStatusType.WORKING);
        //执行下发任务
@@ -344,7 +344,7 @@
        }
        WrkMastMapper wrkMastMapper = SpringUtils.getBean(WrkMastMapper.class);
        Object o = redisUtil.get("lift_wrk_no_" + wrkNo);
        Object o = redisUtil.get(RedisKeyType.LIFT.key + wrkNo);
        if (o == null) {
            return false;
        }
@@ -357,6 +357,10 @@
        //取出命令
        NyLiftCommand command = commands.get(commandStep);
        if (!redisCommand.getLiftNo().equals(liftProtocol.getLiftNo())) {
            return false;
        }
        //下发命令
        if (!write(command)) {
@@ -376,7 +380,7 @@
            short[] commandArr = getCommandArr(command);//获取命令报文
            BasLiftOpt opt = new BasLiftOpt(
                    redisCommand.getWrkNo().intValue(),
                    redisCommand.getLiftNo().intValue(),
                    liftProtocol.getLiftNo().intValue(),
                    new Date(),
                    null,
                    null,
@@ -395,11 +399,11 @@
            commandStep++;
            redisCommand.setCommandStep(commandStep);
            //任务数据保存到redis
            redisUtil.set("lift_wrk_no_" + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand));
            redisUtil.set(RedisKeyType.LIFT.key + redisCommand.getWrkNo(), JSON.toJSONString(redisCommand));
        }else {
            //已执行完成
            //删除redis
            redisUtil.del("lift_wrk_no_" + redisCommand.getWrkNo());
            redisUtil.del(RedisKeyType.LIFT.key + redisCommand.getWrkNo());
            //对主线程抛出等待确认状态waiting
            liftProtocol.setProtocolStatus(LiftProtocolStatusType.WAITING);