use of gov.ca.cwds.cals.persistence.model.fas.FacilityInformation in project cals-api by ca-cwds.
the class FacilityService method loadFacilityFromLis.
private FacilityDTO loadFacilityFromLis(FacilityParameterObject parameterObject) {
FacilityDTO facilityDto = lisFacilityService.loadFacilityFromLis(parameterObject);
FacilityInformation facilityInformation = fasFacilityService.findFacilityInfoByLicenseNumber(parameterObject);
if (facilityInformation != null) {
lisFacilityService.attachVisitsData(facilityInformation);
}
fasFacilityMapper.toFacilityDTO(facilityDto, facilityInformation);
if (parameterObject.isExpanded()) {
List<FacilityChildDTO> facilityChildren = cwsFacilityService.findFacilityChildrenByLicenseNumber(Integer.valueOf(parameterObject.getFacilityId()));
List<FacilityInspectionDTO> inspections = fasFacilityService.findInspectionsByFacilityId(parameterObject.getFacilityId());
List<ComplaintDTO> complaints = fasFacilityService.findComplaintsByFacilityId(parameterObject.getFacilityId());
facilityDto = facilityMapper.toExpandedFacilityDTO(facilityDto, facilityChildren, inspections, complaints);
}
return facilityDto;
}
Aggregations