本文整理汇总了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;
}
示例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;
}