| | |
| | | // News.error("{}条码错误,暂无拣料任务!", barcode); |
| | | // } |
| | | // } |
| | | |
| | | if ((wrkMast.getIoType() != 103 && wrkMast.getIoType() != 104 && wrkMast.getIoType() != 107) |
| | | || Cools.isEmpty(wrkMast.getStaNo()) || Cools.isEmpty(wrkMast.getSourceStaNo()) ) { |
| | | continue; |
| | |
| | | * 初始化实时地图 |
| | | */ |
| | | public synchronized void initRealtimeBasMap() { |
| | | for (int i = 1; i <= 4; i++) {//总共四层楼 |
| | | for (int i = 1; i <= 10; i++) {//总共四层楼 |
| | | Object data = redisUtil.get("realtimeBasMap_" + i); |
| | | if (data == null) {//redis地图数据为空,从数据库中获取 |
| | | BasMap basMap = basMapService.selectLatestMap(i); |
| | |
| | | if (commands == null) { |
| | | continue;//找不到路径等待下一次 |
| | | } |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | //分配目标库位 |
| | | shuttleProtocol.setLocNo(wrkMast.getLocNo()); |
| | | //目标库位 |
| | |
| | | shuttleProtocol.setLocNo(liftSiteLocNo); |
| | | //目标库位 |
| | | assignCommand.setLocNo(liftSiteLocNo); |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | wrkMast.setWrkSts(5L);//小车迁移状态 |
| | | } |
| | | } else if (wrkMast.getWrkSts() == 8) { |
| | |
| | | ShuttleCommand moveCommand = shuttleThread.getMoveCommand(startCode, distCode, 1600, runDirection, null, null, 500); |
| | | commands.add(0, moveCommand);//将该指令添加到队头 |
| | | |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | //分配目标库位 |
| | | shuttleProtocol.setLocNo(wrkMast.getLocNo()); |
| | | //目标库位 |
| | |
| | | //获取小车移动速度 |
| | | BasShuttle basShuttle = basShuttleService.selectById(assignCommand.getShuttleNo()); |
| | | Integer runSpeed = 1000; |
| | | if (basShuttle != null) { |
| | | Integer runSpeed1 = basShuttle.getRunSpeed(); |
| | | if (runSpeed1 != null) { |
| | | runSpeed = runSpeed1; |
| | | } |
| | | } |
| | | // if (basShuttle != null) { |
| | | // Integer runSpeed1 = basShuttle.getRunSpeed(); |
| | | // if (runSpeed1 != null) { |
| | | // runSpeed = runSpeed1; |
| | | // } |
| | | // } |
| | | |
| | | //计算小车起点到中点所需命令 |
| | | List<NavigateNode> calc = NavigateUtils.calc(startLocNo, locNo, mapType, Utils.getShuttlePoints(shuttleThread.getSlave().getId(), Utils.getLev(startLocNo))); |
| | |
| | | //获取小车移动速度 |
| | | BasShuttle basShuttle = basShuttleService.selectById(assignCommand.getShuttleNo()); |
| | | Integer runSpeed = 1000; |
| | | if (basShuttle != null) { |
| | | Integer runSpeed1 = basShuttle.getRunSpeed(); |
| | | if (runSpeed1 != null) { |
| | | runSpeed = runSpeed1; |
| | | } |
| | | } |
| | | // if (basShuttle != null) { |
| | | // Integer runSpeed1 = basShuttle.getRunSpeed(); |
| | | // if (runSpeed1 != null) { |
| | | // runSpeed = runSpeed1; |
| | | // } |
| | | // } |
| | | |
| | | List<NavigateNode> allNode = new ArrayList<>(); |
| | | |
| | |
| | | shuttleProtocol.setSourceLocNo(currentLocNo); |
| | | //目标库位 |
| | | assignCommand.setLocNo(wrkMast.getSourceLocNo()); |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | wrkMast.setWrkSts(26L);//小车搬运中 |
| | | |
| | | if (wrkMastMapper.updateById(wrkMast) > 0) { |
| | |
| | | |
| | | //目标库位 |
| | | assignCommand.setLocNo(liftSiteLocNo); |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | wrkMast.setWrkSts(22L);//小车迁移状态 |
| | | |
| | | if (wrkMastMapper.updateById(wrkMast) > 0) { |
| | |
| | | shuttleProtocol.setSourceLocNo(liftSiteLocNo); |
| | | //目标库位 |
| | | assignCommand.setLocNo(wrkMast.getSourceLocNo()); |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | wrkMast.setWrkSts(26L);//小车搬运中 |
| | | |
| | | if (wrkMastMapper.updateById(wrkMast) > 0) { |
| | |
| | | |
| | | //所需命令组合完毕,更新数据库,提交到线程去工作 |
| | | LiftAssignCommand assignCommand = new LiftAssignCommand(); |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | assignCommand.setLiftNo(liftProtocol.getLiftNo()); |
| | | assignCommand.setTaskNo(liftProtocol.getTaskNo()); |
| | | if (wrkMastMapper.updateById(wrkMast) > 0) { |
| | |
| | | shuttleProtocol.setLocNo(liftSiteLocNo); |
| | | //目标库位 |
| | | assignCommand.setLocNo(liftSiteLocNo); |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | wrkMast.setWrkSts(5L);//小车迁移状态 |
| | | |
| | | if (wrkMastMapper.updateById(wrkMast) > 0) { |
| | |
| | | //分配源库位 |
| | | shuttleProtocol.setSourceLocNo(wrkMast.getSourceLocNo()); |
| | | |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | //分配目标库位 |
| | | shuttleProtocol.setLocNo(wrkMast.getLocNo()); |
| | | //目标库位 |
| | |
| | | commands.add(command); |
| | | |
| | | //指令集分配 |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | |
| | | wrkCharge.setWrkSts(56L);//充电中状态 |
| | | if (wrkChargeMapper.updateById(wrkCharge) > 0) { |
| | |
| | | assignCommand.setLocNo(chargeLocNo); |
| | | //源库位 |
| | | assignCommand.setSourceLocNo(currentLocNo); |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | wrkCharge.setWrkSts(52L);//小车迁移状态 |
| | | if (wrkChargeMapper.updateById(wrkCharge) > 0) { |
| | | //下发任务 |
| | |
| | | wrkCharge.setWrkSts(54L);//提升机搬运中 |
| | | //所需命令组合完毕,更新数据库,提交到线程去工作 |
| | | LiftAssignCommand assignCommand = new LiftAssignCommand(); |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | assignCommand.setLiftNo(liftProtocol.getLiftNo()); |
| | | assignCommand.setTaskNo(liftProtocol.getTaskNo()); |
| | | if (wrkChargeMapper.updateById(wrkCharge) > 0) { |
| | |
| | | commands.add(command); |
| | | |
| | | //指令集分配 |
| | | assignCommand.setCommands(commands); |
| | | // assignCommand.setCommands(commands); |
| | | |
| | | wrkCharge.setWrkSts(56L);//充电中状态 |
| | | if (wrkChargeMapper.updateById(wrkCharge) > 0) { |