| | |
| | | wrkMast.setCrnNo(crnNo); |
| | | wrkMast.setSystemMsg(""); |
| | | wrkMast.setIoTime(new Date()); |
| | | //给库位白色指示灯亮灯 |
| | | String[] split = basCrnp.getArr().split(","); |
| | | int i = Arrays.asList(split).indexOf(wrkMast.getLocNo()); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | if (i>-1){ |
| | | command.setLocNo(wrkMast.getLocNo()); |
| | | command.setIndex(i); |
| | | command.setValue((short)1); |
| | | } |
| | | MessageQueue.offer(SlaveType.Crn, crnNo, new Task(2, command)); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Crn), crnNo, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_IN_TASK_RUN, null); |
| | | News.info("堆垛机命令下发成功,堆垛机号={},任务数据={}", crnNo, JSON.toJSON(command)); |
| | |
| | | wrkMast.setCrnNo(crnNo); |
| | | wrkMast.setSystemMsg(""); |
| | | wrkMast.setIoTime(new Date()); |
| | | //给库位白色指示灯亮灯 |
| | | String[] split = basCrnp.getArr().split(","); |
| | | int i = Arrays.asList(split).indexOf(wrkMast.getSourceLocNo()); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | if (i>-1){ |
| | | command.setLocNo(wrkMast.getSourceLocNo()); |
| | | command.setIndex(i); |
| | | command.setValue((short)1); |
| | | } |
| | | MessageQueue.offer(SlaveType.Crn, crnNo, new Task(2, command)); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Crn), crnNo, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_OUT_TASK_RUN, null); |
| | | News.info("堆垛机命令下发成功,堆垛机号={},任务数据={}", crnNo, JSON.toJSON(command)); |
| | |
| | | wrkMast.setCrnNo(crnNo); |
| | | wrkMast.setSystemMsg(""); |
| | | wrkMast.setIoTime(new Date()); |
| | | //给库位白色指示灯亮灯 |
| | | String[] split = basCrnp.getArr().split(","); |
| | | int i = Arrays.asList(split).indexOf(wrkMast.getLocNo()); |
| | | String locNo = wrkMast.getLocNo(); |
| | | if (i == -1) { |
| | | i = Arrays.asList(split).indexOf(wrkMast.getSourceLocNo()); |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | } |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | if (i>-1){ |
| | | command.setLocNo(locNo); |
| | | command.setIndex(i); |
| | | command.setValue((short)1); |
| | | } |
| | | MessageQueue.offer(SlaveType.Crn, crnNo, new Task(2, command)); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Crn), crnNo, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_TRANSFER_TASK_RUN, null); |
| | | News.info("堆垛机命令下发成功,堆垛机号={},任务数据={}", crnNo, JSON.toJSON(command)); |
| | |
| | | News.error("堆垛机处于等待确认且任务完成状态,但未找到工作档。堆垛机号={},工作号={}", basCrnp.getCrnNo(), crnProtocol.getTaskNo()); |
| | | continue; |
| | | } |
| | | //给库位白色指示灯亮灯 |
| | | String[] split = basCrnp.getArr().split(","); |
| | | int i = -1; |
| | | String locNo = ""; |
| | | Long updateWrkSts = null; |
| | | if(wrkMast.getWrkSts() == WrkStsType.INBOUND_RUN.sts){ |
| | | updateWrkSts = WrkStsType.COMPLETE_INBOUND.sts; |
| | | i = Arrays.asList(split).indexOf(wrkMast.getLocNo()); |
| | | locNo = wrkMast.getLocNo(); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Crn), crnProtocol.getCrnNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_IN_TASK_COMPLETE, null); |
| | | }else if(wrkMast.getWrkSts() == WrkStsType.OUTBOUND_RUN.sts){ |
| | | updateWrkSts = WrkStsType.OUTBOUND_RUN_COMPLETE.sts; |
| | | i = Arrays.asList(split).indexOf(wrkMast.getSourceLocNo()); |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Crn), crnProtocol.getCrnNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_OUT_TASK_COMPLETE, null); |
| | | }else if(wrkMast.getWrkSts() == WrkStsType.LOC_MOVE_RUN.sts){ |
| | | updateWrkSts = WrkStsType.COMPLETE_LOC_MOVE.sts; |
| | | i = Arrays.asList(split).indexOf(wrkMast.getLocNo()); |
| | | locNo = wrkMast.getLocNo(); |
| | | if(i==-1){ |
| | | i = Arrays.asList(split).indexOf(wrkMast.getSourceLocNo()); |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | } |
| | | notifyUtils.notify(String.valueOf(SlaveType.Crn), crnProtocol.getCrnNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.CRN_TRANSFER_TASK_COMPLETE, null); |
| | | }else{ |
| | | News.error("堆垛机处于等待确认且任务完成状态,但工作状态异常。堆垛机号={},工作号={}", basCrnp.getCrnNo(), crnProtocol.getTaskNo()); |
| | |
| | | wrkMast.setWrkSts(updateWrkSts); |
| | | wrkMast.setSystemMsg(""); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWeight(crnProtocol.getWeight()); |
| | | if (wrkMastService.updateById(wrkMast)) { |
| | | CrnCommand resetCommand = crnThread.getResetCommand(crnProtocol.getCrnNo()); |
| | | if (i>-1){ |
| | | resetCommand.setLocNo(locNo); |
| | | resetCommand.setIndex(i); |
| | | resetCommand.setValue((short)0); |
| | | } |
| | | MessageQueue.offer(SlaveType.Crn, crnProtocol.getCrnNo(), new Task(3, resetCommand)); |
| | | News.info("堆垛机任务状态更新成功,堆垛机号={},工作号={}", basCrnp.getCrnNo(), crnProtocol.getTaskNo()); |
| | | } |