Exemplo n.º 1
0
 /**
  * Populate wards.
  *
  * @return the string
  */
 @Action(value = "/commonAjax-populateDivisions")
 public String populateDivisions() {
   try {
     final Boundary boundary = boundaryService.getBoundaryById(Long.valueOf(zoneId));
     final String cityName = licenseUtils.getAllCity().get(0).getName();
     if (!boundary.getName().equals(cityName))
       divisionList = boundaryService.getChildBoundariesByBoundaryId(Long.valueOf(zoneId));
   } catch (final Exception e) {
     LOGGER.error("populateDivisions() - Error while loading divisions ." + e.getMessage());
     addFieldError(CommonAjaxAction.LOCATION, "Unable to load division information");
     throw new ApplicationRuntimeException("Unable to load division information", e);
   }
   return "ward";
 }
Exemplo n.º 2
0
 public String populateLocations() {
   try {
     locationList = boundaryService.getChildBoundariesByBoundaryId(Long.valueOf(areaId));
     final StringBuilder result = new StringBuilder();
     for (final Boundary boundary : locationList)
       result
           .append("Text:")
           .append(boundary.getName())
           .append("Value:")
           .append(boundary.getId())
           .append("\n");
     returnStream = result.toString();
   } catch (final Exception e) {
     LOGGER.error("populateLocations() - Error while loading locations." + e.getMessage());
     addFieldError(CommonAjaxAction.LOCATION, "Unable to load location information");
     throw new ApplicationRuntimeException("Unable to load location information", e);
   }
   return "AJAX_RESULT";
 }
Exemplo n.º 3
0
  private BoundaryCategory getBoundaryCategory(
      final Boundary zone,
      final Installment installment,
      final Long usageId,
      final Date occupancyDate) {
    List<BoundaryCategory> categories = new ArrayList<BoundaryCategory>();

    categories =
        persistenceService.findAllByNamedQuery(
            QUERY_BASERATE_BY_OCCUPANCY_ZONE,
            zone.getId(),
            usageId,
            occupancyDate,
            installment.getToDate());

    LOGGER.debug("baseRentOfUnit - Installment : " + installment);
    return categories.get(0);
  }