| | |
| | | } |
| | | // 没有小车 |
| | | } else { |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (wrkMastMapper.selectWorking(slave.getId()) != null) { |
| | | continue; |
| | | } |
| | | |
| | | // 堆垛机入库 命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(slave.getId()); // 堆垛机编号 |
| | |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { continue; } |
| | | if (steProtocol.getStatusType().equals(SteStatusType.IDLE)) { |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (wrkMastMapper.selectWorking(slave.getId()) != null) { |
| | | continue; |
| | | } |
| | | // 堆垛机入库 命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(slave.getId()); // 堆垛机编号 |
| | |
| | | if (wrkMast.getWrkSts() == 3L) { |
| | | this.carMoveIn(wrkMast, wrkMast.getSteNo(), crnProtocol); |
| | | } |
| | | // 堆垛机搬运货物 |
| | | if (wrkMast.getWrkSts() == 6L) { |
| | | // 堆垛机入库 命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(slave.getId()); // 堆垛机编号 |
| | | crnCommand.setTaskNo(wrkMast.getWrkNo().shortValue()); // 工作号 |
| | | crnCommand.setAckFinish((short) 0); // 任务完成确认位 |
| | | crnCommand.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式: 库位移转 |
| | | crnCommand.setSourcePosX(crnStn.getRow().shortValue()); // 源库位排 |
| | | crnCommand.setSourcePosY(crnStn.getBay().shortValue()); // 源库位列 |
| | | crnCommand.setSourcePosZ(crnStn.getLev().shortValue()); // 源库位层 |
| | | crnCommand.setDestinationPosX(Utils.getGroupRow(locMast.getLocNo()).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 { |
| | | // 修改工作档状态 6.小车待入 ===>> 7.吊车入库中 |
| | | Date now = new Date(); |
| | | wrkMast.setWrkSts(7L); |
| | | wrkMast.setCrnStrTime(now); |
| | | wrkMast.setModiTime(now); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | log.error("修改工作档状态 6.小车待入 => 7.吊车入库中 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | // 已经存在吊车执行任务时,则过滤 |
| | | if (wrkMastMapper.selectWorking(slave.getId()) != null) { |
| | | continue; |
| | | } |
| | | |
| | | |
| | | } |
| | | return false; |