| | |
| | | return; |
| | | } |
| | | |
| | | //判断x轴货位是否放满 |
| | | boolean flag = true; |
| | | for (Loc loc : locService.list(new LambdaQueryWrapper<Loc>() |
| | | .eq(Loc::getHostId, device.getHostId()) |
| | | .eq(Loc::getRow, xCurrent) |
| | | .ge(Loc::getBay, shuttleProtocol.getYStart()) |
| | | .le(Loc::getBay, shuttleProtocol.getYTarget()))) { |
| | | if (loc.getLocSts() != LocStsType.F.val()) { |
| | | flag = false;//未满 |
| | | break; |
| | | } |
| | | } |
| | | if (flag) { |
| | | shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1); |
| | | return; |
| | | } |
| | | |
| | | //搜索有货库位 |
| | | List<Loc> list = locService.list(new LambdaQueryWrapper<Loc>() |
| | | .eq(Loc::getLocSts, LocStsType.F.val()) |
| | | .eq(Loc::getHostId, device.getHostId()) |
| | | .notIn(Loc::getRow, xCurrent) |
| | | .eq(Loc::getStatus, 1)); |
| | | if (list.isEmpty()) { |
| | | return; |
| | |
| | | |
| | | Loc start = list.get(0); |
| | | |
| | | Integer yCurrent = shuttleProtocol.getYCurrent(); |
| | | String locNo = Utils.getLocNo(xCurrent, yCurrent, lev); |
| | | Loc target = locService.getOne(new LambdaQueryWrapper<Loc>() |
| | | .eq(Loc::getLocNo, locNo) |
| | | List<Loc> locList = locService.list(new LambdaQueryWrapper<Loc>() |
| | | .eq(Loc::getHostId, device.getHostId()) |
| | | .eq(Loc::getStatus, 1)); |
| | | if (target == null) { |
| | | shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1); |
| | | .eq(Loc::getStatus, 1) |
| | | .eq(Loc::getLocSts, LocStsType.O.val()) |
| | | .eq(Loc::getRow, xCurrent) |
| | | .orderByDesc(Loc::getBay) |
| | | .orderByAsc(Loc::getRow)); |
| | | if (locList.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | if (target.getLocSts() != LocStsType.O.val()) { |
| | | shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1); |
| | | Loc target = locList.get(0); |
| | | if (target == null) { |
| | | return; |
| | | } |
| | | |
| | | //调度去目标位置 |
| | | if (shuttleProtocol.getCurrentLocNo().equals(target.getLocNo())) { |
| | | shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1);//小车和目标位置一致,跳过 |
| | | } else { |
| | | if (!shuttleProtocol.getCurrentLocNo().equals(target.getLocNo())) { |
| | | Task task = shuttleDispatcher.generateManuaTakeMoveTask(device, start.getLocNo(), target.getLocNo()); |
| | | if(task != null) {//调度成功 |
| | | shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1); |
| | | } |
| | | // if(task != null) {//调度成功 |
| | | // shuttleProtocol.setXCurrent(shuttleProtocol.getXCurrent() + 1); |
| | | // } |
| | | } |
| | | } |
| | | } |