Junjie
2023-05-09 056c514524eff0ca466e920191ddd551e6821062
ShuttleThread fixed
1个文件已修改
12 ■■■■ 已修改文件
src/main/java/com/zy/core/thread/ShuttleThread.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/ShuttleThread.java
@@ -178,7 +178,7 @@
                if (shuttleProtocol.getErrorCode() != 0 && shuttleProtocol.getProtocolStatusType() == ShuttleProtocolStatusType.WORKING) {
                    //出现错误
                    reset(shuttleProtocol.getAssignCommand());
                    reset(shuttleProtocol.getTaskNo());
                }
                if(shuttleProtocol.getProtocolStatusType() == ShuttleProtocolStatusType.FIXING
@@ -950,19 +950,19 @@
    /**
     * 复位并尝试修复错误
     */
    private boolean reset(ShuttleAssignCommand assignCommand) {
    private boolean reset(Short wrkNo) {
        //读取redis数据
        if (assignCommand == null) {
        if (wrkNo == null) {
            return false;
        }
        Object o = redisUtil.get("wrk_no_" + assignCommand.getTaskNo());
        Object o = redisUtil.get("wrk_no_" + wrkNo);
        if (o == null) {
            return false;
        }
        ShuttleRedisCommand redisCommand = JSON.parseObject(o.toString(), ShuttleRedisCommand.class);
        List<ShuttleCommand> commands = assignCommand.getCommands();
        List<ShuttleCommand> commands = redisCommand.getAssignCommand().getCommands();
        //当前步序
        int commandStep = redisCommand.getCommandStep();
        //path路径数目
@@ -1027,7 +1027,7 @@
        redisCommand.setErrorCommands(list);
        //任务数据保存到redis
        redisUtil.set("wrk_no_" + assignCommand.getTaskNo(), JSON.toJSONString(redisCommand));
        redisUtil.set("wrk_no_" + wrkNo, JSON.toJSONString(redisCommand));
        shuttleProtocol.setProtocolStatus(ShuttleProtocolStatusType.FIXING);
        return true;
    }