| | |
| | | } |
| | | News.warnNoLog(""+mark+" - 3"+" - 0"+" - 堆垛机入出库作业下发:执行库位移转"); |
| | | // 获取源库位信息 |
| | | LocMast sourceSta = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (null == sourceSta) { |
| | | LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (null == sourceLoc) { |
| | | News.error(""+mark+" - 3"+" - 1"+" - 工作档库位移转失败,原因:检索源库位失败!工作号={},源库位={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); |
| | | return; |
| | | } |
| | | // 源库位 库位状态判断 |
| | | if (!sourceSta.getLocSts().equals("R") && !sourceSta.getLocSts().equals("S")) { |
| | | if (!sourceLoc.getLocSts().equals("R")) { |
| | | News.error(""+mark+" - 3"+" - 11"+" - 工作档库位移转失败,原因:源库位状态不为R!工作号={},源库位={}", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); |
| | | return; |
| | | } |
| | | |
| | | if(wrkMast.getIoType() != 111) { |
| | | // 获取目标库位信息 |
| | | LocMast sta = locMastService.selectById(wrkMast.getLocNo()); |
| | | if (null == sta) { |
| | | LocMast loc = locMastService.selectById(wrkMast.getLocNo()); |
| | | if (null == loc) { |
| | | News.error(""+mark+" - 3"+" - 2"+" - 工作档库位移转失败,原因:检索目标库位失败!工作号={},源库位={}", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | return; |
| | | } |
| | | // 源库位 库位状态判断 |
| | | if (!loc.getLocSts().equals("S")) { |
| | | News.error(""+mark+" - 3"+" - 21"+" - 工作档库位移转失败,原因:目标库位状态不为R!工作号={},源库位={}", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | return; |
| | | } |
| | | } |
| | | // 获取堆垛机信息 并 判断是否可入出 |
| | | BasCrnp basCrnp = basCrnpService.selectById(slave.getId()); |
| | |
| | | } |
| | | |
| | | News.warnNoLog(""+mark+" - 3"+" - 3"+" - 命令下发 : 工作号={},源排={},源列={},源层={},目标排={},目标列={},目标层={}",wrkMast.getWrkNo().shortValue() |
| | | ,sourceSta.getRow1().shortValue(),sourceSta.getBay1().shortValue(),sourceSta.getLev1().shortValue() |
| | | ,sta.getRow1().shortValue(),sta.getBay1().shortValue(),sta.getLev1().shortValue()); |
| | | ,sourceLoc.getRow1().shortValue(),sourceLoc.getBay1().shortValue(),sourceLoc.getLev1().shortValue() |
| | | ,sourceLoc.getRow1().shortValue(),sourceLoc.getBay1().shortValue(),sourceLoc.getLev1().shortValue()); |
| | | |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | |
| | | crnCommand.setTaskNo(wrkMast.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.setDestinationPosX(sta.getRow1().shortValue()); // 目标库位排 |
| | | crnCommand.setDestinationPosY(sta.getBay1().shortValue()); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(sta.getLev1().shortValue()); // 目标库位层 |
| | | crnCommand.setSourcePosX(sourceLoc.getRow1().shortValue()); // 源库位排 |
| | | crnCommand.setSourcePosY(sourceLoc.getBay1().shortValue()); // 源库位列 |
| | | crnCommand.setSourcePosZ(sourceLoc.getLev1().shortValue()); // 源库位层 |
| | | crnCommand.setDestinationPosX(sourceLoc.getRow1().shortValue()); // 目标库位排 |
| | | crnCommand.setDestinationPosY(sourceLoc.getBay1().shortValue()); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(sourceLoc.getLev1().shortValue()); // 目标库位层 |
| | | if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { |
| | | News.error(""+mark+" - 3"+" - 4"+" - 堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } else { |