当前位置: 首页>>代码示例>>Java>>正文


Java BusinessObjectService.getReferenceIfExists方法代码示例

本文整理汇总了Java中org.kuali.rice.krad.service.BusinessObjectService.getReferenceIfExists方法的典型用法代码示例。如果您正苦于以下问题:Java BusinessObjectService.getReferenceIfExists方法的具体用法?Java BusinessObjectService.getReferenceIfExists怎么用?Java BusinessObjectService.getReferenceIfExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.krad.service.BusinessObjectService的用法示例。


在下文中一共展示了BusinessObjectService.getReferenceIfExists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isValidSalesTaxEntered

import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
 * This method checks to see if the sales tax information was put into the accounting line
 * 
 * @param accountingLine
 * @return true if entered correctly, false otherwise
 */
protected boolean isValidSalesTaxEntered(AccountingLine accountingLine, boolean source, boolean newLine, int index) {
    boolean valid = true;
    DictionaryValidationService dictionaryValidationService = SpringContext.getBean(DictionaryValidationService.class);
    BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
    String objCd = accountingLine.getFinancialObjectCode();
    String account = accountingLine.getAccountNumber();
    SalesTax salesTax = accountingLine.getSalesTax();
    String pathPrefix = "";
    if (source && !newLine) {
        pathPrefix = "document." + OLEConstants.EXISTING_SOURCE_ACCT_LINE_PROPERTY_NAME + "[" + index + "]";
    }
    else if (!source && !newLine) {
        pathPrefix = "document." + OLEConstants.EXISTING_TARGET_ACCT_LINE_PROPERTY_NAME + "[" + index + "]";
    }
    else if (source && newLine) {
        pathPrefix = OLEConstants.NEW_SOURCE_ACCT_LINE_PROPERTY_NAME;
    }
    else if (!source && newLine) {
        pathPrefix = OLEConstants.NEW_TARGET_ACCT_LINE_PROPERTY_NAME;
    }
    GlobalVariables.getMessageMap().addToErrorPath(pathPrefix);
    if (ObjectUtils.isNull(salesTax)) {
        valid &= false;
        GlobalVariables.getMessageMap().putError("salesTax.chartOfAccountsCode", ERROR_DOCUMENT_ACCOUNTING_LINE_SALES_TAX_REQUIRED, account, objCd);
    }
    else {

        if (StringUtils.isBlank(salesTax.getChartOfAccountsCode())) {
            valid &= false;
            GlobalVariables.getMessageMap().putError("salesTax.chartOfAccountsCode", ERROR_REQUIRED, "Chart of Accounts");
        }
        if (StringUtils.isBlank(salesTax.getAccountNumber())) {
            valid &= false;
            GlobalVariables.getMessageMap().putError("salesTax.accountNumber", ERROR_REQUIRED, "Account Number");
        }
        if (salesTax.getFinancialDocumentGrossSalesAmount() == null) {
            valid &= false;
            GlobalVariables.getMessageMap().putError("salesTax.financialDocumentGrossSalesAmount", ERROR_REQUIRED, "Gross Sales Amount");
        }
        if (salesTax.getFinancialDocumentTaxableSalesAmount() == null) {
            valid &= false;
            GlobalVariables.getMessageMap().putError("salesTax.financialDocumentTaxableSalesAmount", ERROR_REQUIRED, "Taxable Sales Amount");
        }
        if (salesTax.getFinancialDocumentSaleDate() == null) {
            valid &= false;
            GlobalVariables.getMessageMap().putError("salesTax.financialDocumentSaleDate", ERROR_REQUIRED, "Sale Date");
        }
        if (StringUtils.isNotBlank(salesTax.getChartOfAccountsCode()) && StringUtils.isNotBlank(salesTax.getAccountNumber())) {

            if (boService.getReferenceIfExists(salesTax, "account") == null) {
                valid &= false;
                GlobalVariables.getMessageMap().putError("salesTax.accountNumber", ERROR_DOCUMENT_ACCOUNTING_LINE_SALES_TAX_INVALID_ACCOUNT, salesTax.getChartOfAccountsCode(), salesTax.getAccountNumber());

            }
        }
        if (!valid) {
            GlobalVariables.getMessageMap().putError("salesTax.chartOfAccountsCode", ERROR_DOCUMENT_ACCOUNTING_LINE_SALES_TAX_REQUIRED, account, objCd);
        }
    }
    GlobalVariables.getMessageMap().removeFromErrorPath(pathPrefix);
    return valid;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:69,代码来源:KualiAccountingDocumentActionBase.java

示例2: isValidSalesTaxEntered

import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
 * This method checks to see if the sales tax information was put into the accounting line
 * 
 * @param accountingLine
 * @return true if entered correctly, false otherwise
 */
protected boolean isValidSalesTaxEntered(AccountingLine accountingLine, boolean source, boolean newLine, int index) {
    boolean valid = true;
    DictionaryValidationService dictionaryValidationService = SpringContext.getBean(DictionaryValidationService.class);
    BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
    String objCd = accountingLine.getFinancialObjectCode();
    String account = accountingLine.getAccountNumber();
    SalesTax salesTax = accountingLine.getSalesTax();
    String pathPrefix = "";
    if (source && !newLine) {
        pathPrefix = "document." + KFSConstants.EXISTING_SOURCE_ACCT_LINE_PROPERTY_NAME + "[" + index + "]";
    }
    else if (!source && !newLine) {
        pathPrefix = "document." + KFSConstants.EXISTING_TARGET_ACCT_LINE_PROPERTY_NAME + "[" + index + "]";
    }
    else if (source && newLine) {
        pathPrefix = KFSConstants.NEW_SOURCE_ACCT_LINE_PROPERTY_NAME;
    }
    else if (!source && newLine) {
        pathPrefix = KFSConstants.NEW_TARGET_ACCT_LINE_PROPERTY_NAME;
    }
    GlobalVariables.getMessageMap().addToErrorPath(pathPrefix);
    if (ObjectUtils.isNull(salesTax)) {
        valid &= false;
        GlobalVariables.getMessageMap().putError("salesTax.chartOfAccountsCode", ERROR_DOCUMENT_ACCOUNTING_LINE_SALES_TAX_REQUIRED, account, objCd);
    }
    else {

        if (StringUtils.isBlank(salesTax.getChartOfAccountsCode())) {
            valid &= false;
            GlobalVariables.getMessageMap().putError("salesTax.chartOfAccountsCode", ERROR_REQUIRED, "Chart of Accounts");
        }
        if (StringUtils.isBlank(salesTax.getAccountNumber())) {
            valid &= false;
            GlobalVariables.getMessageMap().putError("salesTax.accountNumber", ERROR_REQUIRED, "Account Number");
        }
        if (salesTax.getFinancialDocumentGrossSalesAmount() == null) {
            valid &= false;
            GlobalVariables.getMessageMap().putError("salesTax.financialDocumentGrossSalesAmount", ERROR_REQUIRED, "Gross Sales Amount");
        }
        if (salesTax.getFinancialDocumentTaxableSalesAmount() == null) {
            valid &= false;
            GlobalVariables.getMessageMap().putError("salesTax.financialDocumentTaxableSalesAmount", ERROR_REQUIRED, "Taxable Sales Amount");
        }
        if (salesTax.getFinancialDocumentSaleDate() == null) {
            valid &= false;
            GlobalVariables.getMessageMap().putError("salesTax.financialDocumentSaleDate", ERROR_REQUIRED, "Sale Date");
        }
        if (StringUtils.isNotBlank(salesTax.getChartOfAccountsCode()) && StringUtils.isNotBlank(salesTax.getAccountNumber())) {

            if (boService.getReferenceIfExists(salesTax, "account") == null) {
                valid &= false;
                GlobalVariables.getMessageMap().putError("salesTax.accountNumber", ERROR_DOCUMENT_ACCOUNTING_LINE_SALES_TAX_INVALID_ACCOUNT, salesTax.getChartOfAccountsCode(), salesTax.getAccountNumber());

            }
        }
        if (!valid) {
            GlobalVariables.getMessageMap().putError("salesTax.chartOfAccountsCode", ERROR_DOCUMENT_ACCOUNTING_LINE_SALES_TAX_REQUIRED, account, objCd);
        }
    }
    GlobalVariables.getMessageMap().removeFromErrorPath(pathPrefix);
    return valid;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:69,代码来源:KualiAccountingDocumentActionBase.java


注:本文中的org.kuali.rice.krad.service.BusinessObjectService.getReferenceIfExists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。