Пример #1
0
  public void splitFeelistintosublists() {
    LOGGER.debug("Start splitFeelistintosublists");
    CMDAFeeList.clear();
    COCFeeList.clear();
    MWGWFFeeList.clear();
    for (BpaFeeExtn fees : santionFeeList) {

      if (fees.getFeeGroup() != null) {
        if (fees.getFeeGroup().equals(BpaConstants.CMDAFEE)) {
          CMDAFeeList.add(fees);
        } else if (fees.getFeeGroup().equals(BpaConstants.COCFEE)) {
          COCFeeList.add(fees);
        } else if (fees.getFeeGroup().equals(BpaConstants.MWGWFFEE)) {
          MWGWFFeeList.add(fees);
        }
      }
    }

    LOGGER.debug("Exit splitFeelistintosublists");
  }
Пример #2
0
  @SkipValidation
  public void buildVieworModify(RegistrationExtn registrationObj) {
    LOGGER.debug("Start buildVieworModify");
    if (registrationObj.getEgDemand() != null
        && registrationObj.getEgDemand().getEgDemandDetails() != null) {
      Set<EgDemandDetails> demandDetailsSet = registrationObj.getEgDemand().getEgDemandDetails();
      HashMap<String, BigDecimal> feecodeamountmap = new HashMap<String, BigDecimal>();
      HashMap<String, Long> feecodedemanddetailsIdmap = new HashMap<String, Long>();

      // Getting fee amounts from demand to set into the sanctionfees

      for (EgDemandDetails demandDetails : demandDetailsSet) {
        feecodeamountmap.put(
            demandDetails.getEgDemandReason().getEgDemandReasonMaster().getCode(),
            demandDetails.getAmount());
        feecodedemanddetailsIdmap.put(
            demandDetails.getEgDemandReason().getEgDemandReasonMaster().getCode(),
            demandDetails.getId());
      }

      // Getting fee amounts from registrationdfeedetails to set into the
      // sanctionfees
      RegistrationFeeExtn latesetregistrationFeeObj =
          bpaCommonExtnService.getLatestApprovedRegistrationFee(registrationObj);
      if (latesetregistrationFeeObj != null) {
        Set<RegistrationFeeDetailExtn> regFeeDtlSet =
            latesetregistrationFeeObj.getRegistrationFeeDetailsSet();
        for (RegistrationFeeDetailExtn regFeeDtl : regFeeDtlSet) {
          if (feecodeamountmap.get(regFeeDtl.getBpaFee().getFeeCode()) == null) {
            feecodeamountmap.put(regFeeDtl.getBpaFee().getFeeCode(), regFeeDtl.getAmount());
          }
        }
      }

      santionFeeList =
          feeExtnService.getAllSanctionedFeesbyServiceType(
              registrationObj.getServiceType().getId());
      for (BpaFeeExtn fees : santionFeeList) {
        if (fees.getFeeGroup().equals(BpaConstants.COCFEE)) {
          fees.setFeeAmount(
              feecodeamountmap.get(fees.getFeeCode()) != null
                  ? feecodeamountmap.get(fees.getFeeCode())
                  : BigDecimal.ZERO);
          fees.setDemandDetailId(feecodedemanddetailsIdmap.get(fees.getFeeCode()));
          feeTotal = feeTotal.add(fees.getFeeAmount());
        } else if (fees.getFeeGroup().equals(BpaConstants.CMDAFEE)) {
          fees.setFeeAmount(
              feecodeamountmap.get(fees.getFeeCode()) != null
                  ? feecodeamountmap.get(fees.getFeeCode())
                  : BigDecimal.ZERO);
          fees.setDemandDetailId(feecodedemanddetailsIdmap.get(fees.getFeeCode()));
          feeTotal = feeTotal.add(fees.getFeeAmount());
          // TODO: WE MAY NEED TO PASS DEMANDDETAILID ALONG WITH UI.
        } else if (fees.getFeeGroup().equals(BpaConstants.MWGWFFEE)) {
          fees.setFeeAmount(
              feecodeamountmap.get(fees.getFeeCode()) != null
                  ? feecodeamountmap.get(fees.getFeeCode())
                  : BigDecimal.ZERO);
          fees.setDemandDetailId(feecodedemanddetailsIdmap.get(fees.getFeeCode()));
          feeTotal = feeTotal.add(fees.getFeeAmount());
          // TODO: WE MAY NEED TO PASS DEMANDDETAILID ALONG WITH UI.
        }
      }

      if (latesetregistrationFeeObj != null) {
        registrationObj.setRegistrationFeeChallanNumber(
            latesetregistrationFeeObj.getChallanNumber());

      } else registrationObj.setRegistrationFeeChallanNumber("NA");

      if (latesetregistrationFeeObj != null) {
        setFeeRemarks(latesetregistrationFeeObj.getFeeRemarks());
        registrationObj.setFeeDate(sdf.format(latesetregistrationFeeObj.getFeeDate()));
      } else {
        setFeeRemarks(registrationObj.getFeeRemarks());
        registrationObj.setFeeDate(null); // get date from demanddetl
      }
    }
    splitFeelistintosublists();
    LOGGER.debug("Exit buildVieworModify");
  }