|  |  | 
 |  |  |             if(null == taskWrk) { | 
 |  |  |                 continue; | 
 |  |  |             } | 
 |  |  |             // 获取库位信息 | 
 |  |  |             String locNo = taskWrk.getTargetPoint(); | 
 |  |  |             LocMast locMast = locMastService.selectById(locNo); | 
 |  |  |             if (locMast == null) { | 
 |  |  |                 log.error("查询库存无数据--库位号{}", locNo); | 
 |  |  |                 continue; | 
 |  |  |             } | 
 |  |  |             if (!locMast.getLocSts().equals("S") && !locMast.getLocSts().equals("Q")) { | 
 |  |  |                 log.error("入库操作库位状态不符合--状态, 库位号={},库位状态={}", locNo, locMast.getLocSts()); | 
 |  |  |                 continue; | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             // 堆垛机控制过滤 | 
 |  |  |             if (!crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() != 0) { | 
 |  |  | 
 |  |  |             crnCommand.setSourcePosX(crnStn.getRow().shortValue());     // 源库位排 | 
 |  |  |             crnCommand.setSourcePosY(crnStn.getBay().shortValue());     // 源库位列 | 
 |  |  |             crnCommand.setSourcePosZ(crnStn.getLev().shortValue());     // 源库位层 | 
 |  |  |             crnCommand.setDestinationPosX(locMast.getRow1().shortValue());     // 目标库位排 | 
 |  |  |             crnCommand.setDestinationPosY(locMast.getBay1().shortValue());     // 目标库位列 | 
 |  |  |             crnCommand.setDestinationPosZ(locMast.getLev1().shortValue());     // 目标库位层 | 
 |  |  |             crnCommand.setDestinationPosX(Utils.getRowShort(taskWrk.getTargetPoint()));     // 目标库位排 | 
 |  |  |             crnCommand.setDestinationPosY(Utils.getBayShort(taskWrk.getTargetPoint()));     // 目标库位列 | 
 |  |  |             crnCommand.setDestinationPosZ(Utils.getLevShort(taskWrk.getTargetPoint()));     // 目标库位层 | 
 |  |  |             if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand))) { | 
 |  |  |                 log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); | 
 |  |  |             } else { | 
 |  |  | 
 |  |  |                 // 工作档状态判断 | 
 |  |  |                 if (taskWrk.getIoType() != 2 || taskWrk.getTargetPoint() == null) { | 
 |  |  |                     log.error("查询工作档数据不符合条件--入出类型/站点, 工作号={},源库位={},入出类型={}", taskWrk.getWrkNo(), taskWrk.getTargetPoint(), taskWrk.getIoType()); | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 // 获取源库位信息 | 
 |  |  |                 String locNo = taskWrk.getStartPoint(); | 
 |  |  |                 LocMast sourceSta = locMastService.selectById(locNo); | 
 |  |  |                 if (!sourceSta.getLocSts().equals("R") &&!sourceSta.getLocSts().equals("P")) { | 
 |  |  |                     log.error("出库操作库位状态不符合--状态, 库位号={},库位状态={}", locNo, sourceSta.getLocSts()); | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 // 获取堆垛机出库站信息 | 
 |  |  | 
 |  |  |                     crnCommand.setTaskNo(taskWrk.getWrkNo().shortValue()); // 工作号 | 
 |  |  |                     crnCommand.setAckFinish((short) 0);  // 任务完成确认位 | 
 |  |  |                     crnCommand.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式:  库位移转 | 
 |  |  |                     crnCommand.setSourcePosX(sourceSta.getRow1().shortValue());     // 源库位排 | 
 |  |  |                     crnCommand.setSourcePosY(sourceSta.getBay1().shortValue());     // 源库位列 | 
 |  |  |                     crnCommand.setSourcePosZ(sourceSta.getLev1().shortValue());     // 源库位层 | 
 |  |  |                     crnCommand.setSourcePosX(Utils.getRowShort(taskWrk.getStartPoint()));     // 源库位排 | 
 |  |  |                     crnCommand.setSourcePosY(Utils.getBayShort(taskWrk.getStartPoint()));     // 源库位列 | 
 |  |  |                     crnCommand.setSourcePosZ(Utils.getLevShort(taskWrk.getStartPoint()));     // 源库位层 | 
 |  |  |                     crnCommand.setDestinationPosX(crnStn.getRow().shortValue());     // 目标库位排 | 
 |  |  |                     crnCommand.setDestinationPosY(crnStn.getBay().shortValue());     // 目标库位列 | 
 |  |  |                     crnCommand.setDestinationPosZ(crnStn.getLev().shortValue());     // 目标库位层 |