use of uk.ac.bbsrc.tgac.miso.dto.run.RunDto in project miso-lims by miso-lims.
the class RequisitionController method edit.
@GetMapping("/{id}")
public ModelAndView edit(@PathVariable long id, ModelMap model) throws IOException {
Requisition requisition = requisitionService.get(id);
if (requisition == null) {
throw new NotFoundException("No requisition found for ID: " + id);
}
model.put("title", "Requisition " + id);
List<Sample> samples = sampleService.list(0, 0, false, "id", PaginationFilter.requisitionId(id));
List<Sample> extractions = sampleService.getChildren(samples.stream().map(Sample::getId).collect(Collectors.toSet()), SampleStock.CATEGORY_NAME);
List<SampleDto> extractionDtos = extractions.stream().map(sam -> Dtos.asDto(sam, false)).collect(Collectors.toList());
model.put("extractions", extractionDtos);
List<Long> libraryIds = libraryService.listIdsByRequisitionId(id);
List<Run> runs = runService.listByLibraryIdList(libraryIds);
List<RunDto> runDtos = runs.stream().map(Dtos::asDto).collect(Collectors.toList());
model.put("runs", runDtos);
return setupForm(requisition, PageMode.EDIT, model);
}
Aggregations