/**
  * @return to official search property result screen
  * @description searches property based on assessment no
  */
 @ValidationErrorPage(value = "new")
 @Action(value = "/search/searchProperty-srchByAssessment")
 public String srchByAssessment() {
   if (LOGGER.isDebugEnabled())
     LOGGER.debug("Entered into srchByAssessment  method. Assessment Number : " + assessmentNum);
   try {
     final BasicProperty basicProperty =
         basicPropertyDAO.getBasicPropertyByIndexNumAndParcelID(assessmentNum, null);
     if (LOGGER.isDebugEnabled())
       LOGGER.debug("srchByAssessment : BasicProperty : " + basicProperty);
     if (basicProperty != null) {
       setSearchResultList(getSearchResults(basicProperty.getUpicNo()));
       checkIsMarkForDeactive(basicProperty);
     }
     if (assessmentNum != null && !assessmentNum.equals(""))
       setSearchValue("Assessment Number : " + assessmentNum);
     setSearchUri("../search/searchProperty-srchByAssessment.action");
     setSearchCriteria("Search By Assessment number");
     setSearchValue("Assessment number :" + assessmentNum);
   } catch (final IndexOutOfBoundsException iob) {
     final String msg = "Rollover is not done for " + assessmentNum;
     throw new ValidationException(Arrays.asList(new ValidationError(msg, msg)));
   } catch (final Exception e) {
     LOGGER.error("Exception in Search Property By Assessment ", e);
     throw new ApplicationRuntimeException("Exception : ", e);
   }
   if (LOGGER.isDebugEnabled()) LOGGER.debug("Exit from srchByAssessment method ");
   return TARGET;
 }
  /**
   * Generalised method to redirect the form page to different transactional form pages
   *
   * @return
   */
  @ValidationErrorPage(value = COMMON_FORM)
  @Action(value = "/search/searchProperty-commonSearch")
  public String commonSearch() {
    final BasicProperty basicProperty =
        basicPropertyDAO.getBasicPropertyByIndexNumAndParcelID(assessmentNum, null);
    if (basicProperty == null) {
      addActionError(getText("validation.property.doesnot.exists"));
      return COMMON_FORM;
    }
    checkIsDemandActive(basicProperty.getProperty());
    if (APPLICATION_TYPE_REVISION_PETITION.equals(applicationType)) {
      if (isDemandActive) {
        addActionError(getText("revPetition.demandActive"));
        return COMMON_FORM;
      }
    } else if (APPLICATION_TYPE_ALTER_ASSESSENT.equals(applicationType)
        || APPLICATION_TYPE_BIFURCATE_ASSESSENT.equals(applicationType)
        || APPLICATION_TYPE_TRANSFER_OF_OWNERSHIP.equals(applicationType)) {
      if (!isDemandActive) {
        addActionError(getText("error.msg.demandInactive"));
        return COMMON_FORM;
      }
    } else if (APPLICATION_TYPE_DEMAND_BILL.equals(applicationType))
      if (basicProperty.getProperty().getIsExemptedFromTax()) {
        addActionError(getText("error.msg.taxExempted"));
        return COMMON_FORM;
      }

    return applicationType;
  }
  /** @return */
  @Action(value = "/collectPropertyTax-generateBill")
  public String generateBill() {
    if (LOGGER.isDebugEnabled())
      LOGGER.debug(
          "Entered method generatePropertyTaxBill, Generating bill for index no : " + propertyId);
    if (propertyId == null || propertyId.isEmpty()) {
      setErrorMsg(getText("mandatory.assessmentNo"));
      return RESULT_ERROR;
    }
    final BasicProperty basicProperty =
        basicPropertyService.findByNamedQuery(
            PropertyTaxConstants.QUERY_BASICPROPERTY_BY_UPICNO, propertyId);
    if (basicProperty == null) {
      setErrorMsg(getText("validation.property.doesnot.exists"));
      return RESULT_ERROR;
    }
    if (LOGGER.isDebugEnabled())
      LOGGER.debug("generatePropertyTaxBill : BasicProperty :" + basicProperty);

    if (basicProperty.getProperty().getIsExemptedFromTax()) {
      args.add(propertyId);
      setErrorMsg(getText("msg.collection.tax.exempted", args));
      return RESULT_ERROR;
    }

    final Map<String, BigDecimal> demandCollMap =
        propertyTaxUtil.getDemandAndCollection(basicProperty.getProperty());
    final BigDecimal currDue =
        demandCollMap.get(CURR_DMD_STR).subtract(demandCollMap.get(CURR_COLL_STR));
    final BigDecimal arrDue =
        demandCollMap.get(ARR_DMD_STR).subtract(demandCollMap.get(ARR_COLL_STR));

    if (currDue.compareTo(BigDecimal.ZERO) <= 0 && arrDue.compareTo(BigDecimal.ZERO) <= 0) {
      args.add(propertyId);
      isAssessmentNoValid = Boolean.TRUE;
      setErrorMsg(getText("msg.collection.fully.paid", args));
      return RESULT_ERROR;
    }
    propertyTaxBillable.setLevyPenalty(true);
    propertyTaxBillable.setBasicProperty(basicProperty);
    propertyTaxBillable.setUserId(Long.valueOf(getSession().get("userid").toString()));
    propertyTaxBillable.setReferenceNumber(
        propertyTaxNumberGenerator.generateBillNumber(
            basicProperty.getPropertyID().getWard().getBoundaryNum().toString()));
    propertyTaxBillable.setBillType(propertyTaxUtil.getBillTypeByCode(BILLTYPE_AUTO));

    final String billXml = ptBillServiceImpl.getBillXML(propertyTaxBillable);
    try {
      collectXML = URLEncoder.encode(billXml, "UTF-8");
    } catch (final UnsupportedEncodingException e) {
      throw new RuntimeException(e.getMessage());
    }
    if (LOGGER.isDebugEnabled())
      LOGGER.debug(
          "Exiting method generatePropertyTaxBill, collectXML (before decode): " + billXml);
    return RESULT_VIEW;
  }
 /**
  * @param pmv
  * @return
  */
 private List<Map<String, String>> getResultsFromMv(final PropertyMaterlizeView pmv) {
   if (LOGGER.isDebugEnabled()) {
     LOGGER.debug("Entered into getSearchResults method");
     LOGGER.debug("Assessment Number : " + pmv.getPropertyId());
   }
   BasicProperty basicProperty =
       basicPropertyDAO.getBasicPropertyByPropertyID(pmv.getPropertyId());
   Property property = basicProperty.getProperty();
   if (basicProperty != null) {
     checkIsDemandActive(basicProperty.getProperty());
   }
   if (pmv.getPropertyId() != null
       || org.apache.commons.lang.StringUtils.isNotEmpty(pmv.getPropertyId()))
     if (pmv != null) {
       final Map<String, String> searchResultMap = new HashMap<String, String>();
       searchResultMap.put("assessmentNum", pmv.getPropertyId());
       searchResultMap.put("ownerName", pmv.getOwnerName());
       searchResultMap.put("parcelId", pmv.getGisRefNo());
       searchResultMap.put("address", pmv.getPropertyAddress());
       searchResultMap.put("source", pmv.getSource().toString());
       searchResultMap.put("isDemandActive", String.valueOf(isDemandActive));
       searchResultMap.put(
           "propType", property.getPropertyDetail().getPropertyTypeMaster().getCode());
       searchResultMap.put("isTaxExempted", String.valueOf(property.getIsExemptedFromTax()));
       searchResultMap.put("isUnderWorkflow", String.valueOf(basicProperty.isUnderWorkflow()));
       searchResultMap.put(
           "enableVacancyRemission",
           String.valueOf(propertyTaxUtil.enableVacancyRemission(basicProperty.getUpicNo())));
       searchResultMap.put(
           "enableMonthlyUpdate",
           String.valueOf(propertyTaxUtil.enableMonthlyUpdate(basicProperty.getUpicNo())));
       searchResultMap.put(
           "enableVRApproval",
           String.valueOf(propertyTaxUtil.enableVRApproval(basicProperty.getUpicNo())));
       if (pmv.getIsExempted()) {
         searchResultMap.put("currDemand", "0");
         searchResultMap.put("arrDemandDue", "0");
         searchResultMap.put("currDemandDue", "0");
       } else {
         searchResultMap.put("currDemand", pmv.getAggrCurrDmd().toString());
         searchResultMap.put(
             "currDemandDue", pmv.getAggrCurrDmd().subtract(pmv.getAggrCurrColl()).toString());
         searchResultMap.put(
             "arrDemandDue", pmv.getAggrArrDmd().subtract(pmv.getAggrArrColl()).toString());
       }
       searchList.add(searchResultMap);
     }
   if (LOGGER.isDebugEnabled()) {
     LOGGER.debug("Search list : " + (searchList != null ? searchList : ZERO));
     LOGGER.debug("Exit from getSearchResults method");
   }
   return searchList;
 }
 /** @param basicProperty */
 private void checkIsMarkForDeactive(final BasicProperty basicProperty) {
   if (LOGGER.isDebugEnabled()) {
     LOGGER.debug("Entered into checkIsMarkForDeactive method");
     LOGGER.debug("BasicProperty : " + basicProperty);
   }
   Set<PropertyStatusValues> propStatusValSet = new HashSet<PropertyStatusValues>();
   propStatusValSet = basicProperty.getPropertyStatusValuesSet();
   for (final PropertyStatusValues propStatusVal : propStatusValSet) {
     if (propStatusVal.getPropertyStatus().getStatusCode().equals(PROPERTY_STATUS_MARK_DEACTIVE))
       markedForDeactive = "Y";
     if (LOGGER.isDebugEnabled()) {
       LOGGER.debug("Property Status Values : " + propStatusVal);
       LOGGER.debug("Marked for Deactivation ? : " + markedForDeactive);
     }
   }
 }
Exemple #6
0
 /**
  * This method populates the <code>PtNotice</code> object along with notice input stream
  *
  * @param basicProperty the <code>BasicProperty</code> object for which the notice is generated
  * @param noticeNo - notice no
  * @param noticeType - type of notice
  * @param fileStream - input stream of generated notice.
  */
 public PtNotice saveNotice(
     String noticeNo, String noticeType, BasicProperty basicProperty, InputStream fileStream) {
   PtNotice ptNotice = new PtNotice();
   Module module = moduleDao.getModuleByName(PTMODULENAME);
   ptNotice.setModuleId(module.getId());
   ptNotice.setNoticeDate(new Date());
   ptNotice.setNoticeNo(noticeNo);
   ptNotice.setNoticeType(noticeType);
   ptNotice.setUserId(EgovThreadLocals.getUserId());
   ptNotice.setBasicProperty(basicProperty);
   String fileName = ptNotice.getNoticeNo() + ".pdf";
   FileStoreMapper fileStore =
       fileStoreService.store(fileStream, fileName, "application/pdf", PTMODULENAME);
   ptNotice.setFileStore(fileStore);
   basicProperty.addNotice(ptNotice);
   basicPropertyService.update(basicProperty);
   return ptNotice;
 }
  /**
   * @param assessmentNumber
   * @return
   */
  private List<Map<String, String>> getSearchResults(final String assessmentNumber) {
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Entered into getSearchResults method");
      LOGGER.debug("Assessment Number : " + assessmentNumber);
    }
    if (assessmentNumber != null
        || org.apache.commons.lang.StringUtils.isNotEmpty(assessmentNumber)) {

      final BasicProperty basicProperty =
          basicPropertyDAO.getBasicPropertyByPropertyID(assessmentNumber);
      if (LOGGER.isDebugEnabled()) LOGGER.debug("BasicProperty : " + basicProperty);
      if (basicProperty != null) {
        final Property property = basicProperty.getProperty();
        if (LOGGER.isDebugEnabled()) LOGGER.debug("Property : " + property);

        checkIsDemandActive(property);

        final Map<String, BigDecimal> demandCollMap = ptDemandDAO.getDemandCollMap(property);

        final Map<String, String> searchResultMap = new HashMap<String, String>();
        searchResultMap.put("assessmentNum", assessmentNumber);
        searchResultMap.put("ownerName", basicProperty.getFullOwnerName());
        searchResultMap.put("address", basicProperty.getAddress().toString());
        searchResultMap.put("source", basicProperty.getSource().toString());
        searchResultMap.put("isDemandActive", String.valueOf(isDemandActive));
        searchResultMap.put(
            "propType", property.getPropertyDetail().getPropertyTypeMaster().getCode());
        searchResultMap.put("isTaxExempted", String.valueOf(property.getIsExemptedFromTax()));
        searchResultMap.put("isUnderWorkflow", String.valueOf(basicProperty.isUnderWorkflow()));
        searchResultMap.put(
            "enableVacancyRemission",
            String.valueOf(propertyTaxUtil.enableVacancyRemission(basicProperty.getUpicNo())));
        searchResultMap.put(
            "enableMonthlyUpdate",
            String.valueOf(propertyTaxUtil.enableMonthlyUpdate(basicProperty.getUpicNo())));
        searchResultMap.put(
            "enableVRApproval",
            String.valueOf(propertyTaxUtil.enableVRApproval(basicProperty.getUpicNo())));
        if (!property.getIsExemptedFromTax()) {
          searchResultMap.put("currDemand", demandCollMap.get(CURR_DMD_STR).toString());
          searchResultMap.put(
              "arrDemandDue",
              demandCollMap.get(ARR_DMD_STR).subtract(demandCollMap.get(ARR_COLL_STR)).toString());
          searchResultMap.put(
              "currDemandDue",
              demandCollMap
                  .get(CURR_DMD_STR)
                  .subtract(demandCollMap.get(CURR_COLL_STR))
                  .toString());
        } else {
          searchResultMap.put("currDemand", "0");
          searchResultMap.put("arrDemandDue", "0");
          searchResultMap.put("currDemandDue", "0");
        }
        if (LOGGER.isDebugEnabled())
          LOGGER.debug(
              "Assessment Number : "
                  + searchResultMap.get("assessmentNum")
                  + ", "
                  + "Owner Name : "
                  + searchResultMap.get("ownerName")
                  + ", "
                  + "Parcel id : "
                  + searchResultMap.get("parcelId")
                  + ", "
                  + "Address : "
                  + searchResultMap.get("address")
                  + ", "
                  + "Current Demand : "
                  + searchResultMap.get("currDemand")
                  + ", "
                  + "Arrears Demand Due : "
                  + searchResultMap.get("arrDemandDue")
                  + ", "
                  + "Current Demand Due : "
                  + searchResultMap.get("currDemandDue"));
        searchList.add(searchResultMap);
      }
    }
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Search list : " + (searchList != null ? searchList : ZERO));
      LOGGER.debug("Exit from getSearchResults method");
    }
    return searchList;
  }