本文整理汇总了Java中org.kuali.rice.krad.service.BusinessObjectService.findByPrimaryKey方法的典型用法代码示例。如果您正苦于以下问题:Java BusinessObjectService.findByPrimaryKey方法的具体用法?Java BusinessObjectService.findByPrimaryKey怎么用?Java BusinessObjectService.findByPrimaryKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.krad.service.BusinessObjectService
的用法示例。
在下文中一共展示了BusinessObjectService.findByPrimaryKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createLocationLevel
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
public LocationLevel createLocationLevel(String locationName, LocationLevel locationLevel) {
LOG.debug("Inside the createLocationLevel method");
if (locationName != null && !locationName.equalsIgnoreCase("")) {
BusinessObjectService businessObjectService = KRADServiceLocator.getBusinessObjectService();
String[] names = locationName.split("/");
Map parentCriteria = new HashMap();
parentCriteria.put(OLEConstants.LOC_CD, names[0]);
OleLocation oleLocationCollection = businessObjectService.findByPrimaryKey(OleLocation.class, parentCriteria);
String locationCode = oleLocationCollection.getLocationCode();
String levelCode = oleLocationCollection.getOleLocationLevel().getLevelName();
locationLevel.setName(locationCode);
locationLevel.setLevel(levelCode);
String locName = "";
if (locationName.contains(OLEConstants.SLASH))
locName = locationName.replace(names[0] + OLEConstants.SLASH, "");
else
locName = locationName.replace(names[0], "");
if (locName != null && !locName.equals("")) {
LocationLevel newLocationLevel = new LocationLevel();
locationLevel.setLocationLevel(createLocationLevel(locName, newLocationLevel));
}
}
return locationLevel;
}
示例2: createLocationLevel
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
public LocationLevel createLocationLevel(String locationName, LocationLevel locationLevel) {
LOG.debug("Inside the instance details createLocationLevel method");
if (locationName != null && !locationName.equalsIgnoreCase("")) {
BusinessObjectService businessObjectService = KRADServiceLocator.getBusinessObjectService();
String[] names = locationName.split("/");
Map parentCriteria = new HashMap();
parentCriteria.put(OLEConstants.LOC_CD, names[0]);
OleLocation oleLocationCollection = businessObjectService.findByPrimaryKey(OleLocation.class, parentCriteria);
String levelName = oleLocationCollection.getLocationName();
String locationCode = oleLocationCollection.getLocationCode();
String levelCode = oleLocationCollection.getOleLocationLevel().getLevelName();
locationLevel.setName(levelName);
locationLevel.setLevel(levelCode);
locationLevel.setCode(locationCode);
String locName = "";
if (locationName.contains(OLEConstants.SLASH))
locName = locationName.replace(names[0] + OLEConstants.SLASH, "");
else
locName = locationName.replace(names[0], "");
if (locName != null && !locName.equals("")) {
LocationLevel newLocationLevel = new LocationLevel();
locationLevel.setLocationLevel(createLocationLevel(locName, newLocationLevel));
}
}
return locationLevel;
}
示例3: updateResultList
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* Get PurapDocumentIdentifier from PurchasingAccountsPayableDocument and add it to the search result.
*
* @param purApReportCollection
*/
private List<PurchasingAccountsPayableProcessingReport> updateResultList(List<PurchasingAccountsPayableProcessingReport> purApReportList) {
List<PurchasingAccountsPayableProcessingReport> newResultList = new ArrayList<PurchasingAccountsPayableProcessingReport>();
BusinessObjectService boService = this.getBusinessObjectService();
Map pKeys = new HashMap<String, String>();
for (PurchasingAccountsPayableProcessingReport report : purApReportList) {
pKeys.put(CabPropertyConstants.PurchasingAccountsPayableDocument.DOCUMENT_NUMBER, report.getDocumentNumber());
PurchasingAccountsPayableDocument purApDocument = boService.findByPrimaryKey(PurchasingAccountsPayableDocument.class, pKeys);
if (ObjectUtils.isNotNull(purApDocument)) {
report.setPurapDocumentIdentifier(purApDocument.getPurapDocumentIdentifier());
newResultList.add(report);
}
pKeys.clear();
}
return newResultList;
}
示例4: createLocationLevel
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
public LocationLevel createLocationLevel(String locationName, LocationLevel locationLevel) {
if (locationName != null && !locationName.equalsIgnoreCase("")) {
BusinessObjectService businessObjectService = KRADServiceLocator.getBusinessObjectService();
String[] names = locationName.split("/");
Map parentCriteria = new HashMap();
parentCriteria.put("locationCode", names[0]);
OleLocation oleLocationCollection = businessObjectService.findByPrimaryKey(OleLocation.class, parentCriteria);
String locationCode = oleLocationCollection.getLocationCode();
String levelCode = oleLocationCollection.getOleLocationLevel().getLevelName();
locationLevel.setName(locationCode);
locationLevel.setLevel(levelCode);
String locName = "";
if (locationName.contains("/"))
locName = locationName.replace(names[0] + "/", "");
else
locName = locationName.replace(names[0], "");
if (locName != null && !locName.equals("")) {
LocationLevel newLocationLevel = new LocationLevel();
locationLevel.setLocationLevel(createLocationLevel(locName, newLocationLevel));
}
}
return locationLevel;
}
示例5: getLocationCode
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
private String getLocationCode(LocationLevel locationLevel) {
String locationCode = "";
while (locationLevel != null) {
String name = locationLevel.getName();
if (name != null) {
BusinessObjectService businessObjectService = KRADServiceLocator.getBusinessObjectService();
Map parentCriteria = new HashMap();
parentCriteria.put("locationCode", name);
OleLocation oleLocationCollection = businessObjectService.findByPrimaryKey(OleLocation.class, parentCriteria);
if (oleLocationCollection != null) {
String code = oleLocationCollection.getLocationCode();
if (locationCode.equalsIgnoreCase("")) {
locationCode = code;
} else {
locationCode = locationCode + "/" + code;
}
}
}
locationLevel = locationLevel.getLocationLevel();
}
return locationCode;
}
示例6: createLocationLevel
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
public LocationLevel createLocationLevel(String locationName, LocationLevel locationLevel) {
if (locationName != null && !locationName.equalsIgnoreCase("")) {
BusinessObjectService businessObjectService = KRADServiceLocator.getBusinessObjectService();
String[] names = locationName.split("/");
Map parentCriteria = new HashMap();
parentCriteria.put("locationCode", names[0]);
OleLocation oleLocationCollection = businessObjectService.findByPrimaryKey(OleLocation.class, parentCriteria);
String levelName = oleLocationCollection.getLocationName();
String locationCode = oleLocationCollection.getLocationCode();
String levelCode = oleLocationCollection.getOleLocationLevel().getLevelName();
locationLevel.setName(locationCode);
locationLevel.setLevel(levelCode);
String locName = "";
if (locationName.contains("/"))
locName = locationName.replace(names[0] + "/", "");
else
locName = locationName.replace(names[0], "");
if (locName != null && !locName.equals("")) {
LocationLevel newLocationLevel = new LocationLevel();
locationLevel.setLocationLevel(createLocationLevel(locName, newLocationLevel));
}
}
return locationLevel;
}
示例7: getLocationCode
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
public String getLocationCode(LocationLevel locationLevel) {
String locationCode = "";
while (locationLevel != null) {
String name = locationLevel.getName();
if (name != null) {
BusinessObjectService businessObjectService = KRADServiceLocator.getBusinessObjectService();
Map parentCriteria = new HashMap();
parentCriteria.put("locationCode", name);
OleLocation oleLocationCollection = businessObjectService.findByPrimaryKey(OleLocation.class, parentCriteria);
if (oleLocationCollection != null) {
String code = oleLocationCollection.getLocationCode();
if (locationCode.equalsIgnoreCase("")) {
locationCode = code;
} else {
locationCode = locationCode + "/" + code;
}
}
}
locationLevel = locationLevel.getLocationLevel();
}
return locationCode;
}
示例8: computeItemType
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* compute item type name if item type code is available
*
* @param itemType
*/
private void computeItemType(ItemType itemType) {
OleInstanceItemType oleInstanceItemType = new OleInstanceItemType();
String itemTypeName = "";
if (itemType != null) {
if (itemType.getCodeValue() != null) {
String itemTypeCodeValue = itemType.getCodeValue();
//item type code is available
if (StringUtils.isNotEmpty(itemTypeCodeValue)) {
BusinessObjectService businessObjectService = KRADServiceLocator.getBusinessObjectService();
Map parentCriteria = new HashMap();
parentCriteria.put("instanceItemTypeCode", itemTypeCodeValue);
oleInstanceItemType = businessObjectService
.findByPrimaryKey(OleInstanceItemType.class, parentCriteria);
if (oleInstanceItemType != null) {
itemTypeName = oleInstanceItemType.getInstanceItemTypeName();
itemType.setFullValue(itemTypeName);
}
}
}
}
}
示例9: computeTempItemType
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
private String computeTempItemType(ItemType itemType) {
OleInstanceItemType oleInstanceItemType = new OleInstanceItemType();
String tempItemTypeName = "";
if (itemType != null) {
if (itemType.getCodeValue() != null) {
String tempItemTypeCodeValue = itemType.getCodeValue();
//item type code is available
if (StringUtils.isNotEmpty(tempItemTypeCodeValue)) {
BusinessObjectService businessObjectService = KRADServiceLocator.getBusinessObjectService();
Map parentCriteria = new HashMap();
parentCriteria.put("instanceItemTypeCode", tempItemTypeCodeValue);
oleInstanceItemType = businessObjectService
.findByPrimaryKey(OleInstanceItemType.class, parentCriteria);
if (oleInstanceItemType != null) {
tempItemTypeName = oleInstanceItemType.getInstanceItemTypeName();
}
}
}
}
return tempItemTypeName;
}
示例10: transferInstances
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
public void transferInstances(List<RequestDocument> requestDocuments, BusinessObjectService businessObjectService)
throws Exception {
LOG.debug("RdbmsWorkInstanceDocumentManager transferInstances");
Collection<InstanceRecord> instanceRecords = null;
String desBibIdentifier = requestDocuments.get(requestDocuments.size() - 1).getUuid();
LOG.debug("RdbmsWorkInstanceDocumentManager transferInstances desBibIdentifier " + desBibIdentifier);
Map instanceMap = new HashMap();
Map bibInstanceMap = new HashMap();
for (int i = 0; i < requestDocuments.size() - 1; i++) {
RequestDocument requestDocument = requestDocuments.get(i);
instanceMap.put("instanceId", DocumentUniqueIDPrefix.getDocumentId(requestDocument.getUuid()));
bibInstanceMap.put("instanceId", DocumentUniqueIDPrefix.getDocumentId(requestDocument.getUuid()));
List<BibInstanceRecord> bibInstanceRecordList = (List<BibInstanceRecord>) businessObjectService
.findMatching(BibInstanceRecord.class, bibInstanceMap);
if (bibInstanceRecordList.size() > 1) {
//Instances are associated with multiple bibs means it has bound with with other bib. So we cant transfer. So throw exception
LOG.error(requestDocument.getUuid() + " is bounded with other bib and cant be transferred");
throw new Exception(requestDocument.getUuid() + " is bounded with other bib and cant be transferred");
}
//else {
// BibInstanceRecord bibInstanceRecord = bibInstanceRecordList.get(0);
// bibInstanceRecord.setBibId(DocumentUniqueIDPrefix.getDocumentId(desBibIdentifier));
// businessObjectService.save(bibInstanceRecord);
//}
InstanceRecord instanceRecord = businessObjectService.findByPrimaryKey(InstanceRecord.class, instanceMap);
instanceRecord.setBibId(DocumentUniqueIDPrefix.getDocumentId(desBibIdentifier));
businessObjectService.save(instanceRecord);
}
}
示例11: checkInContent
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
@Override
public void checkInContent(RequestDocument requestDocument, Object object, ResponseDocument responseDocument) {
modifyAdditionalAttributes(requestDocument);
BusinessObjectService businessObjectService = (BusinessObjectService) object;
if (null == businessObjectService) {
businessObjectService = KRADServiceLocator.getBusinessObjectService();
}
Map parentCriteria1 = new HashMap();
parentCriteria1.put("bibId", DocumentUniqueIDPrefix.getDocumentId(requestDocument.getUuid()));
AdditionalAttributes attributes = requestDocument.getAdditionalAttributes();
BibRecord bibRecord = businessObjectService.findByPrimaryKey(BibRecord.class, parentCriteria1);
bibRecord.setContent(requestDocument.getContent().getContent());
if (attributes != null) {
bibRecord.setFassAddFlag(Boolean.valueOf(attributes.getAttribute(AdditionalAttributes.FAST_ADD_FLAG)));
bibRecord.setSuppressFromPublic(attributes.getAttribute(AdditionalAttributes.SUPRESS_FROM_PUBLIC));
bibRecord.setStatus(attributes.getAttribute(AdditionalAttributes.STATUS));
/* DateFormat df = new SimpleDateFormat("mm/dd/yyyy hh:mm:ss");
Date dateStatusUpdated = null;
try {
dateStatusUpdated = df.parse(attributes.getAttribute(AdditionalAttributes.STATUS_UPDATED_ON));
} catch (ParseException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
bibRecord.setStatusUpdatedDate(dateStatusUpdated);*/
bibRecord.setUpdatedBy(attributes.getAttribute(AdditionalAttributes.UPDATED_BY));
bibRecord.setDateEntered(Timestamp.valueOf(attributes.getAttribute(AdditionalAttributes.DATE_ENTERED)));
if (attributes.getAttribute(AdditionalAttributes.STATUS_UPDATED_BY) != null) {
bibRecord.setStatusUpdatedBy(attributes.getAttribute(AdditionalAttributes.STATUS_UPDATED_BY));
}
if (attributes.getAttribute(AdditionalAttributes.STATUS_UPDATED_ON) != null) {
bibRecord.setStatusUpdatedDate(Timestamp.valueOf(attributes.getAttribute(AdditionalAttributes.STATUS_UPDATED_ON)));
}
bibRecord.setStaffOnlyFlag(Boolean.valueOf(attributes.getAttribute(AdditionalAttributes.STAFFONLYFLAG)));
bibRecord.setUpdatedBy(attributes.getAttribute(AdditionalAttributes.UPDATED_BY));
}
businessObjectService.save(bibRecord);
requestDocument.setUuid(DocumentUniqueIDPrefix.getPrefixedId(bibRecord.getUniqueIdPrefix(), bibRecord.getBibId()));
buildResponseDocument(requestDocument, bibRecord, responseDocument);
}
示例12: getOrderType
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
public boolean getOrderType(BigDecimal purchaseOrderTypeId) {
BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
Map map = new HashMap();
map.put("purchaseOrderTypeId",purchaseOrderTypeId);
PurchaseOrderType purchaseOrderType = businessObjectService.findByPrimaryKey(PurchaseOrderType.class,map);
if(purchaseOrderType != null && purchaseOrderType.getPurchaseOrderType().equals(OLEConstants.ORDER_TYPE_VALUE)) {
return true;
}
return false;
}
示例13: initLocationDetails
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
public static List<KeyValue> initLocationDetails() {
List<KeyValue> options = new ArrayList<KeyValue>();
BusinessObjectService businessObjectService = KRADServiceLocator.getBusinessObjectService();
Map parentCriteria1 = new HashMap();
parentCriteria1.put("levelCode", "SHELVING");
List<OleLocationLevel> oleLocationLevel = (List<OleLocationLevel>) businessObjectService.findMatching(OleLocationLevel.class, parentCriteria1);
String shelvingId = oleLocationLevel.get(0).getLevelId();
options.add(new ConcreteKeyValue("", ""));
Map parentCriteria = new HashMap();
parentCriteria.put("levelId", shelvingId);
Collection<OleLocation> oleLocationCollection = businessObjectService.findMatching(OleLocation.class, parentCriteria);
for (OleLocation oleLocation : oleLocationCollection) {
String locationName = oleLocation.getLocationName();
String levelId = oleLocation.getLevelId();
String levelCode = oleLocation.getLocationCode();
boolean parentId = oleLocation.getParentLocationId() != null ? true : false;
while (parentId) {
Map criteriaMap = new HashMap();
criteriaMap.put("locationId", oleLocation.getParentLocationId());
OleLocation location = businessObjectService.findByPrimaryKey(OleLocation.class,
criteriaMap);
if (locationName != null) {
locationName = location.getLocationName() + "/" + locationName;
}
if (levelCode != null) {
levelCode = location.getLocationCode() + "/" + levelCode;
}
parentId = location.getParentLocationId() != null ? true : false;
oleLocation = location;
}
//String key = levelCode + "|" + locationName;
options.add(new ConcreteKeyValue(levelCode, levelCode));
}
return options;
}
示例14: findGeneralLedgerEntry
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* Retrieves the CAB General Ledger Entry from DB
*
* @param generalLedgerEntryId Entry Id
* @return GeneralLedgerEntry
*/
protected GeneralLedgerEntry findGeneralLedgerEntry(Long generalLedgerEntryId, boolean requireNew) {
BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
Map<String, Object> pkeys = new HashMap<String, Object>();
pkeys.put(CabPropertyConstants.GeneralLedgerEntry.GENERAL_LEDGER_ACCOUNT_IDENTIFIER, generalLedgerEntryId);
if (requireNew) {
pkeys.put(CabPropertyConstants.GeneralLedgerEntry.ACTIVITY_STATUS_CODE, CabConstants.ActivityStatusCode.NEW);
}
GeneralLedgerEntry entry = boService.findByPrimaryKey(GeneralLedgerEntry.class, pkeys);
return entry;
}
示例15: handleRequestFromLookup
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* This method handles the request coming from asset lookup screen
*
* @param request Request
* @param equipmentLoanOrReturnForm Current form
* @param equipmentLoanOrReturnDocument Document
* @param service Business Object Service
* @param asset Asset
* @return Asset
*/
protected Asset handleRequestFromLookup(HttpServletRequest request, EquipmentLoanOrReturnForm equipmentLoanOrReturnForm, EquipmentLoanOrReturnDocument equipmentLoanOrReturnDocument, BusinessObjectService businessObjectService, Asset asset) {
Asset newAsset = asset;
if (equipmentLoanOrReturnForm.getDocId() == null && asset == null) {
newAsset = new Asset();
HashMap<String, Object> keys = new HashMap<String, Object>();
String capitalAssetNumber = request.getParameter(CAPITAL_ASSET_NUMBER);
keys.put(CAPITAL_ASSET_NUMBER, capitalAssetNumber);
newAsset = (Asset) businessObjectService.findByPrimaryKey(Asset.class, keys);
// set document status
equipmentLoanOrReturnDocument.setNewLoan(true);
equipmentLoanOrReturnDocument.setReturnLoan(false);
if (newAsset != null) {
// populate equipmentLoanOrReturn info when loan type is renew or return loan
if (!request.getParameter(CamsConstants.AssetActions.LOAN_TYPE).equals(CamsConstants.AssetActions.LOAN)) {
populateEquipmentLoanOrReturnDocument(equipmentLoanOrReturnDocument, newAsset);
equipmentLoanOrReturnDocument.setNewLoan(false);
}
// populate loan return date when loan type is return loan
if (request.getParameter(CamsConstants.AssetActions.LOAN_TYPE).equals(CamsConstants.AssetActions.LOAN_RETURN)) {
equipmentLoanOrReturnDocument.setLoanReturnDate(SpringContext.getBean(DateTimeService.class).getCurrentSqlDate());
equipmentLoanOrReturnDocument.setReturnLoan(true);
}
// reset loan date and expect return date for renew loan
if (request.getParameter(CamsConstants.AssetActions.LOAN_TYPE).equals(CamsConstants.AssetActions.LOAN_RENEW)) {
equipmentLoanOrReturnDocument.setLoanDate(SpringContext.getBean(DateTimeService.class).getCurrentSqlDate());
equipmentLoanOrReturnDocument.setExpectedReturnDate(null);
}
equipmentLoanOrReturnDocument.setCapitalAssetNumber(newAsset.getCapitalAssetNumber());
equipmentLoanOrReturnDocument.setAsset(newAsset);
}
}
return newAsset;
}