Java Number Compare getCrosstabRowColumnValue(String groupIdentifier, Map crosstabInfoMap, Object executorUnitId, String financesBankId, String companyNumber, String accountNumber)

Here you can find the source of getCrosstabRowColumnValue(String groupIdentifier, Map crosstabInfoMap, Object executorUnitId, String financesBankId, String companyNumber, String accountNumber)

Description

get crosstab info value

License

Open Source License

Parameter

Parameter Description
groupIdentifier a parameter
crosstabInfoMap a parameter
executorUnitId a parameter
financesBankId a parameter
companyNumber a parameter
accountNumber a parameter

Return

BigDecimal

Declaration

public static BigDecimal getCrosstabRowColumnValue(String groupIdentifier, Map crosstabInfoMap,
        Object executorUnitId, String financesBankId, String companyNumber, String accountNumber) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;
import java.util.Map;

public class Main {
    public static String SEPARATOR_KEY = "_";
    public static String BANK_KEY = "Bank";
    public static String BANKACCOUNT_KEY = "BankAcc";
    public static String EXECUTORUNIT_KEY = "ExeUnit";
    public static String BALANCES_GROUP_KEY = "Balance";
    public static String DEPOSIT_MORNING_GROUP_KEY = "DepositM";
    public static String DEPOSIT_AFTERNOON_GROUP_KEY = "DepositA";
    public static String TOTALDEPOSIT_GROUP_KEY = "TDeposit";
    public static String TOTALDEPOSITBALANCES_GROUP_KEY = "TDepositBalance";
    public static String CHECKSRECEIVABLE_GROUP_KEY = "Check";
    public static String TOTALCHECKSRECEIVABLE_GROUP_KEY = "TCheck";
    public static String TOTALCASHAVAILABLE_GROUP_KEY = "TCashAvailable";

    /**/*from   w  ww. ja va 2 s  . c  o  m*/
     * get crosstab info value
     *
     * @param groupIdentifier
     * @param crosstabInfoMap
     * @param executorUnitId
     * @param financesBankId
     * @param companyNumber
     * @param accountNumber
     * @return BigDecimal
     */
    public static BigDecimal getCrosstabRowColumnValue(String groupIdentifier, Map crosstabInfoMap,
            Object executorUnitId, String financesBankId, String companyNumber, String accountNumber) {
        BigDecimal rowColumnValue = null;
        String key = null;
        if (crosstabInfoMap != null) {
            if (BALANCES_GROUP_KEY.equals(groupIdentifier)) {
                key = composeBalancesBankAccountKey(financesBankId, companyNumber, accountNumber);
            } else if (DEPOSIT_MORNING_GROUP_KEY.equals(groupIdentifier)) {
                key = composeMorningDepositsKey(executorUnitId.toString(), financesBankId, companyNumber,
                        accountNumber);
            } else if (DEPOSIT_AFTERNOON_GROUP_KEY.equals(groupIdentifier)) {
                key = composeAfternoonDepositsKey(executorUnitId.toString(), financesBankId, companyNumber,
                        accountNumber);
            } else if (TOTALDEPOSIT_GROUP_KEY.equals(groupIdentifier)) {
                key = composeTotalDepositsKey(financesBankId, companyNumber, accountNumber);
            } else if (TOTALDEPOSITBALANCES_GROUP_KEY.equals(groupIdentifier)) {
                key = composeTotalDepositMoreBalancesKey(financesBankId, companyNumber, accountNumber);
            } else if (CHECKSRECEIVABLE_GROUP_KEY.equals(groupIdentifier)) {
                key = composeChecksReceivableKey(executorUnitId.toString(), financesBankId, companyNumber,
                        accountNumber);
            } else if (TOTALCHECKSRECEIVABLE_GROUP_KEY.equals(groupIdentifier)) {
                key = composeTotalChecksReceivableKey(financesBankId, companyNumber, accountNumber);
            } else if (TOTALCASHAVAILABLE_GROUP_KEY.equals(groupIdentifier)) {
                key = composeTotalCashAvailableKey(financesBankId, companyNumber, accountNumber);
            }

            if (key != null && crosstabInfoMap.containsKey(key)) {
                rowColumnValue = (BigDecimal) crosstabInfoMap.get(key);
            }
        }

        return rowColumnValue;
    }

    public static String composeBalancesBankAccountKey(String financesBankId, String companyNumber,
            String accountNumber) {
        return BALANCES_GROUP_KEY + SEPARATOR_KEY
                + composeBankAccountColumnKey(financesBankId, companyNumber, accountNumber);
    }

    public static String composeMorningDepositsKey(String executorUnitId, String financesBankId,
            String companyNumber, String accountNumber) {
        return DEPOSIT_MORNING_GROUP_KEY + SEPARATOR_KEY + EXECUTORUNIT_KEY + executorUnitId + SEPARATOR_KEY
                + composeBankAccountColumnKey(financesBankId, companyNumber, accountNumber);
    }

    public static String composeAfternoonDepositsKey(String executorUnitId, String financesBankId,
            String companyNumber, String accountNumber) {
        return DEPOSIT_AFTERNOON_GROUP_KEY + SEPARATOR_KEY + EXECUTORUNIT_KEY + executorUnitId + SEPARATOR_KEY
                + composeBankAccountColumnKey(financesBankId, companyNumber, accountNumber);
    }

    public static String composeTotalDepositsKey(String financesBankId, String companyNumber,
            String accountNumber) {
        return TOTALDEPOSIT_GROUP_KEY + SEPARATOR_KEY
                + composeBankAccountColumnKey(financesBankId, companyNumber, accountNumber);
    }

    public static String composeTotalDepositMoreBalancesKey(String financesBankId, String companyNumber,
            String accountNumber) {
        return TOTALDEPOSITBALANCES_GROUP_KEY + SEPARATOR_KEY
                + composeBankAccountColumnKey(financesBankId, companyNumber, accountNumber);
    }

    public static String composeChecksReceivableKey(String executorUnitId, String financesBankId,
            String companyNumber, String accountNumber) {
        return CHECKSRECEIVABLE_GROUP_KEY + SEPARATOR_KEY + EXECUTORUNIT_KEY + executorUnitId + SEPARATOR_KEY
                + composeBankAccountColumnKey(financesBankId, companyNumber, accountNumber);
    }

    public static String composeTotalChecksReceivableKey(String financesBankId, String companyNumber,
            String accountNumber) {
        return TOTALCHECKSRECEIVABLE_GROUP_KEY + SEPARATOR_KEY
                + composeBankAccountColumnKey(financesBankId, companyNumber, accountNumber);
    }

    public static String composeTotalCashAvailableKey(String financesBankId, String companyNumber,
            String accountNumber) {
        return TOTALCASHAVAILABLE_GROUP_KEY + SEPARATOR_KEY
                + composeBankAccountColumnKey(financesBankId, companyNumber, accountNumber);
    }

    private static String composeBankAccountColumnKey(String financesBankId, String companyNumber,
            String accountNumber) {
        return BANK_KEY + financesBankId + SEPARATOR_KEY + BANKACCOUNT_KEY + companyNumber + SEPARATOR_KEY
                + accountNumber;
    }
}

Related

  1. compareTo(Object val1, Object val2)
  2. compareTo(Object value1, Object value2)
  3. compareTwoObject(Object o1, Object o2)
  4. compareValue(Object left, Object right)
  5. compareValues(String value, String type, Object obj)
  6. getDifficulty(long compactTarget)
  7. toPrimaryValue(Comparable comp)