本文整理汇总了Java中org.kuali.rice.krad.service.BusinessObjectService类的典型用法代码示例。如果您正苦于以下问题:Java BusinessObjectService类的具体用法?Java BusinessObjectService怎么用?Java BusinessObjectService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BusinessObjectService类属于org.kuali.rice.krad.service包,在下文中一共展示了BusinessObjectService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveBusinessObject
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.maintenance.Maintainable#saveBusinessObject()
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void saveBusinessObject() {
BusinessObjectService boService = KNSServiceLocator.getBusinessObjectService();
GlobalBusinessObject gbo = (GlobalBusinessObject) businessObject;
// delete any indicated BOs
List bosToDeactivate = gbo.generateDeactivationsToPersist();
if (bosToDeactivate != null) {
if (!bosToDeactivate.isEmpty()) {
boService.save(bosToDeactivate);
}
}
// persist any indicated BOs
List bosToPersist = gbo.generateGlobalChangesToPersist();
if (bosToPersist != null) {
if (!bosToPersist.isEmpty()) {
boService.save(bosToPersist);
}
}
}
示例2: performLogicForFullEntryCompleted
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
/**
* @see org.kuali.ole.module.purap.document.service.AccountsPayableService#performLogicForFullEntryCompleted(org.kuali.ole.module.purap.document.PurchasingAccountsPayableDocument)
*/
@Override
public void performLogicForFullEntryCompleted(PurchasingAccountsPayableDocument purapDocument) {
AccountsPayableDocument apDocument = (AccountsPayableDocument) purapDocument;
AccountsPayableDocumentSpecificService accountsPayableDocumentSpecificService = apDocument.getDocumentSpecificService();
// eliminate unentered items
purapService.deleteUnenteredItems(apDocument);
// change accounts from percents to dollars
purapAccountingService.updateAccountAmounts(apDocument);
//set the AP approval date always when the GL entries are created (treated more of an AP processed date)
apDocument.setAccountsPayableApprovalTimestamp(dateTimeService.getCurrentTimestamp());
// save for persistence
SpringContext.getBean(BusinessObjectService.class).save(apDocument);
// do GL entries for document creation
accountsPayableDocumentSpecificService.generateGLEntriesCreateAccountsPayableDocument(apDocument);
}
示例3: generateDeactivationsToPersist
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.document.GlobalBusinessObject#getGlobalChangesToDelete()
*/
@Override
public List<PersistableBusinessObject> generateDeactivationsToPersist() {
BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
// retreive all the existing delegates for these accounts
List<AccountDelegate> bosToDeactivate = new ArrayList();
Map<String, Object> fieldValues;
Collection existingDelegates;
for (AccountGlobalDetail accountDetail : getAccountGlobalDetails()) {
fieldValues = new HashMap();
fieldValues.put("chartOfAccountsCode", accountDetail.getChartOfAccountsCode());
fieldValues.put("accountNumber", accountDetail.getAccountNumber());
fieldValues.put("active", true);
existingDelegates = boService.findMatching(AccountDelegate.class, fieldValues);
bosToDeactivate.addAll(existingDelegates);
}
// mark all the delegates as inactive
for (AccountDelegate accountDelegate : bosToDeactivate) {
accountDelegate.setActive(false);
}
return new ArrayList<PersistableBusinessObject>(bosToDeactivate);
}
示例4: checkDuplicateSpecialCircumstancesQuestion
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
/**
* Checks that the mileage rates with effective dates overlap with existing mileage rate record for the same mileage code type
*
* @param mileageRate
* @return true if the overlap rule were passed , false otherwise.
*/
protected boolean checkDuplicateSpecialCircumstancesQuestion(SpecialCircumstancesQuestion specialCircumstancesQuestion) {
String documentType = specialCircumstancesQuestion.getDocumentType();
String text = specialCircumstancesQuestion.getText();
final Map<String, Object> criteria = new HashMap<String, Object>();
criteria.put("text", "" + text);
criteria.put("documentType", "" + documentType);
List<SpecialCircumstancesQuestion> matchedRecords = (List<SpecialCircumstancesQuestion>) SpringContext.getBean(BusinessObjectService.class).findMatching(SpecialCircumstancesQuestion.class, criteria);
if(ObjectUtils.isNotNull(matchedRecords) && !matchedRecords.isEmpty()) {
for(SpecialCircumstancesQuestion circumstancesQuestion : matchedRecords) {
if(!circumstancesQuestion.getId().equals(specialCircumstancesQuestion.getId())) {
putFieldError(TemPropertyConstants.SPECIAL_CIRCUMTANCES_QUESTION_TEXT, TemKeyConstants.ERROR_DOCUMENT_SPECIAL_CIRCUMSTANCES_QUESTION_DUPLICATE_RECORD, new String[] { documentType });
return false;
}
}
}
return true;
}
示例5: checkVendorUsingVendorAliasName
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
private void checkVendorUsingVendorAliasName() {
Map vendorAliasMap = new HashMap();
vendorAliasMap.put(OLEConstants.VENDOR_ALIAS_NAME, dvPayeeDetail.getVendorAliasName());
org.kuali.rice.krad.service.BusinessObjectService businessObject = SpringContext.getBean(org.kuali.rice.krad.service.BusinessObjectService.class);
List<VendorAlias> vendorAliasList = (List<VendorAlias>) getLookupService().findCollectionBySearchHelper(VendorAlias.class, vendorAliasMap, true);
if (vendorAliasList != null && vendorAliasList.size() > 0 && vendorAliasList.get(0) != null) {
if (this.getDvPayeeDetail().getDisbVchrPayeeIdNumber() == null) {
GlobalVariables.getMessageMap().putError(PurapConstants.VENDOR_ERRORS, OLEConstants.VENDOR_SELECT);
} else {
String vendorDetailAssignedIdentifier = vendorAliasList.get(0).getVendorDetailAssignedIdentifier().toString();
String vendorHeaderGeneratedIdentifier = vendorAliasList.get(0).getVendorHeaderGeneratedIdentifier().toString();
String AliasPayeeId = vendorHeaderGeneratedIdentifier + "-" + vendorDetailAssignedIdentifier;
if (this.getDvPayeeDetail().getDisbVchrPayeeIdNumber().equalsIgnoreCase(AliasPayeeId)) {
this.getDvPayeeDetail().setDisbVchrPaymentReasonCode(DisbursementVoucherConstants.DV_PAYEE_TYPE_EMPLOYEE);
LOG.debug("###########vendors are allowed to save###########");
} else {
GlobalVariables.getMessageMap().putError(PurapConstants.VENDOR_ERRORS, OLEConstants.VENDOR_NOT_SAME);
}
}
} else {
GlobalVariables.getMessageMap().putError(PurapConstants.VENDOR_ERRORS, OLEConstants.VENDOR_NOT_FOUND);
}
}
示例6: testSave
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
@Test
public void testSave() {
ObjectCodeGlobalDetail detail = new ObjectCodeGlobalDetail();
ObjectCodeGlobal doc = new ObjectCodeGlobal();
doc.setDocumentNumber(document.getDocumentNumber());
detail.setDocumentNumber(document.getDocumentNumber());
detail.setUniversityFiscalYear(document.getPostingYear());
detail.setChartOfAccountsCode("BL");
List<ObjectCodeGlobalDetail> list = new ArrayList<ObjectCodeGlobalDetail>();
list.add(detail);
doc.setObjectCodeGlobalDetails(list);
SpringContext.getBean(BusinessObjectService.class).save(doc);
}
示例7: createPatron
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
/**
* This method will create and persist the patron document
* @param olePatron
* @return savedOlePatronDefinition(OlePatronDefinition)
*/
@Override
public OlePatronDefinition createPatron(OlePatronDefinition olePatron) {
LOG.debug(" Inside create patron ");
OlePatronDefinition savedOlePatronDefinition = new OlePatronDefinition();
try{
BusinessObjectService businessObjectService = KRADServiceLocator.getBusinessObjectService();
OlePatronDocument olePatronDocument = OlePatronDocument.from(olePatron);
EntityBo kimEntity = olePatronDocument.getEntity();
EntityBo entity2 = getBusinessObjectService().save(kimEntity);
List<OleAddressBo> oleAddressBoList = getOlePatronHelperService().retrieveOleAddressBo(entity2,olePatronDocument);
olePatronDocument.setOleAddresses(oleAddressBoList);
olePatronDocument.setOlePatronId(entity2.getId());
olePatronDocument.setEntity(kimEntity);
OlePatronDocument savedPatronDocument = businessObjectService.save(olePatronDocument);
savedOlePatronDefinition = OlePatronDocument.to(savedPatronDocument);
}catch(Exception e){
e.printStackTrace();
}
return savedOlePatronDefinition;
}
示例8: storedSelectedOrgs
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
/**
* Checks that at least one organization is selected and stores the selection settings. If no organization is selected, an error
* message is displayed to the user.
*
* @param selectionSubTreeOrgs
* @return boolean - true if there was a selection and the list was saved, otherwise false
*/
protected boolean storedSelectedOrgs(List<BudgetConstructionPullup> selectionSubTreeOrgs) {
boolean foundSelected = false;
// check to see if at least one pullflag is set and store the pullflag settings for currently displayed set of orgs
for (BudgetConstructionPullup budgetConstructionPullup : selectionSubTreeOrgs) {
if (budgetConstructionPullup.getPullFlag() > 0) {
foundSelected = true;
break;
}
}
// if selection was found, save the org tree seletions, otherwise build error message
if (foundSelected) {
SpringContext.getBean(BusinessObjectService.class).save(selectionSubTreeOrgs);
}
else {
GlobalVariables.getMessageMap().putError(BCConstants.SELECTION_SUB_TREE_ORGS, BCKeyConstants.ERROR_BUDGET_ORG_NOT_SELECTED);
}
return foundSelected;
}
示例9: setUp
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
/**
* @see junit.framework.TestCase#setUp()
*/
@Override
protected void setUp() throws Exception {
contractsGrantsInvoiceDocumentService = SpringContext.getBean(ContractsGrantsInvoiceDocumentService.class);
contractsGrantsInvoiceDocumentServiceImpl.setBusinessObjectService(SpringContext.getBean(BusinessObjectService.class));
contractsGrantsInvoiceDocumentServiceImpl.setObjectCodeService(SpringContext.getBean(ObjectCodeService.class));
contractsGrantsInvoiceDocumentServiceImpl.setUniversityDateService(SpringContext.getBean(UniversityDateService.class));
contractsGrantsInvoiceDocumentServiceImpl.setOptionsService(SpringContext.getBean(OptionsService.class));
contractsGrantsInvoiceDocumentServiceImpl.setContractsGrantsInvoiceDocumentDao(SpringContext.getBean(ContractsGrantsInvoiceDocumentDao.class));
contractsGrantsInvoiceDocumentServiceImpl.setCostCategoryService(SpringContext.getBean(CostCategoryService.class));
contractsGrantsInvoiceCreateDocumentServiceImpl.setAwardAccountObjectCodeTotalBilledDao(SpringContext.getBean(AwardAccountObjectCodeTotalBilledDao.class));
contractsGrantsInvoiceCreateDocumentServiceImpl.setBusinessObjectService(SpringContext.getBean(BusinessObjectService.class));
contractsGrantsInvoiceCreateDocumentServiceImpl.setUniversityDateService(SpringContext.getBean(UniversityDateService.class));
contractsGrantsInvoiceCreateDocumentServiceImpl.setContractsGrantsInvoiceDocumentService(contractsGrantsInvoiceDocumentServiceImpl);
contractsGrantsInvoiceCreateDocumentServiceImpl.setCostCategoryService(SpringContext.getBean(CostCategoryService.class));
contractsGrantsInvoiceCreateDocumentServiceImpl.setOptionsService(SpringContext.getBean(OptionsService.class));
super.setUp();
}
示例10: setUp
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
balancingService = (BalancingServiceBaseImpl<Entry, Balance>) TestUtils.getUnproxiedService("laborBalancingService");
ledgerEntryHistoryBalancingDao = (LedgerEntryHistoryBalancingDao) SpringContext.getService("laborLedgerEntryHistoryDao");
ledgerBalancingDao = (LedgerBalancingDao) SpringContext.getService("laborBalancingDao");
businessObjectService = SpringContext.getBean(BusinessObjectService.class);
// Delete all data so that balancing has an empty table set to work with
Map<String, Object> fieldValues = new HashMap<String, Object>();
businessObjectService.deleteMatching(LedgerEntry.class, fieldValues);
businessObjectService.deleteMatching(LedgerBalance.class, fieldValues);
businessObjectService.deleteMatching(LaborEntryHistory.class, fieldValues);
businessObjectService.deleteMatching(LaborBalanceHistory.class, fieldValues);
// Because KULDBA doesn't support FYs more then 1 year back we need to limit our range in order to properly test boundary cases
TestUtils.setSystemParameter(LaborBalancingStep.class, LaborConstants.Balancing.NUMBER_OF_PAST_FISCAL_YEARS_TO_INCLUDE, "0");
File batchFileDirectory = new File(this.getBatchFileDirectoryName());
if (!batchFileDirectory.exists()) {
batchFileDirectory.mkdir();
batchFileDirectoryCreated = true;
}
// careful: super.setUp needs to happen at the end because of service initialization and NUMBER_OF_PAST_FISCAL_YEARS_TO_INCLUDE
super.setUp();
}
示例11: testDoesOrganizationAccountingDefaultHaveWriteoffInformation_Invalid
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
/**
* This method...
*/
public void testDoesOrganizationAccountingDefaultHaveWriteoffInformation_Invalid() throws WorkflowException {
String customerInvoiceDocumentNumber = CustomerInvoiceDocumentTestUtil.submitNewCustomerInvoiceDocument(CustomerInvoiceDocumentFixture.BASE_CIDOC_WITH_CUSTOMER_WITH_BILLING_INFO,
new CustomerInvoiceDetailFixture[]
{CustomerInvoiceDetailFixture.CUSTOMER_INVOICE_DETAIL_CHART_RECEIVABLE},
null);
CustomerInvoiceWriteoffDocument customerInvoiceWriteoffDocument = new CustomerInvoiceWriteoffDocument();
customerInvoiceWriteoffDocument.setFinancialDocumentReferenceInvoiceNumber(customerInvoiceDocumentNumber);
//this should assert false because there isn't a org acct default row yet
assertFalse(rule.doesOrganizationAccountingDefaultHaveWriteoffInformation(customerInvoiceWriteoffDocument));
OrganizationAccountingDefault organizationAccountingDefault = new OrganizationAccountingDefault();
organizationAccountingDefault.setChartOfAccountsCode(ORG_ACCT_DEFAULT_CHART);
organizationAccountingDefault.setOrganizationCode(ORG_ACCT_DEFAULT_ORG);
organizationAccountingDefault.setUniversityFiscalYear(SpringContext.getBean(UniversityDateService.class).getCurrentFiscalYear());
SpringContext.getBean(BusinessObjectService.class).save(organizationAccountingDefault);
//this should assert false because the org acct default doesn't have writeoff account, object code, or chart
assertFalse(rule.doesOrganizationAccountingDefaultHaveWriteoffInformation(customerInvoiceWriteoffDocument));
}
示例12: processInterDepartmentalBillingAmounts
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
/**
* Modifies the amounts in the ID Billing Detail rows, depending on specific business rules. For this default implementation,
* see the {@link #negateAmountIfNecessary(InterDepartmentalBilling, BalanceTyp, ObjectType, CollectorBatch)} method to see how
* the billing detail amounts are modified.
*
* @param batch a CollectorBatch to process
*/
protected void processInterDepartmentalBillingAmounts(CollectorBatch batch) {
for (CollectorDetail collectorDetail : batch.getCollectorDetails()) {
String balanceTypeCode = getBalanceTypeCode(collectorDetail, batch);
BalanceType balanceTyp = new BalanceType();
balanceTyp.setFinancialBalanceTypeCode(balanceTypeCode);
balanceTyp = (BalanceType) SpringContext.getBean(BusinessObjectService.class).retrieve(balanceTyp);
if (balanceTyp == null) {
// no balance type in db
LOG.info("No balance type code found for ID billing record. " + collectorDetail);
continue;
}
collectorDetail.refreshReferenceObject(KFSPropertyConstants.FINANCIAL_OBJECT);
if (collectorDetail.getFinancialObject() == null) {
// no object code in db
LOG.info("No object code found for ID billing record. " + collectorDetail);
continue;
}
ObjectType objectType = collectorDetail.getFinancialObject().getFinancialObjectType();
/** Commented out for KULRNE-5922 */
// negateAmountIfNecessary(collectorDetail, balanceTyp, objectType, batch);
}
}
示例13: setupPayeeAsVendor
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
/**
* setup the payee as a vendor with the given id number and address id
*/
protected void setupPayeeAsVendor(DisbursementVoucherForm dvForm, String payeeIdNumber, String payeeAddressIdentifier) {
VendorDetail vendorDetail = new VendorDetail();
vendorDetail.setVendorNumber(payeeIdNumber);
vendorDetail = (VendorDetail) SpringContext.getBean(BusinessObjectService.class).retrieve(vendorDetail);
VendorAddress vendorAddress = new VendorAddress();
if (StringUtils.isNotBlank(payeeAddressIdentifier)) {
try {
vendorAddress.setVendorAddressGeneratedIdentifier(new Integer(payeeAddressIdentifier));
vendorAddress = (VendorAddress) SpringContext.getBean(BusinessObjectService.class).retrieve(vendorAddress);
dvForm.setTempPayeeIdNumber(payeeIdNumber);
dvForm.setOldPayeeType(KFSConstants.PaymentPayeeTypes.VENDOR);
}
catch (Exception e) {
LOG.error("Exception while attempting to retrieve vendor address for vendor address id " + payeeAddressIdentifier + ": " + e);
}
}
((DisbursementVoucherDocument) dvForm.getDocument()).templateVendor(vendorDetail, vendorAddress);
}
示例14: checkForBlockingOffsetDefinitions
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
/**
* Checks that no offset definitions are dependent on the given object code if it is inactivated
* @param objectCode the object code trying to inactivate
* @return true if no offset definitions rely on the object code, false otherwise; this method also inserts error statements
*/
protected boolean checkForBlockingOffsetDefinitions(ObjectCode objectCode) {
final BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
boolean result = true;
Map<String, Object> keys = new HashMap<String, Object>();
keys.put("universityFiscalYear", objectCode.getUniversityFiscalYear());
keys.put("chartOfAccountsCode", objectCode.getChartOfAccountsCode());
keys.put("financialObjectCode", objectCode.getFinancialObjectCode());
final int matchingCount = businessObjectService.countMatching(OffsetDefinition.class, keys);
if (matchingCount > 0) {
GlobalVariables.getMessageMap().putErrorForSectionId("Edit Object Code",KFSKeyConstants.ERROR_DOCUMENT_OBJECTMAINT_INACTIVATION_BLOCKING,new String[] {(objectCode.getUniversityFiscalYear() != null ? objectCode.getUniversityFiscalYear().toString() : ""), objectCode.getChartOfAccountsCode(), objectCode.getFinancialObjectCode(), Integer.toString(matchingCount), OffsetDefinition.class.getName()});
result = false;
}
return result;
}
示例15: isVendorContractExpired
import org.kuali.rice.krad.service.BusinessObjectService; //导入依赖的package包/类
/**
* @see org.kuali.kfs.vnd.document.service.VendorService#isVendorContractExpired(org.kuali.rice.krad.document.Document, java.lang.Integer, org.kuali.kfs.vnd.businessobject.VendorDetail)
*/
@Override
public boolean isVendorContractExpired(Document document, Integer vendorContractGeneratedIdentifier, VendorDetail vendorDetail) {
boolean isExpired = false;
if (ObjectUtils.isNotNull(vendorContractGeneratedIdentifier)) {
VendorContract vendorContract = SpringContext.getBean(BusinessObjectService.class).findBySinglePrimaryKey(VendorContract.class, vendorContractGeneratedIdentifier);
Date currentDate = SpringContext.getBean(DateTimeService.class).getCurrentSqlDate();
List<Note> notes = document.getNotes();
if ((currentDate.compareTo(vendorContract.getVendorContractEndDate()) > 0 && (vendorContract.getVendorContractExtensionDate() == null || currentDate.compareTo(vendorContract.getVendorContractExtensionDate()) > 0)) || !vendorContract.isActive()) {
Note newNote = new Note();
newNote.setNoteText("Vendor Contract: " + vendorContract.getVendorContractName() + " contract has expired contract end date.");
newNote.setNotePostedTimestampToCurrent();
newNote.setNoteTypeCode(KFSConstants.NoteTypeEnum.BUSINESS_OBJECT_NOTE_TYPE.getCode());
Note note = noteService.createNote(newNote, vendorDetail, GlobalVariables.getUserSession().getPrincipalId());
notes.add(note);
isExpired = true;
}
}
return isExpired;
}