#
zjj
昨天 966626cb396cdd881e4f7684078bbf6dbdabe34f
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -364,7 +364,7 @@
//                                CommandPackage commandPackage = JSON.parseObject(commandInfo.getCommand(), CommandPackage.class);//取出命令报文
//                                CrnCommand crnCommand = JSON.parseObject(commandPackage.getCommand().toString(), CrnCommand.class);
                                    Integer commandStep = taskWrk.getCommandStep();
                                    CommandInfo commandInfo = commandInfos.get(commandStep);
                                    CommandInfo commandInfo = commandInfos.get(1);
                                    CommandPackage commandPackage = JSON.parseObject(commandInfo.getCommand(), CommandPackage.class);//取出命令报文
                                    //StaProtocol staProtocol1 = JSON.parseObject(commandInfo.getCommand(), StaProtocol.class);
                                    StaProtocol staProtocol1 = JSON.parseObject(commandPackage.getCommand().toString(), StaProtocol.class);
@@ -511,22 +511,27 @@
                if (commandInfos.isEmpty()) {
                    continue;//命令空
                }
                CommandInfo commandInfo = commandInfos.get(commandStep);
                CommandInfo commandInfo = commandInfos.get(0);
                CommandPackage commandPackage = JSON.parseObject(commandInfo.getCommand(), CommandPackage.class);//取出命令报文
                CrnCommand crnCommand = JSON.parseObject(commandPackage.getCommand().toString(), CrnCommand.class);
                if (!MessageQueue.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand))) {
                    log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand));
                } else {
                    //开始运行
                    String response = CrnStartRunning(taskWrk);
                    JSONObject jsonObject = JSON.parseObject(response);
                    if (jsonObject.getInteger("code").equals(200)) {
                    try {
                        //开始运行
                        String response = CrnStartRunning(taskWrk);
                        JSONObject jsonObject = JSON.parseObject(response);
                        if (jsonObject.getInteger("code").equals(200)) {
                    }else {
                        log.error("入库开始运行通讯失败,"+jsonObject.get("msg"));
                        }else {
                            log.error("入库开始运行wms报错,"+jsonObject.get("msg"));
                        }
                    }catch (Exception e) {
                        log.error("入库开始运行wms报错");
                    }
                }
//                // 命令下发区 --------------------------------------------------------------------------
@@ -676,7 +681,7 @@
                            continue;//指令已执行
                        }
                        CommandInfo commandInfo = commandInfos.get(commandStep);
                        CommandInfo commandInfo = commandInfos.get(0);
                        CommandPackage commandPackage = JSON.parseObject(commandInfo.getCommand(), CommandPackage.class);//取出命令报文
                        CrnCommand crnCommand = JSON.parseObject(commandPackage.getCommand().toString(), CrnCommand.class);
@@ -693,15 +698,20 @@
                            }else {
                                log.error("修改工作档状态 11.生成出库ID => 12.吊车出库中!!,工作号={}", taskWrk.getWrkNo());
                            }
                            //开始运行
                            String response = CrnStartRunning(taskWrk);
                            JSONObject jsonObject = JSON.parseObject(response);
                            if (jsonObject.getInteger("code").equals(200)) {
                            try {
                                //开始运行
                                String response = CrnStartRunning(taskWrk);
                                JSONObject jsonObject = JSON.parseObject(response);
                                if (jsonObject.getInteger("code").equals(200)) {
                            }else {
                                log.error("出库开始运行通讯失败,"+jsonObject.get("msg"));
                                }else {
                                    log.error("出库开始运行wms失败,"+jsonObject.get("msg"));
                                }
                            }catch (Exception e){
                                log.error("出库开始运行wms失败,");
                            }
                        }
                    }