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


Java Note.setNotePostedTimestampToCurrent方法代码示例

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


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

示例1: addNotes

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
protected void addNotes(String documentNumber, List<SubObjectCode> listOfSubObjects, String messageKey, PersistableBusinessObject noteParent, Note noteTemplate) {
    for (int i = 0; i < listOfSubObjects.size(); i += getNumSubObjectsPerNote()) {
        try {
            String subAccountString = createSubObjectChunk(listOfSubObjects, i, i + getNumSubObjectsPerNote());
            if (StringUtils.isNotBlank(subAccountString)) {
                String noteTextTemplate = kualiConfigurationService.getPropertyValueAsString(messageKey);
                String noteText = MessageFormat.format(noteTextTemplate, subAccountString);
                Note note = noteService.createNote(noteTemplate, noteParent, GlobalVariables.getUserSession().getPrincipalId());
                note.setNoteText(noteText);
                note.setNotePostedTimestampToCurrent();
                noteService.save(note);
            }
        }
        catch (Exception e) {
            LOG.error("Unable to create/save notes for document " + documentNumber, e);
            throw new RuntimeException("Unable to create/save notes for document " + documentNumber, e);
        }
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:20,代码来源:SubObjectTrickleDownInactivationServiceImpl.java

示例2: addMaintenanceLockedNotes

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
protected void addMaintenanceLockedNotes(String documentNumber, Map<SubObjectCode, String> lockedSubObjects, String messageKey, PersistableBusinessObject noteParent, Note noteTemplate) {
    for (Map.Entry<SubObjectCode, String> entry : lockedSubObjects.entrySet()) {
        try {
            SubObjectCode subObjCd = entry.getKey();
            String subObjectString = subObjCd.getUniversityFiscalYear() + " - " + subObjCd.getChartOfAccountsCode() + " - " + subObjCd.getAccountNumber() + " - " + subObjCd.getFinancialObjectCode() + " - " + subObjCd.getFinancialSubObjectCode();
            if (StringUtils.isNotBlank(subObjectString)) {
                String noteTextTemplate = kualiConfigurationService.getPropertyValueAsString(messageKey);
                String noteText = MessageFormat.format(noteTextTemplate, subObjectString, entry.getValue());
                Note note = noteService.createNote(noteTemplate, noteParent, GlobalVariables.getUserSession().getPrincipalId());
                note.setNoteText(noteText);
                note.setNotePostedTimestampToCurrent();
                noteService.save(note);
            }
        }
        catch (Exception e) {
            LOG.error("Unable to create/save notes for document " + documentNumber, e);
            throw new RuntimeException("Unable to create/save notes for document " + documentNumber, e);
        }
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:21,代码来源:SubObjectTrickleDownInactivationServiceImpl.java

示例3: addNotes

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
protected void addNotes(String documentNumber, List<SubAccount> listOfSubAccounts, String messageKey, PersistableBusinessObject noteParent, Note noteTemplate) {
    for (int i = 0; i < listOfSubAccounts.size(); i += getNumSubAccountsPerNote()) {
        try {
            String subAccountString = createSubAccountChunk(listOfSubAccounts, i, i + getNumSubAccountsPerNote());
            if (StringUtils.isNotBlank(subAccountString)) {
                String noteTextTemplate = kualiConfigurationService.getPropertyValueAsString(messageKey);
                String noteText = MessageFormat.format(noteTextTemplate, subAccountString);
                Note note = noteService.createNote(noteTemplate, noteParent, GlobalVariables.getUserSession().getPrincipalId());
                note.setNoteText(noteText);
                note.setNotePostedTimestampToCurrent();
                noteService.save(note);
            }
        }
        catch (Exception e) {
            LOG.error("Unable to create/save notes for document " + documentNumber, e);
            throw new RuntimeException("Unable to create/save notes for document " + documentNumber, e);
        }
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:20,代码来源:SubAccountTrickleDownInactivationServiceImpl.java

示例4: isVendorContractExpired

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.vnd.document.service.VendorService#isVendorContractExpired(org.kuali.kfs.vnd.businessobject.VendorDetail)
 */
@Override
public boolean isVendorContractExpired(Document document, VendorDetail vendorDetail) {
    boolean isExpired = false;

    Date currentDate = SpringContext.getBean(DateTimeService.class).getCurrentSqlDate();

    List<VendorContract> vendorContracts = vendorDetail.getVendorContracts();
    List<Note> notes = document.getNotes();

    for (VendorContract vendorContract : vendorContracts) {
        if (currentDate.compareTo(vendorContract.getVendorContractEndDate()) > 0 || !vendorContract.isActive()) {
            Note newNote = new Note();
            newNote.setNoteText("Vendor Contract: " + vendorContract.getVendorContractName() + " contract has expired contract end date.");
            newNote.setNotePostedTimestampToCurrent();
            newNote.setNoteTypeCode(OLEConstants.NoteTypeEnum.BUSINESS_OBJECT_NOTE_TYPE.getCode());
            Note note = noteService.createNote(newNote, vendorDetail, GlobalVariables.getUserSession().getPrincipalId());
            notes.add(note);
            return true;
        }
    }

    return isExpired;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:27,代码来源:VendorServiceImpl.java

示例5: addNoteForCommodityCodeToVendor

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * Creates a note to be added to the Vendor Maintenance Document which is spawned from the PurchaseOrderDocument.
 *
 * @param maintainable
 * @param documentNumber
 * @param poID
 */
protected void addNoteForCommodityCodeToVendor(Maintainable maintainable, String documentNumber, Integer poID) {
    Note newBONote = new Note();
    newBONote.setNoteText("Change vendor document ID <" + documentNumber + ">. Document was automatically created from PO <" + poID + "> to add commodity codes used on this PO that were not yet assigned to this vendor.");
    try {

        newBONote = noteService.createNote(newBONote, maintainable.getBusinessObject(), GlobalVariables.getUserSession().getPrincipalId());
        newBONote.setNotePostedTimestampToCurrent();
    }
    catch (Exception e) {
        throw new RuntimeException("Caught Exception While Trying To Add Note to Vendor", e);
    }
    List<Note> noteList = noteService.getByRemoteObjectId(maintainable.getBusinessObject().getObjectId());
    noteList.add(newBONote);
    noteService.saveNoteList(noteList);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:23,代码来源:PurchaseOrderServiceImpl.java

示例6: isVendorContractExpired

import org.kuali.rice.krad.bo.Note; //导入方法依赖的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;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:26,代码来源:VendorServiceImpl.java

示例7: setNewNoteProperties

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * Defaults properties (posted timestamp, object id, author) on the note instance that will be added.
 *
 * @param form form instance containing the add note instance
 * @param document document instance the note will be added to
 * @param newNote note instance to set properties on
 */
protected void setNewNoteProperties(DocumentFormBase form, Document document, Note newNote) {
    newNote.setNotePostedTimestampToCurrent();
    newNote.setRemoteObjectIdentifier(document.getNoteTarget().getObjectId());

    Person kualiUser = GlobalVariables.getUserSession().getPerson();
    if (kualiUser == null) {
        throw new IllegalStateException("Current UserSession has a null Person.");
    }

    newNote.setAuthorUniversalIdentifier(kualiUser.getPrincipalId());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:DocumentControllerServiceImpl.java

示例8: addNoteForCommodityCodeToVendor

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * Creates a note to be added to the Vendor Maintenance Document which is spawned from the PurchaseOrderDocument.
 *
 * @param maintainable
 * @param documentNumber
 * @param poID
 */
protected void addNoteForCommodityCodeToVendor(Maintainable maintainable, String documentNumber, Integer poID) {
    Note newBONote = new Note();
    newBONote.setNoteText("Change vendor document ID <" + documentNumber + ">. Document was automatically created from PO <" + poID + "> to add commodity codes used on this PO that were not yet assigned to this vendor.");
    try {

        newBONote = noteService.createNote(newBONote, maintainable.getBusinessObject(), GlobalVariables.getUserSession().getPrincipalId());
        newBONote.setNotePostedTimestampToCurrent();
    } catch (Exception e) {
        throw new RuntimeException("Caught Exception While Trying To Add Note to Vendor", e);
    }
    List<Note> noteList = noteService.getByRemoteObjectId(maintainable.getBusinessObject().getObjectId());
    noteList.add(newBONote);
    noteService.saveNoteList(noteList);
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:22,代码来源:PurchaseOrderServiceImpl.java

示例9: createNote

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
private Note createNote(String noteText, String noteTarget, String principalId) {
    Note note = new Note();
    note.setRemoteObjectIdentifier(noteTarget);
    note.setNoteText(StringUtils.abbreviate(noteText,800));
    note.setAuthorUniversalIdentifier(principalId);
    note.setNotePostedTimestampToCurrent();
    return note;
}
 
开发者ID:kuali-mirror,项目名称:kpme,代码行数:9,代码来源:PositionMaintainableServiceImpl.java

示例10: getNewBoNoteForAdding

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * creates a new bo note and sets the timestamp.
 * 
 * @return a newly created note
 */
protected Note getNewBoNoteForAdding(String prefix) {
    Note newBoNote = new Note();
    newBoNote.setNoteText(prefix + " vendor document ID " + getDocumentNumber());
    newBoNote.setNotePostedTimestampToCurrent();
   
        try {
        newBoNote = SpringContext.getBean(NoteService.class).createNote(newBoNote, this.getBusinessObject(), GlobalVariables.getUserSession().getPrincipalId());
        }
        catch (Exception e) {
            throw new RuntimeException("Caught Exception While Trying To Add Note to Vendor", e);
        }
    
    return newBoNote;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:20,代码来源:VendorMaintainableImpl.java

示例11: addNoteForInvoiceReportFail

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
protected void addNoteForInvoiceReportFail(ContractsGrantsInvoiceDocument document) {
    Note note = new Note();
    note.setNotePostedTimestampToCurrent();
    note.setNoteText(configurationService.getPropertyValueAsString(ArKeyConstants.ERROR_FILE_UPLOAD_NO_PDF_FILE_SELECTED_FOR_SAVE));
    note.setNoteTypeCode(KFSConstants.NoteTypeEnum.BUSINESS_OBJECT_NOTE_TYPE.getCode());
    Person systemUser = personService.getPersonByPrincipalName(KFSConstants.SYSTEM_USER);
    note = noteService.createNote(note, document.getNoteTarget(), systemUser.getPrincipalId());
    noteService.save(note);
    document.addNote(note);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:11,代码来源:ContractsGrantsInvoiceDocumentServiceImpl.java

示例12: createCustomerNote

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
@Override
public void createCustomerNote(String customerNumber, String customerNote) {
    Customer customer = getByPrimaryKey(customerNumber);
    if (StringUtils.isNotBlank(customerNote)) {
        Note newBONote = new Note();
        newBONote.setNoteText(customerNote);
        newBONote.setNotePostedTimestampToCurrent();
        newBONote.setNoteTypeCode(KFSConstants.NoteTypeEnum.BUSINESS_OBJECT_NOTE_TYPE.getCode());
        Note note = noteService.createNote(newBONote, customer, GlobalVariables.getUserSession().getPrincipalId());
        noteService.save(note);
      }
   }
 
开发者ID:kuali,项目名称:kfs,代码行数:13,代码来源:CustomerServiceImpl.java

示例13: createVendorNote

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
public void createVendorNote(VendorDetail vendorDetail, String vendorNote) {
    try {
        if (StringUtils.isNotBlank(vendorNote)) {
            Note newBONote = new Note();
            newBONote.setNoteText(vendorNote);
            newBONote.setNotePostedTimestampToCurrent();
            newBONote.setNoteTypeCode(KFSConstants.NoteTypeEnum.BUSINESS_OBJECT_NOTE_TYPE.getCode());
            Note note = noteService.createNote(newBONote, vendorDetail, GlobalVariables.getUserSession().getPrincipalId());
            noteService.save(note);
        }
    } catch (Exception e){
        throw new RuntimeException("Problems creating note for Vendor " + vendorDetail);
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:15,代码来源:VendorServiceImpl.java

示例14: getNewBoNoteForAdding

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * creates a new bo note and sets the timestamp.
 *
 * @return a newly created note
 */
protected Note getNewBoNoteForAdding(String prefix) {
    Note newBoNote = new Note();
    newBoNote.setNoteText(prefix + " vendor document ID " + getDocumentNumber());
    newBoNote.setNotePostedTimestampToCurrent();

    try {
        newBoNote = SpringContext.getBean(NoteService.class).createNote(newBoNote, this.getBusinessObject(), GlobalVariables.getUserSession().getPrincipalId());
    }
    catch (Exception e) {
        throw new RuntimeException("Caught Exception While Trying To Add Note to Vendor", e);
    }

    return newBoNote;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:20,代码来源:VendorMaintainableImpl.java

示例15: submit

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
@RequestMapping(params = "methodToCall=submit")
  public ModelAndView submit(@ModelAttribute("KualiForm") DocumentFormBase form, BindingResult result, HttpServletRequest request, HttpServletResponse response) throws Exception {
MissedPunchForm missedPunchForm = (MissedPunchForm) form;
      MissedPunchBo aMissedPunch = missedPunchForm.getMissedPunch();
      DictionaryValidationResult validationResults = KRADServiceLocatorWeb.getDictionaryValidationService().validate(((MissedPunchForm) form).getMissedPunch());
  	if (validationResults.getNumberOfErrors() == 0) {
      	
      	// call customized validation on the missed punch before creating document
      	boolean validFlag = new MissedPunchDocumentRule().runValidation(aMissedPunch);
      	if(validFlag) {
           try {
               createDocument(missedPunchForm);
               save(missedPunchForm, result, request, response);
	
               if (StringUtils.isNotBlank(missedPunchForm.getMissedPunch().getNote())) {
                   Document doc = missedPunchForm.getDocument();
                   Note note = new Note();
                   note.setNoteText(missedPunchForm.getMissedPunch().getNote());
                   note.setAuthorUniversalIdentifier(HrContext.getPrincipalId());
                   note.setNotePostedTimestampToCurrent();
                   doc.setNotes(Collections.<Note>singletonList(note));
               }
               ModelAndView modelAndView = route(missedPunchForm, result, request, response);
               missedPunchForm.setMissedPunchSubmitted(true);
	
               return modelAndView;
	
           } catch (ValidationException exception) {
               //ignore
           }
      	}
      }
      return getUIFModelAndView(form);
  }
 
开发者ID:kuali-mirror,项目名称:kpme,代码行数:35,代码来源:MissedPunchDocumentController.java


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