|  |  | 
 |  |  |                             } | 
 |  |  |                             return true; | 
 |  |  |                         } | 
 |  |  |                         // 不是最外层库位,需要使用穿梭车搬运后,再堆垛机出库 | 
 |  |  |                     // 不是最外层库位,需要使用穿梭车搬运后,再堆垛机出库 | 
 |  |  |                     } else { | 
 |  |  |                         // 当前组库位是否有穿梭车 | 
 |  |  |                         Integer steNo = this.hasCarOfIdle(wrkMast.getSourceLocNo()); | 
 |  |  | 
 |  |  |                                     steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号 | 
 |  |  |                                     steCommand.setTaskMode(SteTaskModeType.findOutByLoc(wrkMast.getSourceLocNo())); // 任务模式:  去近点 等待堆垛机叉取 | 
 |  |  |  | 
 |  |  |                                     steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue()); | 
 |  |  |                                     steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue(), false).shortValue()); | 
 |  |  |                                     steCommand.setBay(steProtocol.getBay()); | 
 |  |  |                                     steCommand.setLev(steProtocol.getLev()); | 
 |  |  |  | 
 |  |  | 
 |  |  |                                 crnCommand.setTaskNo(wrkMast.getWrkNo().shortValue()); // 工作号 | 
 |  |  |                                 crnCommand.setAckFinish((short) 0);  // 任务完成确认位 | 
 |  |  |                                 crnCommand.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式:  库位移转 | 
 |  |  |                                 crnCommand.setSourcePosX(Utils.getGroupRow(sourceSta.getRow1()).shortValue());     // 源库位排 | 
 |  |  |                                 crnCommand.setSourcePosX(Utils.getGroupRow(sourceSta.getRow1(), false).shortValue());     // 源库位排 | 
 |  |  |                                 crnCommand.setSourcePosY(sourceSta.getBay1().shortValue());     // 源库位列 | 
 |  |  |                                 crnCommand.setSourcePosZ(sourceSta.getLev1().shortValue());     // 源库位层 | 
 |  |  |                                 crnCommand.setDestinationPosX(crnStn.getRow().shortValue());     // 目标库位排 | 
 |  |  | 
 |  |  |                                 } | 
 |  |  |                             } | 
 |  |  |  | 
 |  |  |                             // 没有小车 | 
 |  |  |                         // 没有小车 | 
 |  |  |                         } else { | 
 |  |  |                             if (wrkMast.getWrkSts() == 11L && wrkMast.getSteNo() == null) { | 
 |  |  |                                 // 寻找最近的小车 | 
 |  |  | 
 |  |  |             steCommand.setTaskNo(wrkMast.getWrkNo()); // 工作号 | 
 |  |  |             steCommand.setTaskMode(SteTaskModeType.findOriginByLoc(steProtocol)); // 任务模式:  去近点 等待堆垛机叉取 | 
 |  |  |  | 
 |  |  |             steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue()); | 
 |  |  |             steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue(), true).shortValue()); | 
 |  |  |             steCommand.setBay(steProtocol.getBay()); | 
 |  |  |             steCommand.setLev(steProtocol.getLev()); | 
 |  |  |  | 
 |  |  | 
 |  |  |                     crnCommand.setTaskNo(wrkMast.getWrkNo().shortValue()); // 工作号 | 
 |  |  |                     crnCommand.setAckFinish((short) 0);  // 任务完成确认位 | 
 |  |  |                     crnCommand.setTaskMode(CrnTaskModeType.STE_MOVE); // 任务模式:  库位移转 | 
 |  |  |                     crnCommand.setSourcePosX(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue());     // 源库位排 | 
 |  |  |                     crnCommand.setSourcePosX(Utils.getGroupRow(steProtocol.getRow().intValue(), true).shortValue());     // 源库位排 | 
 |  |  |                     crnCommand.setSourcePosY(steProtocol.getBay());     // 源库位列 | 
 |  |  |                     crnCommand.setSourcePosZ(steProtocol.getLev());     // 源库位层 | 
 |  |  |                     crnCommand.setDestinationPosX(Utils.getGroupRow(locMast.getLocNo()).shortValue());     // 目标库位排 | 
 |  |  |                     crnCommand.setDestinationPosX(Utils.getGroupRow(locMast.getLocNo(), true).shortValue());     // 目标库位排 | 
 |  |  |                     crnCommand.setDestinationPosY(locMast.getBay1().shortValue());     // 目标库位列 | 
 |  |  |                     crnCommand.setDestinationPosZ(locMast.getLev1().shortValue());     // 目标库位层 | 
 |  |  |                     if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { | 
 |  |  |                         log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); | 
 |  |  |                     } else { | 
 |  |  |                         // 修改穿梭车运行中排列层 | 
 |  |  |                         steThread.modifyPos(Utils.getGroupRow(locMast.getLocNo()), locMast.getBay1(), locMast.getLev1()); | 
 |  |  |                         steThread.modifyPos(Utils.getGroupRow(locMast.getLocNo(), true), locMast.getBay1(), locMast.getLev1()); | 
 |  |  |                         // 修改工作档状态 3.小车待搬 => 4.迁入小车 | 
 |  |  |                         Date now = new Date(); | 
 |  |  |                         wrkMast.setWrkSts(4L); | 
 |  |  | 
 |  |  |                     crnCommand.setTaskNo(wrkMast.getWrkNo().shortValue()); // 工作号 | 
 |  |  |                     crnCommand.setAckFinish((short) 0);  // 任务完成确认位 | 
 |  |  |                     crnCommand.setTaskMode(CrnTaskModeType.STE_MOVE); // 任务模式:  库位移转 | 
 |  |  |                     crnCommand.setSourcePosX(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue());     // 源库位排 | 
 |  |  |                     crnCommand.setSourcePosX(Utils.getGroupRow(steProtocol.getRow().intValue(), true).shortValue());     // 源库位排 | 
 |  |  |                     crnCommand.setSourcePosY(steProtocol.getBay());     // 源库位列 | 
 |  |  |                     crnCommand.setSourcePosZ(steProtocol.getLev());     // 源库位层 | 
 |  |  |                     crnCommand.setDestinationPosX(Utils.getGroupRow(locMast.getLocNo()).shortValue());     // 目标库位排 | 
 |  |  |                     crnCommand.setDestinationPosX(Utils.getGroupRow(locMast.getLocNo(), true).shortValue());     // 目标库位排 | 
 |  |  |                     crnCommand.setDestinationPosY(locMast.getBay1().shortValue());     // 目标库位列 | 
 |  |  |                     crnCommand.setDestinationPosZ(locMast.getLev1().shortValue());     // 目标库位层 | 
 |  |  |                     if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { | 
 |  |  |                         log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); | 
 |  |  |                     } else { | 
 |  |  |                         // 修改穿梭车运行中排列层 | 
 |  |  |                         steThread.modifyPos(Utils.getGroupRow(locMast.getLocNo()), locMast.getBay1(), locMast.getLev1()); | 
 |  |  |                         steThread.modifyPos(Utils.getGroupRow(locMast.getLocNo(), true), locMast.getBay1(), locMast.getLev1()); | 
 |  |  |                         // 修改工作档状态 12.小车待搬 => 13.迁入小车 | 
 |  |  |                         Date now = new Date(); | 
 |  |  |                         wrkMast.setWrkSts(13L); | 
 |  |  | 
 |  |  |                 crnCommand.setTaskNo(wrkMast.getWrkNo().shortValue()); // 工作号 | 
 |  |  |                 crnCommand.setAckFinish((short) 0);  // 任务完成确认位 | 
 |  |  |                 crnCommand.setTaskMode(CrnTaskModeType.STE_MOVE); // 任务模式:  库位移转 | 
 |  |  |                 crnCommand.setSourcePosX(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue());     // 源库位排 | 
 |  |  |                 crnCommand.setSourcePosX(Utils.getGroupRow(steProtocol.getRow().intValue(), true).shortValue());     // 源库位排 | 
 |  |  |                 crnCommand.setSourcePosY(steProtocol.getBay());     // 源库位列 | 
 |  |  |                 crnCommand.setSourcePosZ(steProtocol.getLev());     // 源库位层 | 
 |  |  |                 crnCommand.setDestinationPosX(Utils.getGroupRow(idleLocNo).shortValue());     // 目标库位排 | 
 |  |  |                 crnCommand.setDestinationPosX(Utils.getGroupRow(idleLocNo, true).shortValue());     // 目标库位排 | 
 |  |  |                 crnCommand.setDestinationPosY((short) Utils.getBay(idleLocNo));     // 目标库位列 | 
 |  |  |                 crnCommand.setDestinationPosZ((short) Utils.getLev(idleLocNo));     // 目标库位层 | 
 |  |  |                 if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { | 
 |  |  |                     log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); | 
 |  |  |                 } else { | 
 |  |  |                     // 修改穿梭车运行中排列层 | 
 |  |  |                     steThread.modifyPos(Utils.getGroupRow(idleLocNo), Utils.getBay(idleLocNo), Utils.getLev(idleLocNo)); | 
 |  |  |                     steThread.modifyPos(Utils.getGroupRow(idleLocNo, true), Utils.getBay(idleLocNo), Utils.getLev(idleLocNo)); | 
 |  |  |                     // 修改工作档状态 3.小车待搬 => 5.迁出小车 | 
 |  |  |                     Date now = new Date(); | 
 |  |  |                     wrkMast.setWrkSts(5L); |