private TableInfo getNewRestaurant( CoordinatePosition userCoordinatePosition, Double currentDistance, Boolean isFarther) { RestaurantFullInfo restaurantFullInfo = findRestaurantByDistance(userCoordinatePosition, currentDistance, isFarther); if (restaurantFullInfo == null) { return null; } return tableService.getRestaurantRecommendTable(restaurantFullInfo); }
@Override public TableInfo getNewRestaurant(RestaurantSelectParam restaurantSelectParam) { CoordinatePosition userCoordinatePosition = new CoordinatePosition(); userCoordinatePosition.setLongitudeValue(restaurantSelectParam.getUserLongitude()); userCoordinatePosition.setLatitudeValue(restaurantSelectParam.getUserLatitude()); CoordinatePosition currentTableCoordinatePosition = tableService.getTableCoordinatePosition(restaurantSelectParam.getTableId()); Double currentDistance = MathUtils.getDistance(userCoordinatePosition, currentTableCoordinatePosition); TableInfo tableInfo = getNewRestaurant( userCoordinatePosition, currentDistance, restaurantSelectParam.getIsFarther()); if (tableInfo != null) { return tableInfo; } else { // todo 提示用户信息 return tableService.getTableInfo(restaurantSelectParam.getTableId()); } }