use of gov.ca.cwds.cals.web.rest.parameter.FacilityChildParameterObject in project cals-api by ca-cwds.
the class FacilityChildService method find.
@Override
public Response find(Serializable params) {
FacilityChildParameterObject parameterObject = (FacilityChildParameterObject) params;
Client client = null;
if (parameterObject.getUnitOfWork().equals(UnitOfWork.CMS)) {
client = clientService.getClientByFacilityIdAndChildId(parameterObject.getFacilityId(), parameterObject.getChildId());
} else {
client = clientService.getClientByLicNumAndChildId(parameterObject.getFacilityId(), parameterObject.getChildId());
}
return facilityChildMapper.toFacilityChildDTO(client);
}
use of gov.ca.cwds.cals.web.rest.parameter.FacilityChildParameterObject in project cals-api by ca-cwds.
the class FacilityChildCollectionService method find.
@Override
public Response find(Serializable params) {
FacilityChildParameterObject parameterObject = (FacilityChildParameterObject) params;
FacilityChildrenDto facilityChildrenDto = new FacilityChildrenDto();
if (parameterObject.getUnitOfWork().equals(UnitOfWork.CMS)) {
facilityChildrenDto.getChildren().addAll(getChildrenFromCwsFacility(parameterObject.getFacilityId()));
} else {
facilityChildrenDto.getChildren().addAll(getChildrenFromLisFacility(parameterObject.getFacilityId()));
}
return facilityChildrenDto.getChildren().isEmpty() ? null : facilityChildrenDto;
}
Aggregations