Search in sources :

Example 1 with FacilityInformation

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;
}
Also used : FacilityInspectionDTO(gov.ca.cwds.cals.service.dto.FacilityInspectionDTO) FacilityInformation(gov.ca.cwds.cals.persistence.model.fas.FacilityInformation) FacilityDTO(gov.ca.cwds.cals.service.dto.FacilityDTO) FacilityChildDTO(gov.ca.cwds.cals.service.dto.FacilityChildDTO) ComplaintDTO(gov.ca.cwds.cals.service.dto.ComplaintDTO)

Aggregations

FacilityInformation (gov.ca.cwds.cals.persistence.model.fas.FacilityInformation)1 ComplaintDTO (gov.ca.cwds.cals.service.dto.ComplaintDTO)1 FacilityChildDTO (gov.ca.cwds.cals.service.dto.FacilityChildDTO)1 FacilityDTO (gov.ca.cwds.cals.service.dto.FacilityDTO)1 FacilityInspectionDTO (gov.ca.cwds.cals.service.dto.FacilityInspectionDTO)1