| | |
| | | import com.zy.asrs.mapper.WaitPakinMapper; |
| | | import com.zy.asrs.mapper.WrkMastMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.CommandUtils; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.model.LocTypeDto; |
| | |
| | | staProtocol.setWorkNo(dto.getWorkNo().shortValue()); |
| | | staProtocol.setStaNo(dto.getStaNo().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | boolean result = CommandUtils.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(wrkMast.getStaNo().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | boolean result = CommandUtils.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | log.error("发布命令至输送线队列失败!!! [plc编号:{}]", devp.getId()); |
| | | } |
| | |
| | | // 下发站点信息 |
| | | staProtocol.setWorkNo(wrkMast.getWrkNo().shortValue()); |
| | | staProtocol.setStaNo(wrkMast.getStaNo().shortValue()); |
| | | if (!MessageQueue.offer(SlaveType.Devp, crnStn.getDevpPlcId(), new Task(2, staProtocol))) { |
| | | if (!CommandUtils.offer(SlaveType.Devp, crnStn.getDevpPlcId(), new Task(2, staProtocol))) { |
| | | continue; |
| | | } |
| | | |
| | |
| | | crnCommand.setDestinationPosX(locMast.getRow1().shortValue()); // 目标库位排 |
| | | crnCommand.setDestinationPosY(locMast.getBay1().shortValue()); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(locMast.getLev1().shortValue()); // 目标库位层 |
| | | if (!MessageQueue.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand))) { |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand))) { |
| | | log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } else { |
| | | // 修改工作档状态 2.设备上走 => 3.吊车入库中 |
| | |
| | | crnCommand.setDestinationPosX(crnStn.getRow().shortValue()); // 目标库位排 |
| | | crnCommand.setDestinationPosY(crnStn.getBay().shortValue()); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(crnStn.getLev().shortValue()); // 目标库位层 |
| | | if (!MessageQueue.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand))) { |
| | | if (!CommandUtils.offer(SlaveType.Crn, taskWrk.getCrnNo(), new Task(2, crnCommand))) { |
| | | log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", taskWrk.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } else { |
| | | // 修改工作档状态 11.生成出库ID => 12.吊车出库中 |
| | |
| | | crnCommand.setDestinationPosX(sta.getRow1().shortValue()); // 目标库位排 |
| | | crnCommand.setDestinationPosY(sta.getBay1().shortValue()); // 目标库位列 |
| | | crnCommand.setDestinationPosZ(sta.getLev1().shortValue()); // 目标库位层 |
| | | if (!MessageQueue.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { |
| | | if (!CommandUtils.offer(SlaveType.Crn, wrkMast.getCrnNo(), new Task(2, crnCommand))) { |
| | | log.error("堆垛机命令下发失败,堆垛机号={},任务数据={}", wrkMast.getCrnNo(), JSON.toJSON(crnCommand)); |
| | | } else { |
| | | // 修改工作档状态 11.生成出库ID => 12.吊车出库中 |
| | |
| | | staProtocol.setWorkNo(dto.getWorkNo().shortValue()); |
| | | staProtocol.setStaNo(dto.getStaNo().shortValue()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | boolean result = CommandUtils.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (!result) { |
| | | throw new CoolException("更新plc站点信息失败"); |
| | | } |
| | |
| | | } |
| | | // 命令下发 ------------------------------------------------------------------------------- |
| | | if (!commands.isEmpty()) { |
| | | if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(1, commands))) { |
| | | if (!CommandUtils.offer(SlaveType.Led, led.getId(), new Task(1, commands))) { |
| | | log.error("{}号LED命令下发失败!!![ip:{}] [port:{}]", led.getId(), led.getIp(), led.getPort()); |
| | | continue; |
| | | } else { |