Search in sources :

Example 1 with SequencingOrderDto

use of uk.ac.bbsrc.tgac.miso.dto.SequencingOrderDto in project miso-lims by miso-lims.

the class SequencingOrderRestController method search.

@GetMapping(value = "/sequencingorders/search")
@ResponseBody
public List<SequencingOrderDto> search(@RequestParam long poolId, @RequestParam long purposeId, @RequestParam(required = false) Long containerModelId, @RequestParam long parametersId, @RequestParam int partitions) throws IOException {
    Pool pool = getOrThrow(poolService, poolId, "Pool");
    RunPurpose purpose = getOrThrow(runPurposeService, purposeId, "Run purpose");
    SequencingContainerModel containerModel = containerModelId == null ? null : getOrThrow(containerModelService, containerModelId, "Container model");
    SequencingParameters parameters = getOrThrow(sequencingParametersService, parametersId, "Sequencing parameters");
    List<SequencingOrder> results = sequencingOrderService.listByAttributes(pool, purpose, containerModel, parameters, partitions);
    return results.stream().map(so -> Dtos.asDto(so, indexChecker)).collect(Collectors.toList());
}
Also used : RunPurposeService(uk.ac.bbsrc.tgac.miso.core.service.RunPurposeService) PathVariable(org.springframework.web.bind.annotation.PathVariable) UriComponentsBuilder(org.springframework.web.util.UriComponentsBuilder) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) RequestParam(org.springframework.web.bind.annotation.RequestParam) PaginationFilter(uk.ac.bbsrc.tgac.miso.core.util.PaginationFilter) DataTablesResponseDto(uk.ac.bbsrc.tgac.miso.dto.DataTablesResponseDto) SequencingOrder(uk.ac.bbsrc.tgac.miso.core.data.SequencingOrder) Autowired(org.springframework.beans.factory.annotation.Autowired) SequencingOrderSummaryViewService(uk.ac.bbsrc.tgac.miso.core.service.SequencingOrderSummaryViewService) Dtos(uk.ac.bbsrc.tgac.miso.dto.Dtos) PutMapping(org.springframework.web.bind.annotation.PutMapping) DeleteMapping(org.springframework.web.bind.annotation.DeleteMapping) PostMapping(org.springframework.web.bind.annotation.PostMapping) SequencingOrderCompletionDto(uk.ac.bbsrc.tgac.miso.dto.SequencingOrderCompletionDto) PoolDto(uk.ac.bbsrc.tgac.miso.dto.PoolDto) AdvancedSearchParser(uk.ac.bbsrc.tgac.miso.webapp.controller.component.AdvancedSearchParser) PoolPickerEntry(uk.ac.bbsrc.tgac.miso.webapp.util.PoolPickerResponse.PoolPickerEntry) Collectors(java.util.stream.Collectors) IndexChecker(uk.ac.bbsrc.tgac.miso.core.util.IndexChecker) List(java.util.List) SequencingParametersService(uk.ac.bbsrc.tgac.miso.core.service.SequencingParametersService) PoolService(uk.ac.bbsrc.tgac.miso.core.service.PoolService) RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) SequencingOrderService(uk.ac.bbsrc.tgac.miso.core.service.SequencingOrderService) PoolPickerResponse(uk.ac.bbsrc.tgac.miso.webapp.util.PoolPickerResponse) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) Controller(org.springframework.stereotype.Controller) ProviderService(uk.ac.bbsrc.tgac.miso.core.service.ProviderService) SequencingContainerModelService(uk.ac.bbsrc.tgac.miso.core.service.SequencingContainerModelService) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) RequestBody(org.springframework.web.bind.annotation.RequestBody) HttpServletRequest(javax.servlet.http.HttpServletRequest) SequencingOrderSummaryView(uk.ac.bbsrc.tgac.miso.core.data.impl.view.SequencingOrderSummaryView) GetMapping(org.springframework.web.bind.annotation.GetMapping) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) Status(javax.ws.rs.core.Response.Status) HttpServletResponse(javax.servlet.http.HttpServletResponse) IOException(java.io.IOException) SequencingParameters(uk.ac.bbsrc.tgac.miso.core.data.SequencingParameters) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) SequencingOrderDto(uk.ac.bbsrc.tgac.miso.dto.SequencingOrderDto) HttpStatus(org.springframework.http.HttpStatus) PlatformType(uk.ac.bbsrc.tgac.miso.core.data.type.PlatformType) PaginatedDataSource(uk.ac.bbsrc.tgac.miso.core.util.PaginatedDataSource) Collections(java.util.Collections) AsyncOperationManager(uk.ac.bbsrc.tgac.miso.webapp.controller.component.AsyncOperationManager) Identifiable(uk.ac.bbsrc.tgac.miso.core.data.Identifiable) Pool(uk.ac.bbsrc.tgac.miso.core.data.Pool) RunPurpose(uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose) SequencingContainerModel(uk.ac.bbsrc.tgac.miso.core.data.impl.SequencingContainerModel) SequencingOrder(uk.ac.bbsrc.tgac.miso.core.data.SequencingOrder) SequencingParameters(uk.ac.bbsrc.tgac.miso.core.data.SequencingParameters) Pool(uk.ac.bbsrc.tgac.miso.core.data.Pool) GetMapping(org.springframework.web.bind.annotation.GetMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 IOException (java.io.IOException)1 Collections (java.util.Collections)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 Status (javax.ws.rs.core.Response.Status)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 HttpStatus (org.springframework.http.HttpStatus)1 Controller (org.springframework.stereotype.Controller)1 DeleteMapping (org.springframework.web.bind.annotation.DeleteMapping)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1 PathVariable (org.springframework.web.bind.annotation.PathVariable)1 PostMapping (org.springframework.web.bind.annotation.PostMapping)1 PutMapping (org.springframework.web.bind.annotation.PutMapping)1 RequestBody (org.springframework.web.bind.annotation.RequestBody)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 RequestParam (org.springframework.web.bind.annotation.RequestParam)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1