#
Junjie
2024-10-17 cab87dcfaa7b1e2bc1298572b775026bb17ef38b
#
7个文件已修改
1个文件已添加
406 ■■■■■ 已修改文件
zy-asrs-flow/src/pages/log/basShuttleOpt/index.jsx 143 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/ShuttleAction.java 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/ShuttleTaskModeType.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/BasShuttleOpt.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/CommandResponse.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/log/basShuttleOpt/index.jsx
@@ -1,6 +1,6 @@
import React, { useState, useRef, useEffect } from 'react';
import { Button, message, Modal, Tag  } from 'antd';
import { Button, message, Modal, Tag } from 'antd';
import {
    FooterToolbar,
    PageContainer,
@@ -168,6 +168,78 @@
            />,
        },
        {
            title: '命令',
            dataIndex: 'command',
            valueType: 'text',
            hidden: false,
            width: 140,
            ellipsis: true,
            filterDropdown: (props) => <TextFilter
                name='command'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '系统状态',
            dataIndex: 'systemStatus',
            valueType: 'text',
            hidden: false,
            width: 140,
            ellipsis: true,
            filterDropdown: (props) => <TextFilter
                name='systemStatus'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '下发状态',
            dataIndex: 'send$',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <SelectFilter
                name='send'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
                data={[
                    { label: '未下发', value: 0 },
                    { label: '已下发', value: 1 },
                ]}
            />,
        },
        {
            title: '请求响应',
            dataIndex: 'response',
            valueType: 'text',
            hidden: false,
            width: 140,
            ellipsis: true,
            filterDropdown: (props) => <TextFilter
                name='response'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '设备工作号',
            dataIndex: 'deviceWrk',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <TextFilter
                name='deviceWrk'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '起点库位',
            dataIndex: 'sourceLocNo',
            valueType: 'text',
@@ -228,75 +300,6 @@
            width: 140,
            filterDropdown: (props) => <TextFilter
                name='memo'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '命令',
            dataIndex: 'command',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <TextFilter
                name='command'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '系统状态',
            dataIndex: 'systemStatus',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <TextFilter
                name='systemStatus'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '下发状态',
            dataIndex: 'send$',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <SelectFilter
                name='send'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
                data={[
                    { label: '未下发', value: 0 },
                    { label: '已下发', value: 1 },
                ]}
            />,
        },
        {
            title: '请求响应',
            dataIndex: 'response',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <TextFilter
                name='response'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
            />,
        },
        {
            title: '设备工作号',
            dataIndex: 'deviceWrk',
            valueType: 'text',
            hidden: false,
            width: 140,
            filterDropdown: (props) => <TextFilter
                name='deviceWrk'
                {...props}
                actionRef={actionRef}
                setSearchParam={setSearchParam}
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/ShuttleAction.java
@@ -23,20 +23,20 @@
import com.zy.asrs.wcs.rcs.News;
import com.zy.asrs.wcs.rcs.cache.SlaveConnection;
import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant;
import com.zy.asrs.wcs.rcs.entity.BasShuttleOpt;
import com.zy.asrs.wcs.rcs.entity.Device;
import com.zy.asrs.wcs.rcs.model.CommandResponse;
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.ShuttleProtocol;
import com.zy.asrs.wcs.rcs.service.BasShuttleOptService;
import com.zy.asrs.wcs.rcs.thread.ShuttleThread;
import com.zy.asrs.wcs.system.entity.Dict;
import com.zy.asrs.wcs.system.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
@Component
public class ShuttleAction {
@@ -57,6 +57,8 @@
    private DictService dictService;
    @Autowired
    private ConveyorDispatcher conveyorDispatcher;
    @Autowired
    private BasShuttleOptService basShuttleOptService;
    public synchronized boolean assignWork(Device device, ShuttleAssignCommand assignCommand) {
        ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getId().intValue());
@@ -82,7 +84,8 @@
                    || assignCommand.getTaskMode() == ShuttleTaskModeType.MOVE_LOC_NO.id
                    || assignCommand.getTaskMode() == ShuttleTaskModeType.SHUTTLE_MOVE_LOC_NO.id) {
                //下发行驶路径
                boolean result = shuttleThread.movePath(assignCommand.getNodes(), assignCommand.getDeviceTaskNo());
                CommandResponse response = shuttleThread.movePath(assignCommand.getNodes(), assignCommand.getDeviceTaskNo());
                Boolean result = response.getResult();
                if (!result) {
                    return false;
                }
@@ -260,7 +263,28 @@
        ShuttleCommand command = commands.get(commandStep);
        // 下发命令
        if (!write(command, device)) {
        CommandResponse response = write(command, device);
        //保存命令日志
        BasShuttleOpt basShuttleOpt = new BasShuttleOpt();
        basShuttleOpt.setTaskNo(redisCommand.getTaskNo());
        basShuttleOpt.setShuttleNo(Integer.parseInt(device.getDeviceNo()));
        basShuttleOpt.setMode(ShuttleCommandModeType.get(command.getMode()).desc);
        basShuttleOpt.setSourceLocNo(assignCommand.getSourceLocNo());
        basShuttleOpt.setDistLocNo(assignCommand.getLocNo());
        basShuttleOpt.setCommand(JSON.toJSONString(command));
        basShuttleOpt.setSystemStatus(JSON.toJSONString(shuttleProtocol));
        basShuttleOpt.setDeviceId(device.getId());
        basShuttleOpt.setDeviceWrk(String.valueOf(command.getTaskNo()));
        basShuttleOpt.setResponse(response.getMessage());//获取响应
        basShuttleOpt.setSendTime(new Date());//指令下发时间
        basShuttleOpt.setSend(response.getResult() ? 1 : 0);
        basShuttleOpt.setHostId(device.getHostId());
        //保存命令流水
        basShuttleOptService.save(basShuttleOpt);
        if (!response.getResult()) {
            News.error("四向穿梭车命令下发失败,穿梭车号={},任务数据={}", shuttleProtocol.getShuttleNo(), JSON.toJSON(command));
            return false;
        }
@@ -643,31 +667,32 @@
        }
    }
    private synchronized boolean write(ShuttleCommand command, Device device) {
    private synchronized CommandResponse write(ShuttleCommand command, Device device) {
        CommandResponse response = new CommandResponse(false);
        if (null == command) {
            News.error("四向穿梭车写入命令为空");
            return false;
            response.setMessage("四向穿梭车写入命令为空");
            return response;
        }
        ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, device.getId().intValue());
        boolean result = false;
        if (command.getMode() == ShuttleCommandModeType.MOVE.id
                || command.getMode() == ShuttleCommandModeType.IN_LIFT.id
                || command.getMode() == ShuttleCommandModeType.OUT_LIFT.id) {//移动
            result = shuttleThread.move(command);
            response = shuttleThread.move(command);
        } else if (command.getMode() == ShuttleCommandModeType.PALLET_LIFT.id
                || command.getMode() == ShuttleCommandModeType.PALLET_DOWN.id) {//顶升
            result = shuttleThread.lift(command);
            response = shuttleThread.lift(command);
        } else if (command.getMode() == ShuttleCommandModeType.CHARGE_OPEN.id
                || command.getMode() == ShuttleCommandModeType.CHARGE_CLOSE.id) {//充电
            result = shuttleThread.charge(command);
            response = shuttleThread.charge(command);
        } else if (command.getMode() == ShuttleCommandModeType.RESET.id) {//复位
            result = shuttleThread.reset(command);
            response = shuttleThread.reset(command);
        } else if (command.getMode() == ShuttleCommandModeType.UPDATE_LOCATION.id) {//更新坐标
            result = shuttleThread.updateLocation(command);
            response = shuttleThread.updateLocation(command);
        }
        News.info("四向穿梭车命令下发,穿梭车号={},任务数据={}", device.getDeviceNo(), JSON.toJSON(command));
        return result;
//        News.info("四向穿梭车命令下发,穿梭车号={},任务数据={}", device.getDeviceNo(), JSON.toJSON(command));
        return response;
    }
}
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/model/enums/ShuttleTaskModeType.java
@@ -37,12 +37,12 @@
        this.desc = desc;
    }
    public static ShuttleTaskModeType get(Short id) {
    public static ShuttleTaskModeType get(Integer id) {
        if (null == id) {
            return null;
        }
        for (ShuttleTaskModeType type : ShuttleTaskModeType.values()) {
            if (type.id.equals(id.intValue())) {
            if (type.id.equals(id)) {
                return type;
            }
        }
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/entity/BasShuttleOpt.java
@@ -108,9 +108,9 @@
    private String systemStatus;
    /**
     * 下发状态 0: 未下发  1: 已下发
     * 下发状态 0: 失败  1: 成功
     */
    @ApiModelProperty(value= "下发状态 0: 未下发  1: 已下发  ")
    @ApiModelProperty(value= "下发状态 0: 失败  1: 成功  ")
    private Integer send;
    /**
@@ -213,9 +213,9 @@
        if (null == this.send){ return null; }
        switch (this.send){
            case 0:
                return "未下发";
                return "失败";
            case 1:
                return "已下发";
                return "成功";
            default:
                return String.valueOf(this.send);
        }
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/model/CommandResponse.java
New file
@@ -0,0 +1,23 @@
package com.zy.asrs.wcs.rcs.model;
import lombok.Data;
@Data
public class CommandResponse {
    private Boolean result;
    private String message;
    public CommandResponse() {
    }
    public CommandResponse(Boolean result) {
        this.result = result;
    }
    public CommandResponse(Boolean result, String message) {
        this.result = result;
        this.message = message;
    }
}
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/ShuttleThread.java
@@ -6,6 +6,7 @@
import com.zy.asrs.wcs.core.model.command.ShuttleCommand;
import com.zy.asrs.wcs.core.model.enums.MotionCtgType;
import com.zy.asrs.wcs.rcs.entity.Device;
import com.zy.asrs.wcs.rcs.model.CommandResponse;
import com.zy.asrs.wcs.rcs.model.enums.ShuttleProtocolStatusType;
import com.zy.asrs.wcs.rcs.model.protocol.ShuttleProtocol;
@@ -19,17 +20,17 @@
    Device getDevice();//获取设备信息
    boolean movePath(List<NavigateNode> nodes, Integer taskNo);//路径下发
    CommandResponse movePath(List<NavigateNode> nodes, Integer taskNo);//路径下发
    boolean move(ShuttleCommand command);//移动
    CommandResponse move(ShuttleCommand command);//移动
    boolean lift(ShuttleCommand command);//顶升
    CommandResponse lift(ShuttleCommand command);//顶升
    boolean charge(ShuttleCommand command);//充电开关
    CommandResponse charge(ShuttleCommand command);//充电开关
    boolean reset(ShuttleCommand command);//复位开关
    CommandResponse reset(ShuttleCommand command);//复位开关
    boolean updateLocation(ShuttleCommand command);//更新坐标
    CommandResponse updateLocation(ShuttleCommand command);//更新坐标
    boolean isIdle();
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java
@@ -31,6 +31,7 @@
import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant;
import com.zy.asrs.wcs.rcs.entity.Device;
import com.zy.asrs.wcs.rcs.entity.DeviceDataLog;
import com.zy.asrs.wcs.rcs.model.CommandResponse;
import com.zy.asrs.wcs.rcs.model.command.NyShuttleHttpCommand;
import com.zy.asrs.wcs.rcs.model.enums.ShuttleProtocolStatusType;
import com.zy.asrs.wcs.rcs.model.enums.SlaveType;
@@ -123,6 +124,8 @@
                    //小车空闲且有跑库程序
                    shuttleAction.moveLoc(device);
                    Thread.sleep(200);
                } catch (Exception e) {
                    e.printStackTrace();
                }
@@ -434,12 +437,14 @@
    }
    @Override
    public boolean movePath(List<NavigateNode> nodes, Integer taskNo) {
        return true;
    public CommandResponse movePath(List<NavigateNode> nodes, Integer taskNo) {
        CommandResponse response = new CommandResponse(true);
        return response;
    }
    @Override
    public boolean move(ShuttleCommand command) {
    public CommandResponse move(ShuttleCommand command) {
        CommandResponse response = new CommandResponse(false);
        try {
            //发出请求
            NyShuttleHttpCommand httpCommand = JSON.parseObject(command.getBody(), NyShuttleHttpCommand.class);
@@ -479,73 +484,85 @@
            for (NyShuttleHttpCommand requestCommand : commandList) {
                JSONObject result = requestCommand(requestCommand);
                if (result == null) {
                    return false;//请求失败
                    return response;//请求失败
                }
                this.shuttleProtocol.setSendTime(System.currentTimeMillis());//指令下发时间
                response.setMessage(JSON.toJSONString(result));
                response.setResult(true);
            }
            return true;
            return response;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
            response.setMessage(e.getMessage());
            return response;
        }
    }
    @Override
    public boolean lift(ShuttleCommand command) {
    public CommandResponse lift(ShuttleCommand command) {
        CommandResponse response = new CommandResponse(false);
        try {
            //发出请求
            NyShuttleHttpCommand httpCommand = JSON.parseObject(command.getBody(), NyShuttleHttpCommand.class);
            JSONObject result = requestCommand(httpCommand);
            if (result == null) {
                return false;//请求失败
                return response;//请求失败
            }
            this.shuttleProtocol.setSendTime(System.currentTimeMillis());//指令下发时间
            return true;
            response.setMessage(JSON.toJSONString(result));
            response.setResult(true);
            return response;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
            return response;
        }
    }
    @Override
    public boolean charge(ShuttleCommand command) {
    public CommandResponse charge(ShuttleCommand command) {
        CommandResponse response = new CommandResponse(false);
        try {
            //发出请求
            NyShuttleHttpCommand httpCommand = JSON.parseObject(command.getBody(), NyShuttleHttpCommand.class);
            JSONObject result = requestCommand(httpCommand);
            if (result == null) {
                return false;//请求失败
                return response;//请求失败
            }
            this.shuttleProtocol.setSendTime(System.currentTimeMillis());//指令下发时间
            return true;
            response.setMessage(JSON.toJSONString(result));
            response.setResult(true);
            return response;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
            return response;
        }
    }
    @Override
    public boolean reset(ShuttleCommand command) {
    public CommandResponse reset(ShuttleCommand command) {
        setSyncTaskNo(0);
        setProtocolStatus(ShuttleProtocolStatusType.IDLE);
        enableMoveLoc(null, false);
        return true;
        return new CommandResponse(true, JSON.toJSONString(command));
    }
    @Override
    public boolean updateLocation(ShuttleCommand command) {
    public CommandResponse updateLocation(ShuttleCommand command) {
        CommandResponse response = new CommandResponse(false);
        try {
            //发出请求
            NyShuttleHttpCommand httpCommand = JSON.parseObject(command.getBody(), NyShuttleHttpCommand.class);
            JSONObject result = requestCommand(httpCommand);
            if (result == null) {
                return false;//请求失败
                return response;//请求失败
            }
            this.shuttleProtocol.setSendTime(System.currentTimeMillis());//指令下发时间
            return true;
            response.setMessage(JSON.toJSONString(result));
            response.setResult(true);
            return response;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
            return response;
        }
    }
@@ -812,9 +829,10 @@
        ArrayList<HashMap<String, Object>> path = new ArrayList<>();
        Integer taskId = getTaskId();
        HashMap<String, Object> body = new HashMap<>();
        body.put("requestType", "move");//移动命令
        body.put("taskId", getTaskId());//TaskID需要随机
        body.put("taskId", taskId);//TaskID需要随机
//        body.put("start", navigateNodeToNyPointNode(NavigatePositionConvert.codeToNode(startCodeNum, device.getHostId())));//起点
//        body.put("target", navigateNodeToNyPointNode(NavigatePositionConvert.codeToNode(distCodeNum, device.getHostId())));//终点
        body.put("path", path);
@@ -857,6 +875,7 @@
        command.setBody(JSON.toJSONString(httpStandard));
        command.setMode(ShuttleCommandModeType.MOVE.id);
        command.setTargetLocNo(loc.getLocNo());
        command.setTaskNo(taskId);
        return command;
    }
@@ -865,9 +884,10 @@
        NyShuttleHttpCommand httpStandard = getHttpStandard(Integer.parseInt(device.getDeviceNo()), taskNo);
        NyShuttleHttpCommand.NyRequest request = httpStandard.getRequest();
        Integer taskId = getTaskId();//TaskID需要随机
        HashMap<String, Object> body = new HashMap<>();
        body.put("requestType", lift ? "liftUp" : "liftDown");//顶升或下降命令
        body.put("taskId", getTaskId());//TaskID需要随机
        body.put("taskId", taskId);
        request.setBody(body);
        httpStandard.setRequest(request);
@@ -876,6 +896,7 @@
        command.setShuttleNo(Integer.parseInt(this.device.getDeviceNo()));
        command.setBody(JSON.toJSONString(httpStandard));
        command.setMode(lift ? ShuttleCommandModeType.PALLET_LIFT.id : ShuttleCommandModeType.PALLET_DOWN.id);
        command.setTaskNo(taskId);
        return command;
    }
@@ -884,9 +905,10 @@
        NyShuttleHttpCommand httpStandard = getHttpStandard(Integer.parseInt(device.getDeviceNo()), taskNo);
        NyShuttleHttpCommand.NyRequest request = httpStandard.getRequest();
        Integer taskId = getTaskId();//TaskID需要随机
        HashMap<String, Object> body = new HashMap<>();
        body.put("requestType", charge ? "charge" : "stopCharge");//充电或停止充电
        body.put("taskId", getTaskId());//TaskID需要随机
        body.put("taskId", taskId);
        request.setBody(body);
        httpStandard.setRequest(request);
@@ -895,6 +917,7 @@
        command.setShuttleNo(Integer.parseInt(this.device.getDeviceNo()));
        command.setBody(JSON.toJSONString(httpStandard));
        command.setMode(charge ? ShuttleCommandModeType.CHARGE_OPEN.id : ShuttleCommandModeType.CHARGE_CLOSE.id);
        command.setTaskNo(taskId);
        return command;
    }
@@ -914,6 +937,7 @@
        command.setShuttleNo(Integer.parseInt(this.device.getDeviceNo()));
        command.setBody(JSON.toJSONString(httpStandard));
        command.setMode(ShuttleCommandModeType.UPDATE_LOCATION.id);
        command.setTaskNo(taskNo);
        return command;
    }
@@ -968,6 +992,7 @@
        command.setShuttleNo(Integer.parseInt(this.device.getDeviceNo()));
        command.setBody(JSON.toJSONString(httpStandard));
        command.setMode(ShuttleCommandModeType.RESET.id);
        command.setTaskNo(taskNo);
        return command;
    }
@@ -1068,8 +1093,9 @@
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }else {
                break;
            }
            break;
        }
        return result;//返回Body结果集
    }
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/SurayShuttleThread.java
@@ -28,6 +28,7 @@
import com.zy.asrs.wcs.rcs.cache.OutputQueue;
import com.zy.asrs.wcs.rcs.constant.DeviceRedisConstant;
import com.zy.asrs.wcs.rcs.entity.DeviceDataLog;
import com.zy.asrs.wcs.rcs.model.CommandResponse;
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.ShuttleProtocol;
@@ -240,7 +241,8 @@
    }
    @Override
    public synchronized boolean movePath(List<NavigateNode> nodes, Integer taskNo) {
    public synchronized CommandResponse movePath(List<NavigateNode> nodes, Integer taskNo) {
        CommandResponse response = new CommandResponse(false);
        try {
            //默认地图母轨方向x
            String mapDirection = "x";
@@ -254,7 +256,7 @@
            String loginToken = requestLoginToken();
            if (loginToken == null) {
                return false;
                return response;
            }
            HashMap<String, Object> headers = new HashMap<>();
@@ -310,7 +312,7 @@
            param.put("taskId", taskNo);
            param.put("nodeNum", nodes.size());
            param.put("modes", modes);
            String response = new HttpHandler.Builder()
            String responseStr = new HttpHandler.Builder()
                    .setUri(API_URL)
                    .setPath("/RDS/runRoute")
                    .setHeaders(headers)
@@ -318,33 +320,36 @@
                    .setTimeout(60, TimeUnit.SECONDS)
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            JSONObject jsonObject = JSON.parseObject(responseStr);
            Integer code = jsonObject.getInteger("code");
            System.out.println("路径下发" + taskNo);
            System.out.println(JSON.toJSONString(jsonObject));
            System.out.println(JSON.toJSONString(param));
            if (code.equals(200)) {
                System.out.println("路径下发" + taskNo);
                return true;
                response.setResult(true);
                response.setMessage(responseStr);
                return response;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
        return response;
    }
    @Override
    public synchronized boolean move(ShuttleCommand command) {
    public synchronized CommandResponse move(ShuttleCommand command) {
        CommandResponse response = new CommandResponse(false);
        try {
            String loginToken = requestLoginToken();
            if (loginToken == null) {
                return false;
                return response;
            }
            HashMap<String, Object> headers = new HashMap<>();
            headers.put("Authorization", "Bearer " + loginToken);
            String response = new HttpHandler.Builder()
            String responseStr = new HttpHandler.Builder()
                    .setUri(API_URL)
                    .setPath("/RDS/runOrder")
                    .setHeaders(headers)
@@ -352,31 +357,34 @@
                    .setTimeout(60, TimeUnit.SECONDS)
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            JSONObject jsonObject = JSON.parseObject(responseStr);
            Integer code = jsonObject.getInteger("code");
            System.out.println(JSON.toJSONString(command.getBody()));
            if (code.equals(200)) {
                this.shuttleProtocol.setSendTime(System.currentTimeMillis());//指令下发时间
                return true;
                response.setResult(true);
                response.setMessage(responseStr);
                return response;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
        return response;
    }
    @Override
    public synchronized boolean lift(ShuttleCommand command) {
    public synchronized CommandResponse lift(ShuttleCommand command) {
        CommandResponse response = new CommandResponse(false);
        try {
            String loginToken = requestLoginToken();
            if (loginToken == null) {
                return false;
                return response;
            }
            HashMap<String, Object> headers = new HashMap<>();
            headers.put("Authorization", "Bearer " + loginToken);
            String response = new HttpHandler.Builder()
            String responseStr = new HttpHandler.Builder()
                    .setUri(API_URL)
                    .setPath("/RDS/actionOrder")
                    .setHeaders(headers)
@@ -384,30 +392,33 @@
                    .setTimeout(60, TimeUnit.SECONDS)
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            JSONObject jsonObject = JSON.parseObject(responseStr);
            Integer code = jsonObject.getInteger("code");
            if (code.equals(200)) {
                this.shuttleProtocol.setSendTime(System.currentTimeMillis());//指令下发时间
                return true;
                response.setResult(true);
                response.setMessage(responseStr);
                return response;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
        return response;
    }
    @Override
    public synchronized boolean charge(ShuttleCommand command) {
    public synchronized CommandResponse charge(ShuttleCommand command) {
        CommandResponse response = new CommandResponse(false);
        try {
            String loginToken = requestLoginToken();
            if (loginToken == null) {
                return false;
                return response;
            }
            HashMap<String, Object> headers = new HashMap<>();
            headers.put("Authorization", "Bearer " + loginToken);
            String response = new HttpHandler.Builder()
            String responseStr = new HttpHandler.Builder()
                    .setUri(API_URL)
                    .setPath("/RDS/actionOrder")
                    .setHeaders(headers)
@@ -415,38 +426,41 @@
                    .setTimeout(60, TimeUnit.SECONDS)
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            JSONObject jsonObject = JSON.parseObject(responseStr);
            Integer code = jsonObject.getInteger("code");
            if (code.equals(200)) {
                this.shuttleProtocol.setSendTime(System.currentTimeMillis());//指令下发时间
                return true;
                response.setResult(true);
                response.setMessage(responseStr);
                return response;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
        return response;
    }
    @Override
    public synchronized boolean reset(ShuttleCommand command) {
    public synchronized CommandResponse reset(ShuttleCommand command) {
        setSyncTaskNo(0);
        setProtocolStatus(ShuttleProtocolStatusType.IDLE);
        enableMoveLoc(null, false);
        return true;
        return new CommandResponse(true, JSON.toJSONString(command));
    }
    @Override
    public boolean updateLocation(ShuttleCommand command) {
    public CommandResponse updateLocation(ShuttleCommand command) {
        CommandResponse response = new CommandResponse(false);
        try {
            String loginToken = requestLoginToken();
            if (loginToken == null) {
                return false;
                return response;
            }
            HashMap<String, Object> headers = new HashMap<>();
            headers.put("Authorization", "Bearer " + loginToken);
            String response = new HttpHandler.Builder()
            String responseStr = new HttpHandler.Builder()
                    .setUri(API_URL)
                    .setPath("/RDS/changeLocation")
                    .setHeaders(headers)
@@ -454,16 +468,18 @@
                    .setTimeout(60, TimeUnit.SECONDS)
                    .build()
                    .doPost();
            JSONObject jsonObject = JSON.parseObject(response);
            JSONObject jsonObject = JSON.parseObject(responseStr);
            Integer code = jsonObject.getInteger("code");
            if (code.equals(200)) {
                this.shuttleProtocol.setSendTime(System.currentTimeMillis());//指令下发时间
                return true;
                response.setResult(true);
                response.setMessage(responseStr);
                return response;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
        return response;
    }
    @Override
@@ -733,6 +749,7 @@
        command.setBody(JSON.toJSONString(body));
        command.setMode(ShuttleCommandModeType.MOVE.id);
        command.setTargetLocNo(loc.getLocNo());
        command.setTaskNo(taskNo);
        return command;
    }
@@ -749,6 +766,7 @@
        command.setShuttleNo(Integer.parseInt(this.device.getDeviceNo()));
        command.setBody(JSON.toJSONString(body));
        command.setMode(lift ? ShuttleCommandModeType.PALLET_LIFT.id : ShuttleCommandModeType.PALLET_DOWN.id);
        command.setTaskNo(taskNo);
        return command;
    }
@@ -765,6 +783,7 @@
        command.setShuttleNo(Integer.parseInt(this.device.getDeviceNo()));
        command.setBody(JSON.toJSONString(body));
        command.setMode(charge ? ShuttleCommandModeType.CHARGE_OPEN.id : ShuttleCommandModeType.CHARGE_CLOSE.id);
        command.setTaskNo(taskNo);
        return command;
    }
@@ -782,6 +801,7 @@
        command.setShuttleNo(Integer.parseInt(this.device.getDeviceNo()));
        command.setBody(JSON.toJSONString(body));
        command.setMode(ShuttleCommandModeType.UPDATE_LOCATION.id);
        command.setTaskNo(taskNo);
        return command;
    }