#
whycq
2024-07-11 18d258c246cb9e4812964968769eb32fa990065a
#
2个文件已修改
30 ■■■■ 已修改文件
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/ShuttleAction.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/action/ShuttleAction.java
@@ -323,8 +323,10 @@
                    shuttleDispatcher.generateMoveTask(device, start.getLocNo());
                }else {
                    //在起点位置,调度去目标位置
                    shuttleDispatcher.generateMoveTask(device, target.getLocNo());
                    shuttleProtocol.setYCurrent(shuttleProtocol.getYCurrent() + 1);//切换y轴
                    Task task = shuttleDispatcher.generateMoveTask(device, target.getLocNo());
                    if (task != null) {
                        shuttleProtocol.setYCurrent(shuttleProtocol.getYCurrent() + 1);//切换y轴
                    }
                    if(shuttleProtocol.getYCurrent() > shuttleProtocol.getYTarget()) {
                        //y轴也跑完了,结束跑库
@@ -362,8 +364,10 @@
                    shuttleDispatcher.generateMoveTask(device, start.getLocNo());
                }else {
                    //在起点位置,调度去目标位置
                    shuttleDispatcher.generateMoveTask(device, target.getLocNo());
                    shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1);//切换x轴
                    Task task = shuttleDispatcher.generateMoveTask(device, target.getLocNo());
                    if (task != null) {
                        shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1);//切换x轴
                    }
                    if(shuttleProtocol.getXCurrent() > shuttleProtocol.getXTarget()) {
                        //y轴也跑完了,结束跑库
@@ -486,6 +490,7 @@
                            return;
                        }
                    }
                    return;
                }
                //调度去库位
@@ -644,6 +649,8 @@
        } else if (command.getMode() == ShuttleCommandModeType.UPDATE_LOCATION.id) {//更新坐标
            result = shuttleThread.updateLocation(command);
        }
        News.info("四向穿梭车命令下发,穿梭车号={},任务数据={}", device.getDeviceNo(), JSON.toJSON(command));
        return result;
    }
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/rcs/thread/impl/NyShuttleThread.java
@@ -373,6 +373,7 @@
            NyShuttleHttpCommand httpCommand = JSON.parseObject(command.getBody(), NyShuttleHttpCommand.class);
            Map<String, Object> body = httpCommand.getRequest().getBody();
            Object pathObj = body.get("path");
            int taskId = Integer.parseInt(body.get("taskId").toString());
            List<JSONObject> path = JSON.parseArray(JSON.toJSONString(pathObj), JSONObject.class);
            ArrayList<NyShuttleHttpCommand> commandList = new ArrayList<>();
            while (!path.isEmpty()) {
@@ -380,7 +381,12 @@
                if (path.size() > 10) {
                    List<JSONObject> subList = path.subList(0, 10);
                    list.addAll(subList);
                    subList.clear();
                    List<JSONObject> tmp = new ArrayList<>();
                    for (int i = 10; i < path.size(); i++) {
                        tmp.add(path.get(i));
                    }
                    path = tmp;
                }else  {
                    list.addAll(path);
                    path.clear();
@@ -391,6 +397,7 @@
                NyShuttleHttpCommand.NyRequest request = httpCommandCopy.getRequest();
                bodyCopy.put("path", list);
                bodyCopy.put("taskId", taskId++);
                request.setBody(bodyCopy);
                httpCommandCopy.setRequest(request);
@@ -399,9 +406,9 @@
            for (NyShuttleHttpCommand requestCommand : commandList) {
                JSONObject result = requestCommand(requestCommand);
                if (result == null) {
                    return false;//请求失败
                }
//                if (result == null) {
//                    return false;//请求失败
//                }
                this.shuttleProtocol.setSendTime(System.currentTimeMillis());//指令下发时间
            }
            return true;