use of gov.ca.cwds.cals.persistence.model.lisfas.LisFacFile in project cals-api by ca-cwds.
the class LisFacilityService method loadFacilityFromLis.
/**
* Load facility from LIS.
*/
public FacilityDTO loadFacilityFromLis(FacilityParameterObject parameterObject) {
LisFacFile lisDsLisFacFile = findLisFacilityByLicenseNumber(parameterObject);
if (lisDsLisFacFile == null) {
LOGGER.warn("!!!Facility was not found in LIS by license number {}", parameterObject.getFacilityId());
return null;
}
LpaInformation lpaInformation = lisDsLisFacFile.getFacDoEvalCode() != null ? fasFacilityService.findAssignedWorkerInformation(lisDsLisFacFile) : null;
return facilityMapper.toFacilityDTO(lisDsLisFacFile, lpaInformation);
}
use of gov.ca.cwds.cals.persistence.model.lisfas.LisFacFile in project cals-api by ca-cwds.
the class LisFacilityService method findLisFacilityByLicenseNumber.
@UnitOfWork(LIS)
LisFacFile findLisFacilityByLicenseNumber(FacilityParameterObject parameterObject) {
LisFacFile lisFacFile = lisFacFileLisDao.find(Integer.valueOf(parameterObject.getFacilityId()));
if (lisFacFile == null) {
return null;
}
Integer countyCode = lisFacFile.getCountyCode();
if (countyCode != null) {
LisTableFile county = lisTableFileDao.findCounty(countyCode);
lisFacFile.setCounty(county);
}
Integer facilityStatusCode = lisFacFile.getFacilityStatusCode();
if (facilityStatusCode != null) {
LisTableFile facilityStatus = lisTableFileDao.findFacilityStatus(facilityStatusCode);
lisFacFile.setFacilityStatus(facilityStatus);
}
Integer facilityTypeCode = lisFacFile.getFacilityTypeCode();
if (facilityTypeCode != null) {
LisTableFile facilityType = lisTableFileDao.findFacilityType(facilityTypeCode);
lisFacFile.setFacilityType(facilityType);
}
return lisFacFile;
}
Aggregations