| | |
| | | if (steProtocol.getStatusType().equals(SteStatusType.IDLE)) { |
| | | // 堆垛机空闲 |
| | | if (crnProtocol.getStatusType().equals(CrnStatusType.IDLE) || crnProtocol.getTaskNo() == 0) { |
| | | |
| | | BasSte basSte = basSteService.selectById(steNo); |
| | | if (basSte == null) { |
| | | log.error("{}号穿梭车在数据库不存在!!!", steNo); |
| | | return; |
| | | } |
| | | String idleLocNo = basSte.getIdleLoc(); |
| | | |
| | | // 堆垛机命令下发区 -------------------------------------------------------------------------- |
| | | CrnCommand crnCommand = new CrnCommand(); |
| | | crnCommand.setCrnNo(crnProtocol.getCrnNo()); // 堆垛机编号 |
| | |
| | | crnCommand.setSourcePosX(steProtocol.getRow()); // 源库位排 |
| | | crnCommand.setSourcePosY(steProtocol.getBay()); // 源库位列 |
| | | crnCommand.setSourcePosZ(steProtocol.getLev()); // 源库位层 |
| | | crnCommand.setDestinationPosX(locMast.getRow1().shortValue()); // 目标库位排 |
| | | crnCommand.setDestinationPosY(locMast.getBay1().shortValue()); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(locMast.getLev1().shortValue()); // 目标库位层 |
| | | crnCommand.setDestinationPosX((short) Utils.getRow(idleLocNo)); // 目标库位排 |
| | | crnCommand.setDestinationPosY((short) Utils.getBay(idleLocNo)); // 目标库位列 |
| | | crnCommand.setDestinationPosZ((short) Utils.getLev(idleLocNo)); // 目标库位层 |
| | | if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { |
| | | log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } else { |