| | |
| | | } |
| | | // 状态:等待确认 并且 任务完成位 = 1 |
| | | if (crnProtocol.statusType == CrnStatusType.WAITING && crnProtocol.getTaskNo() != 0) { |
| | | if (crnProtocol.getTaskNo() == 32222) { |
| | | if (crnProtocol.getTaskNo() == 32222 || crnProtocol.getTaskNo() == 999) { |
| | | // 堆垛机复位 |
| | | crnThread.setResetFlag(true); |
| | | } else { |
| | |
| | | if (!wrkMasts.isEmpty()) { |
| | | continue; |
| | | } |
| | | List<TaskWrkLog> taskWrkLogs = taskWrkLogService.selectList(new EntityWrapper<TaskWrkLog>().eq("CRN_NO",crnProtocol.getCrnNo()).orderBy("COMPLETE_TIME",false)); |
| | | if (!taskWrkLogs.isEmpty()) { |
| | | List<WrkMast> WrkMastLogList = wrkMastMapper.selectByCrnNoLog(crnProtocol.getCrnNo()); |
| | | if (!WrkMastLogList.isEmpty()) { |
| | | boolean signT = false; |
| | | for (TaskWrkLog taskWrkLog : taskWrkLogs){ |
| | | Date completeTime = taskWrkLog.getCompleteTime(); |
| | | for (WrkMast wrkMast : WrkMastLogList){ |
| | | Date completeTime = wrkMast.getIoTime(); |
| | | if (completeTime==null){ |
| | | continue; |
| | | } |
| | |
| | | crnCommand.setCrnNo(crnProtocol.getCrnNo()); // 堆垛机编号 |
| | | crnCommand.setTaskNo((short)999); // 工作号 |
| | | crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand.setTaskMode(CrnTaskModeType.X_MOVE); // 任务模式: 站位移转4 |
| | | crnCommand.setSourcePosX((short) 1); // 源库位排 |
| | | crnCommand.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 任务模式: 站位移转4 |
| | | Integer crnNo = crnProtocol.getCrnNo(); |
| | | int row1 = crnNo * 4-1; |
| | | if (crnNo>2){ |
| | | row1 = row1-2; |
| | | } |
| | | crnCommand.setSourcePosX((short) row1); // 源库位排 |
| | | crnCommand.setSourcePosY((short) 1); // 源库位列 |
| | | crnCommand.setSourcePosZ((short) 1); // 源库位层 |
| | | crnCommand.setDestinationPosX((short) 1); // 目标库位排 |
| | | crnCommand.setDestinationPosX((short) row1); // 目标库位排 |
| | | crnCommand.setDestinationPosY((short) 1); // 目标库位层 |
| | | crnCommand.setDestinationPosZ((short) 1); // 目标库位列 |
| | | if (!MessageQueue.offer(SlaveType.Crn, crnProtocol.getCrnNo(), new Task(2, crnCommand))) { |