use of uk.ac.bbsrc.tgac.miso.dto.SequencingOrderCompletionDto in project miso-lims by miso-lims.
the class PoolPickerResponse method populate.
public <T> void populate(PaginatedDataSource<T> source, boolean sortOrder, String sortColumn, Integer limit, WhineyFunction<T, PoolPickerEntry> transform, PaginationFilter... filters) throws IOException {
Consumer<String> errorHandler = message -> errors.add(message);
Map<Long, List<PoolPickerEntry>> groupedByPool = source.list(errorHandler, 0, limit, sortOrder, sortColumn, filters).stream().map(WhineyFunction.rethrow(transform)).collect(Collectors.groupingBy(entry -> entry.getPool().getId()));
items = groupedByPool.values().stream().map(listOfPicks -> {
List<SequencingOrderCompletionDto> completionsByPool = listOfPicks.stream().flatMap(pick -> pick.getOrders().stream()).collect(Collectors.toList());
PoolDto pool = listOfPicks.get(0).getPool();
return new PoolPickerEntry(pool, completionsByPool);
}).collect(Collectors.toList());
numMatches = source.count(filters);
}
use of uk.ac.bbsrc.tgac.miso.dto.SequencingOrderCompletionDto in project miso-lims by miso-lims.
the class SequencingOrderRestController method orderTransform.
private PoolPickerEntry orderTransform(SequencingOrderSummaryView order) {
PoolDto poolDto = Dtos.asDto(order.getPool(), indexChecker);
SequencingOrderCompletionDto socDto = Dtos.asDto(order, indexChecker);
return new PoolPickerEntry(poolDto, Collections.singletonList(socDto));
}
Aggregations