/** * @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; }
/** * @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 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; }