| | |
| | | return true;//有任务绑定 |
| | | } |
| | | |
| | | /** |
| | | * 获取距离目标库位最近的提升机 |
| | | */ |
| | | public static Device getRecentTransferLift(String locNo, Integer shuttleNo) { |
| | | BasLiftService basLiftService = SpringUtils.getBean(BasLiftService.class); |
| | | DeviceService deviceService = SpringUtils.getBean(DeviceService.class); |
| | | if (basLiftService == null) { |
| | | return null; |
| | | } |
| | | |
| | | Integer distance = Integer.MAX_VALUE; |
| | | Long liftDeviceId = null; |
| | | for (BasLift basLift : basLiftService.list(new LambdaQueryWrapper<BasLift>() |
| | | .eq(BasLift::getStatus, 1) |
| | | .eq(BasLift::getTransfer, 1))) { |
| | | int lev = Utils.getLev(locNo); |
| | | String liftLocNo = Utils.getLocNo(basLift.getRow(), basLift.getBay(), lev); |
| | | List<NavigateNode> nodeList = NavigateUtils.calc(locNo, liftLocNo, NavigationMapType.NONE.id, Utils.getShuttlePoints(shuttleNo, Utils.getLev(locNo))); |
| | | Integer originPathAllDistance = NavigateUtils.getOriginPathAllDistance(nodeList);//总距离 |
| | | if (originPathAllDistance < distance) { |
| | | distance = originPathAllDistance; |
| | | liftDeviceId = basLift.getDeviceId(); |
| | | } |
| | | } |
| | | |
| | | if (liftDeviceId == null) { |
| | | return null; |
| | | } |
| | | |
| | | Device device = deviceService.getById(liftDeviceId); |
| | | if (device == null) { |
| | | return null; |
| | | } |
| | | return device; |
| | | } |
| | | |
| | | } |