#
Junjie
1 天以前 c4b6b51afdd3374735ed5f358457987eaa6e476f
#
1个文件已删除
9个文件已修改
3个文件已添加
428 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/ConsoleController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/RealtimeBasMapScheduler.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/utils/NavigateMapData.java 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/utils/NavigatePositionConvert.java 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/utils/ShuttleOperaUtils.java 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/News.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/config/PointInitializer.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/config/ShuttleConfigInitializer.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/config/SystemConfigInitializer.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/enums/RedisKeyType.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/impl/NyLiftThread.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/impl/NyShuttleThread.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/ConsoleController.java
@@ -87,10 +87,7 @@
            return R.error();
        }
        BasMap basMap = JSON.parseObject(data.toString(), BasMap.class);
        //解析json地图数据
        ArrayList arrayList = JSON.parseObject(basMap.getData(), ArrayList.class);
        List<List<MapNode>> arrayList = (List<List<MapNode>>) data;
        List<List<MapNode>> lists = navigateMapData.filterMap(NavigationMapType.getMapTypes(NavigationMapType.NONE, NavigationMapType.PATH_LOCK), arrayList, lev, null, null);//过滤地图数据
        return R.ok().add(lists);
    }
@@ -106,10 +103,7 @@
            return R.error();
        }
        BasMap basMap = JSON.parseObject(data.toString(), BasMap.class);
        //解析json地图数据
        ArrayList arrayList = JSON.parseObject(basMap.getData(), ArrayList.class);
        List<List<MapNode>> arrayList = (List<List<MapNode>>) data;
        List<List<MapNode>> lists = navigateMapData.filterMap(NavigationMapType.getMapTypes(NavigationMapType.NONE), arrayList, lev, null, null);//过滤地图数据
        return R.ok().add(lists);
    }
@@ -120,8 +114,10 @@
    @GetMapping("/map/resetMap/auth")
    @ManagerAuth
    public R resetMapToRedis() {
        for (int i = 1; i <= 10; i++) {//总共10层楼
            redisUtil.del(RedisKeyType.MAP.key + i);
        List<BasMap> basMaps = basMapService.selectList(new EntityWrapper<BasMap>().orderBy("lev", true));
        for (BasMap basMap : basMaps) {
            Integer lev = basMap.getLev();
            redisUtil.del(RedisKeyType.MAP.key + lev);
        }
        return R.ok();
    }
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -99,7 +99,7 @@
                    }
                    //将数据库地图数据存入redis
                    redisUtil.set(RedisKeyType.MAP.key + lev, JSON.toJSONString(basMap));
                    redisUtil.set(RedisKeyType.MAP.key + lev, lists);
                }
            }
src/main/java/com/zy/asrs/task/RealtimeBasMapScheduler.java
File was deleted
src/main/java/com/zy/common/utils/NavigateMapData.java
@@ -51,52 +51,23 @@
    @Autowired
    private ObjectMapper objectMapper;
    public int[][] getData(Integer lev, List<NavigationMapType> mapTypes, List<int[]> whitePoints, List<int[]> shuttlePoints) {
        try {
            BasMap basMap = basMapService.selectLatestMap(lev);
            String originData = basMap.getOriginData();
            //解析json地图数据
            ArrayList arrayList = JSON.parseObject(originData, ArrayList.class);
            List<List<MapNode>> lists = filterMap(mapTypes, arrayList, lev, whitePoints, shuttlePoints);//过滤地图数据
            int[][] map = new int[lists.size()][];
            int j = 0;
            for (List<MapNode> list : lists) {
                int[] tmp = new int[list.size()];
                int i = 0;
                for (MapNode mapNode : list) {
                    //将数据添加进二维数组
                    tmp[i++] = mapNode.getValue();
                }
                //数据添加进一维数组
                map[j++] = tmp;
            }
            return map;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    /**
     * 尝试从redis获取数据
     */
    public int[][] getDataFromRedis(Integer lev, List<NavigationMapType> mapTypes, List<int[]> whitePoints, List<int[]> shuttlePoints) {
        Object o = redisUtil.get(RedisKeyType.MAP.key + lev);
        if (o == null) {
        Object data = redisUtil.get(RedisKeyType.MAP.key + lev);
        if (data == null) {
            return null;
        }
        BasMap basMap = JSON.parseObject(o.toString(), BasMap.class);
        return this.getDataFormString(lev, basMap.getData(), mapTypes, whitePoints, shuttlePoints);
        List<List<MapNode>> arrayList = (List<List<MapNode>>) data;
        return this.getDataFormString(lev, arrayList, mapTypes, whitePoints, shuttlePoints);
    }
    /**
     * 从List数据中获取地图
     */
    public int[][] getDataFormString(Integer lev, String data, List<NavigationMapType> mapTypes, List<int[]> whitePoints, List<int[]> shuttlePoints) {
        ArrayList arrayList = JSON.parseObject(data, ArrayList.class);
    public int[][] getDataFormString(Integer lev, List<List<MapNode>> arrayList, List<NavigationMapType> mapTypes, List<int[]> whitePoints, List<int[]> shuttlePoints) {
        List<List<MapNode>> lists = filterMap(mapTypes, arrayList, lev, whitePoints, shuttlePoints);//过滤地图数据
        int[][] map = new int[lists.size()][];
        int j = 0;
@@ -122,9 +93,7 @@
                return null;
            }
            BasMap basMap = JSON.parseObject(data.toString(), BasMap.class);
            //解析json地图数据
            ArrayList arrayList = JSON.parseObject(basMap.getData(), ArrayList.class);
            List<List<MapNode>> arrayList = (List<List<MapNode>>) data;
            List<List<MapNode>> lists = filterMap(mapTypes, arrayList, lev, whitePoints, shuttlePoints);//过滤地图数据
            return lists;
        } catch (Exception e) {
@@ -173,12 +142,8 @@
     * @param whitePoints 白名单节点,不需要被过滤
     * @param shuttlePoints 穿梭车节点,需要加载进地图
     */
    public List<List<MapNode>> filterMap(List<NavigationMapType> mapTypes, List arrayList, Integer lev, List<int[]> whitePoints, List<int[]> shuttlePoints) {
        //重建数据格式
        List<List<MapNode>> lists = rebuildData(arrayList);
    public List<List<MapNode>> filterMap(List<NavigationMapType> mapTypes, List<List<MapNode>> lists, Integer lev, List<int[]> whitePoints, List<int[]> shuttlePoints) {
        List<NavigationMapType> locMapType = new ArrayList<>();
        locMapType.add(NavigationMapType.NONE);
        locMapType.add(NavigationMapType.DFX);
        locMapType.add(NavigationMapType.NORMAL);
        for (NavigationMapType mapType : mapTypes) {
src/main/java/com/zy/common/utils/NavigatePositionConvert.java
@@ -6,6 +6,9 @@
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.utils.Utils;
import com.zy.common.model.NavigateNode;
import com.zy.core.enums.RedisKeyType;
import java.util.HashMap;
/**
 * 库位编号和A*算法的xy轴转换工具类
@@ -14,29 +17,53 @@
    public static String xyToPosition(int x, int y, int z) {
        String locNo = Utils.getLocNo(x, y, z);
        String code = null;
        //库位号转小车二维码
        LocMastService locMastService = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                .eq("loc_no", locNo)
                .eq("status", 1));
        if (locMast == null) {
            return null;
        RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
        Object object = redisUtil.get(RedisKeyType.POINT_MAP.key);
        if(object == null) {
            //库位号转小车二维码
            LocMastService locMastService = SpringUtils.getBean(LocMastService.class);
            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                    .eq("loc_no", locNo)
                    .eq("status", 1));
            if (locMast == null) {
                return null;
            }
            code = locMast.getQrCodeValue();
        }else {
            HashMap<String, String> cache = (HashMap<String, String>) object;
            code = cache.get(locNo);
        }
        return locMast.getQrCodeValue();
        return code;
    }
    //小车条形码转路径算法节点
    public static NavigateNode codeToNode(String code) {
        LocMastService locMastService = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                .eq("qr_code_value", code)
                .eq("status", 1));
        if (locMast == null) {
            return null;
        NavigateNode node = null;
        RedisUtil redisUtil = SpringUtils.getBean(RedisUtil.class);
        Object object = redisUtil.get(RedisKeyType.LOC_MAP.key);
        if (object == null) {
            LocMastService locMastService = SpringUtils.getBean(LocMastService.class);
            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                    .eq("qr_code_value", code)
                    .eq("status", 1));
            if (locMast == null) {
                return null;
            }
            node = new NavigateNode(locMast.getRow1(), locMast.getBay1());
            node.setZ(locMast.getLev1());
        } else {
            HashMap<String, String> cache = (HashMap<String, String>) object;
            String locNo = cache.get(code);
            node = new NavigateNode(Utils.getRow(locNo), Utils.getBay(locNo));
            node.setZ(Utils.getLev(locNo));
        }
        NavigateNode node = new NavigateNode(locMast.getRow1(), locMast.getBay1());
        node.setZ(locMast.getLev1());
        return node;
    }
src/main/java/com/zy/common/utils/ShuttleOperaUtils.java
@@ -3,9 +3,7 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.BasShuttle;
import com.zy.asrs.entity.DeviceConfig;
import com.zy.asrs.service.BasShuttleService;
import com.zy.asrs.service.DeviceConfigService;
import com.zy.asrs.utils.Utils;
import com.zy.common.model.MapNode;
@@ -15,6 +13,7 @@
import com.zy.core.cache.SlaveConnection;
import com.zy.core.dispatcher.ShuttleDispatchUtils;
import com.zy.core.enums.MapNodeType;
import com.zy.core.enums.RedisKeyType;
import com.zy.core.enums.ShuttleRunDirection;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.command.ShuttleAssignCommand;
@@ -36,11 +35,7 @@
public class ShuttleOperaUtils {
    @Autowired
    private BasShuttleService basShuttleService;
    @Autowired
    private NavigateUtils navigateUtils;
    @Autowired
    private NavigateMapUtils navigateMapUtils;
    @Autowired
    private NavigateMapData navigateMapData;
    @Autowired
@@ -49,6 +44,8 @@
    private ShuttleDispatchUtils shuttleDispatchUtils;
    @Autowired
    private DeviceConfigService deviceConfigService;
    @Autowired
    private RedisUtil redisUtil;
    public synchronized List<ShuttleCommand> getStartToTargetCommands(String startLocNo, String endLocNo, List<NavigationMapType> mapTypes, ShuttleAssignCommand assignCommand, ShuttleThread shuttleThread) {
        return getStartToTargetCommands(startLocNo, endLocNo, mapTypes, null, assignCommand, shuttleThread, "move");
@@ -65,7 +62,16 @@
        }
        Integer shuttleNo = shuttleProtocol.getShuttleNo();
        //获取小车移动速度
        Integer runSpeed = Optional.ofNullable(basShuttleService.selectOne(new EntityWrapper<BasShuttle>().eq("shuttle_no", shuttleNo)).getRunSpeed()).orElse(1000);
        Integer runSpeed = 1000;
        Object speedObj = redisUtil.get(RedisKeyType.SHUTTLE_SPEED_MAP.key);
        if (speedObj != null) {
            HashMap<Integer, Integer> shuttleSpeedMap = (HashMap<Integer, Integer>) speedObj;
            Integer speed = shuttleSpeedMap.get(shuttleNo);
            if (speed != null) {
                runSpeed = speed;
            }
        }
        long calcStartTime = System.currentTimeMillis();
        List<NavigateNode> nodeList = navigateUtils.calc(startLocNo, endLocNo, mapTypes, Utils.getShuttlePoints(shuttleNo, Utils.getLev(startLocNo)), whites);
        if (nodeList == null) {
@@ -102,43 +108,59 @@
        List<List<NavigateNode>> data = navigateUtils.getSectionPath(nodeList);
        long endTime = System.currentTimeMillis();
        News.info("[RCS Debug] getSection path time:{}", (endTime - startTime));
        long startGetSectionCommandTime = System.currentTimeMillis();
        //将每一段路径分成command指令
        for (int i = 0; i < data.size(); i++) {
            long startGetStartAndEndPathTime = System.currentTimeMillis();
            List<NavigateNode> nodes = data.get(i);
            //开始路径
            NavigateNode startPath = nodes.get(0);
            //目标路径
            NavigateNode endPath = nodes.get(nodes.size() - 1);
            News.info("[RCS Debug] getStartAndEndPath idx:{} time:{}", i, (System.currentTimeMillis() - startGetStartAndEndPathTime));
            long startAllDistanceTime = System.currentTimeMillis();
            Integer allDistance = navigateUtils.getCurrentPathAllDistance(nodes);//计算当前路径行走总距离
            News.info("[RCS Debug] getAllDistance idx:{} time:{}", i, (System.currentTimeMillis() - startAllDistanceTime));
            long startGetPosition = System.currentTimeMillis();
            //通过xy坐标小车二维码
            String startCodeNum = NavigatePositionConvert.xyToPosition(startPath.getX(), startPath.getY(), startPath.getZ());
            //通过xy坐标小车二维码
            String distCodeNum = NavigatePositionConvert.xyToPosition(endPath.getX(), endPath.getY(), endPath.getZ());
            News.info("[RCS Debug] xyToPosition idx:{} time:{}", i, (System.currentTimeMillis() - startGetPosition));
            long startGetMoveCommandTime = System.currentTimeMillis();
            //获取移动命令
            ShuttleCommand command = shuttleThread.getMoveCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes);
            News.info("[RCS Debug] getMoveCommand idx:{} time:{}", i, (System.currentTimeMillis() - startGetMoveCommandTime));
            if (i + 1 == data.size()) {
                long startGetInOutLiftTime = System.currentTimeMillis();
                if (moveType.equals("inLift")) {
                    command = shuttleThread.getMoveLiftCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes, true);
                }else if (moveType.equals("outLift")) {
                    command = shuttleThread.getMoveLiftCommand(assignCommand.getDeviceTaskNo(), startCodeNum, distCodeNum, allDistance, ShuttleRunDirection.get(startPath.getDirection()).id.intValue(), runSpeed, nodes, false);
                }
                News.info("[RCS Debug] getInOutLiftTime idx:{} time:{}", i, (System.currentTimeMillis() - startGetInOutLiftTime));
            }
            command.setNodes(nodes);//将行走节点添加到每一步命令中
            commands.add(command);
        }
        News.info("[RCS Debug] getSectionCommand path time:{}", (System.currentTimeMillis() - startGetSectionCommandTime));
        assignCommand.setNodes(allNode);//当前任务所占用的节点list
        assignCommand.setMapTypes(mapTypes);
        //小车移动连续下发指令
        boolean shuttleMoveCommandsContinuously = false;
        Config shuttleMoveCommandsContinuouslyConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "shuttleMoveCommandsContinuously"));
        if (shuttleMoveCommandsContinuouslyConfig != null) {
            if (shuttleMoveCommandsContinuouslyConfig.getValue().equals("Y")) {
        Object object = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key);
        if (object != null) {
            HashMap<String, String> systemConfigMap = (HashMap<String, String>) object;
            String shuttleMoveCommandsContinuouslyConfig = systemConfigMap.get("shuttleMoveCommandsContinuously");
            if (shuttleMoveCommandsContinuouslyConfig != null && shuttleMoveCommandsContinuouslyConfig.equals("Y")) {
                shuttleMoveCommandsContinuously = true;
            }
        }
src/main/java/com/zy/core/News.java
@@ -116,7 +116,11 @@
                    return;
                }
            }
            log.info(format, arguments);
            offer(NewsLevel.INFO, format, arguments);
            return;
        }
        RedisUtil redisUtil = null;
        try {
            redisUtil = SpringUtils.getBean(RedisUtil.class);
@@ -147,7 +151,11 @@
                    return;
                }
            }
            log.warn(format, arguments);
            offer(NewsLevel.WARN, format, arguments);
            return;
        }
        RedisUtil redisUtil = null;
        try {
            redisUtil = SpringUtils.getBean(RedisUtil.class);
@@ -178,7 +186,11 @@
                    return;
                }
            }
            log.error(format, arguments);
            offer(NewsLevel.ERROR, format, arguments);
            return;
        }
        RedisUtil redisUtil = null;
        try {
            redisUtil = SpringUtils.getBean(RedisUtil.class);
src/main/java/com/zy/core/config/PointInitializer.java
New file
@@ -0,0 +1,40 @@
package com.zy.core.config;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.service.LocMastService;
import com.zy.common.utils.RedisUtil;
import com.zy.core.enums.RedisKeyType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.List;
@Component
public class PointInitializer {
    @Autowired
    private RedisUtil redisUtil;
    @Autowired
    private LocMastService locMastService;
    @PostConstruct
    public void init() {
        HashMap<String, String> pointMap = new HashMap<>();
        HashMap<String, String> locMap = new HashMap<>();
        List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<>());
        for (LocMast locMast : locMasts) {
            String locNo = locMast.getLocNo();
            String qrCodeValue = locMast.getQrCodeValue();
            pointMap.put(locNo, qrCodeValue);
            locMap.put(qrCodeValue, locNo);
        }
        redisUtil.set(RedisKeyType.POINT_MAP.key, pointMap);
        redisUtil.set(RedisKeyType.LOC_MAP.key, locMap);
    }
}
src/main/java/com/zy/core/config/ShuttleConfigInitializer.java
New file
@@ -0,0 +1,46 @@
package com.zy.core.config;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zy.asrs.entity.BasShuttle;
import com.zy.asrs.entity.DeviceConfig;
import com.zy.asrs.service.BasShuttleService;
import com.zy.asrs.service.DeviceConfigService;
import com.zy.common.utils.RedisUtil;
import com.zy.core.enums.RedisKeyType;
import com.zy.core.enums.SlaveType;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
@Component
public class ShuttleConfigInitializer {
    @Autowired
    private DeviceConfigService deviceConfigService;
    @Autowired
    private BasShuttleService basShuttleService;
    @Autowired
    private RedisUtil redisUtil;
    @PostConstruct
    public void shuttleSpeedInit() {
        HashMap<Integer, Integer> shuttleSpeedMap = new HashMap<>();
        List<DeviceConfig> shuttleList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>()
                .eq("device_type", String.valueOf(SlaveType.Shuttle)));
        for (DeviceConfig shuttle : shuttleList) {
            //获取小车移动速度
            Integer runSpeed = Optional.ofNullable(basShuttleService.selectOne(new EntityWrapper<BasShuttle>().eq("shuttle_no", shuttle.getDeviceNo())).getRunSpeed()).orElse(1000);
            shuttleSpeedMap.put(shuttle.getDeviceNo(), runSpeed);
        }
        redisUtil.set(RedisKeyType.SHUTTLE_SPEED_MAP.key, shuttleSpeedMap);
    }
}
src/main/java/com/zy/core/config/SystemConfigInitializer.java
New file
@@ -0,0 +1,35 @@
package com.zy.core.config;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zy.common.utils.RedisUtil;
import com.zy.core.enums.RedisKeyType;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.List;
@Component
public class SystemConfigInitializer {
    @Autowired
    private ConfigService configService;
    @Autowired
    private RedisUtil redisUtil;
    @PostConstruct
    public void init() {
        HashMap<String, String> systemConfigMap = new HashMap<>();
        List<Config> configList = configService.selectList(new EntityWrapper<>());
        for (Config config : configList) {
            systemConfigMap.put(config.getName(), config.getValue());
        }
        redisUtil.set(RedisKeyType.SYSTEM_CONFIG_MAP.key, systemConfigMap);
    }
}
src/main/java/com/zy/core/enums/RedisKeyType.java
@@ -53,6 +53,11 @@
    FAKE_DEVICE_CONFIG("fakeDeviceConfig"),
    LOG_LIMIT("log_limit_"),
    POINT_MAP("point_map"),
    LOC_MAP("loc_map"),
    SHUTTLE_SPEED_MAP("shuttle_speed_map"),
    SYSTEM_CONFIG_MAP("system_config_map"),
    ;
    public String key;
src/main/java/com/zy/core/thread/impl/NyLiftThread.java
@@ -381,32 +381,10 @@
    @Override
    public CommandResponse reset() {
        CommandResponse response = new CommandResponse(false);
        try {
            LiftCommand resetCommand = getResetCommand(9999);
            //发出请求
            String resultKey = requestCommand(resetCommand);
            //查询请求结果
            JSONObject result = queryCommandStatus(resultKey);
            if (result == null) {
                return response;//请求失败
            }
            if(!result.getString("result").equals("success")) {
                return response;//请求失败
            }
            this.liftProtocol.setSendTime(System.currentTimeMillis());//指令下发时间
            this.setSyncTaskNo(0);
            this.setProtocolStatus(LiftProtocolStatusType.IDLE);
            response.setMessage(JSON.toJSONString(result));
            response.setResult(true);
            return response;
        } catch (Exception e) {
            e.printStackTrace();
            response.setMessage(e.getMessage());
            return response;
        }
        CommandResponse response = new CommandResponse(true);
        this.setSyncTaskNo(0);
        this.setProtocolStatus(LiftProtocolStatusType.IDLE);
        return response;
    }
    @Override
src/main/java/com/zy/core/thread/impl/NyShuttleThread.java
@@ -5,7 +5,6 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.DateUtils;
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.zy.asrs.entity.BasShuttle;
import com.zy.asrs.entity.DeviceConfig;
@@ -983,6 +982,7 @@
        request.setBody(body);
        NavigateNode startNode = nodes.get(0);
        List<List<MapNode>> mapData = navigateMapData.getJsonData(startNode.getZ(), NavigationMapType.getMapTypes(NavigationMapType.NONE), null, null);
        for (NavigateNode node : nodes) {
            HashMap<String, Object> data = new HashMap<>();
            String codeNum = NavigatePositionConvert.xyToPosition(node.getX(), node.getY(), node.getZ());
@@ -991,7 +991,6 @@
            int yp = Integer.parseInt(String.valueOf(nyNode.get("x")));
            int z = Integer.parseInt(String.valueOf(nyNode.get("z")));
            List<List<MapNode>> mapData = navigateMapData.getJsonData(startNode.getZ(), NavigationMapType.getMapTypes(NavigationMapType.NONE), null, null);
            List<MapNode> mapNodes = mapData.get(node.getX());
            MapNode mapNode = mapNodes.get(node.getY());
@@ -1005,18 +1004,15 @@
        httpStandard.setRequest(request);
        LocMastService locMastService = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                .eq("qr_code_value", distCodeNum));
        if (locMast == null) {
            throw new CoolException("库位信息不存在");
        }
        Object object = redisUtil.get(RedisKeyType.LOC_MAP.key);
        HashMap<String, String> locMap = (HashMap<String, String>) object;
        String targetLocNo = locMap.get(distCodeNum);
        ShuttleCommand command = new ShuttleCommand();
        command.setShuttleNo(deviceConfig.getDeviceNo());
        command.setBody(JSON.toJSONString(httpStandard));
        command.setMode(ShuttleCommandModeType.MOVE.id);
        command.setTargetLocNo(locMast.getLocNo());
        command.setTargetLocNo(targetLocNo);
        command.setTaskNo(taskId);
        return command;
    }
@@ -1041,6 +1037,7 @@
        request.setBody(body);
        NavigateNode startNode = nodes.get(0);
        List<List<MapNode>> mapData = navigateMapData.getJsonData(startNode.getZ(), NavigationMapType.getMapTypes(NavigationMapType.NONE), null, null);
        for (NavigateNode node : nodes) {
            HashMap<String, Object> data = new HashMap<>();
            String codeNum = NavigatePositionConvert.xyToPosition(node.getX(), node.getY(), node.getZ());
@@ -1049,7 +1046,6 @@
            int yp = Integer.parseInt(String.valueOf(nyNode.get("x")));
            int z = Integer.parseInt(String.valueOf(nyNode.get("z")));
            List<List<MapNode>> mapData = navigateMapData.getJsonData(startNode.getZ(), NavigationMapType.getMapTypes(NavigationMapType.NONE), null, null);
            List<MapNode> mapNodes = mapData.get(node.getX());
            MapNode mapNode = mapNodes.get(node.getY());
@@ -1063,18 +1059,15 @@
        httpStandard.setRequest(request);
        LocMastService locMastService = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                .eq("qr_code_value", distCodeNum));
        if (locMast == null) {
            throw new CoolException("库位信息不存在");
        }
        Object object = redisUtil.get(RedisKeyType.LOC_MAP.key);
        HashMap<String, String> locMap = (HashMap<String, String>) object;
        String targetLocNo = locMap.get(distCodeNum);
        ShuttleCommand command = new ShuttleCommand();
        command.setShuttleNo(deviceConfig.getDeviceNo());
        command.setBody(JSON.toJSONString(httpStandard));
        command.setMode(ShuttleCommandModeType.MOVE.id);
        command.setTargetLocNo(locMast.getLocNo());
        command.setTargetLocNo(targetLocNo);
        command.setTaskNo(taskId);
        return command;
    }
@@ -1143,7 +1136,6 @@
    //获取小车复位响应命令
    public ShuttleCommand getInitCommand(Integer taskNo, Integer code) {
        LocMastService locMastService = SpringUtils.getBean(LocMastService.class);
        NavigateMapData navigateMapData = SpringUtils.getBean(NavigateMapData.class);
        NyShuttleHttpCommand httpStandard = getHttpStandard(deviceConfig.getDeviceNo(), taskNo);
        NyShuttleHttpCommand.NyRequest request = httpStandard.getRequest();
@@ -1159,15 +1151,14 @@
        map.put("z", lev);
        String mapStr = JSON.toJSONString(map);
        LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
                .eq("qr_code_value", mapStr));
        if (locMast == null) {
            throw new CoolException("地址码不存在");
        }
        Object object = redisUtil.get(RedisKeyType.LOC_MAP.key);
        HashMap<String, String> locMap = (HashMap<String, String>) object;
        String targetLocNo = locMap.get(mapStr);
        List<List<MapNode>> mapData = navigateMapData.getJsonData(lev, NavigationMapType.getMapTypes(NavigationMapType.NONE), null, null);
        List<MapNode> mapNodes = mapData.get(locMast.getRow1());
        MapNode mapNode = mapNodes.get(locMast.getBay1());
        List<MapNode> mapNodes = mapData.get(Utils.getRow(targetLocNo));
        MapNode mapNode = mapNodes.get(Utils.getBay(targetLocNo));
        HashMap<String, Object> location = new HashMap<>();
        location.put("xp", row);