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


Java DocumentService.createNoteFromDocument方法代码示例

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


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

示例1: addPurchaseOrderNote

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
public void addPurchaseOrderNote(DocumentRouteLevelChange levelChangeEvent) {

        String newNodeName = levelChangeEvent.getNewNodeName();
        if (newNodeName != null
                && (newNodeName.equalsIgnoreCase(PurapWorkflowConstants.BUDGET_NODE) || newNodeName
                .equalsIgnoreCase(PurapWorkflowConstants.FYI_BUDGET))) {
            String note = "";
            if(newNodeName.equalsIgnoreCase(PurapWorkflowConstants.BUDGET_NODE)){
                note = OLEConstants.SufficientFundCheck.PO_NOTE;
            }
            if(newNodeName.equalsIgnoreCase(PurapWorkflowConstants.FYI_BUDGET)){
                note = OLEConstants.SufficientFundCheck.FYI_NOTE;
            }
            DocumentService documentService = SpringContext.getBean(DocumentService.class);
            Note apoNote = documentService.createNoteFromDocument(this, note);
            this.addNote(apoNote);
            documentService.saveDocumentNotes(this);
        }

    }
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:21,代码来源:OlePurchaseOrderDocument.java

示例2: doRouteLevelChange

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * @see org.kuali.rice.kns.document.DocumentBase#handleRouteLevelChange(org.kuali.rice.kew.clientapp.vo.DocumentRouteLevelChangeDTO)
 */
@Override
public void doRouteLevelChange(DocumentRouteLevelChange change) {
    LOG.debug("handleRouteLevelChange() started");
    super.doRouteLevelChange(change);
    try {
        String newNodeName = change.getNewNodeName();
        if (StringUtils.isNotBlank(newNodeName)) {
            RoutingReportCriteria.Builder reportCriteria = RoutingReportCriteria.Builder
                    .createByDocumentIdAndTargetNodeName(getDocumentNumber(), newNodeName);
            List<String> desiredActions = new ArrayList<String>(2);
            desiredActions.add(ActionRequestType.APPROVE.getCode());
            desiredActions.add(ActionRequestType.COMPLETE.getCode());
            String note = "";
            if (newNodeName.equalsIgnoreCase(PurapWorkflowConstants.BUDGET_NODE)
                    || newNodeName.equalsIgnoreCase(PurapWorkflowConstants.FYI_BUDGET)) {
                if (newNodeName.equalsIgnoreCase(PurapWorkflowConstants.BUDGET_NODE)) {
                    note = OLEConstants.SufficientFundCheck.REQ_NOTE;
                }
                if (newNodeName.equalsIgnoreCase(PurapWorkflowConstants.FYI_BUDGET)) {
                    note = OLEConstants.SufficientFundCheck.FYI_NOTE;
                }
                DocumentService documentService = SpringContext.getBean(DocumentService.class);
                Note apoNote = documentService.createNoteFromDocument(this, note);
                this.addNote(apoNote);
                documentService.saveDocumentNotes(this);

            }
        }
    } catch (Exception e) {
        String errorMsg = "Workflow Error found checking actions requests on document with id "
                + getDocumentNumber() + ". *** WILL NOT UPDATE PURAP STATUS ***";
        LOG.error(errorMsg, e);
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:38,代码来源:OleRequisitionDocument.java

示例3: doRouteLevelChange

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * @see org.kuali.rice.krad.document.DocumentBase#doRouteLevelChange(org.kuali.rice.kew.framework.postprocessor.DocumentRouteLevelChange)
 */
@Override
public void doRouteLevelChange(DocumentRouteLevelChange levelChangeEvent) {

    super.doRouteLevelChange(levelChangeEvent);
    try {
        String newNodeName = levelChangeEvent.getNewNodeName();
        List<String> desiredActions = new ArrayList<String>(2);
        RoutingReportCriteria.Builder reportCriteria = RoutingReportCriteria.Builder
                .createByDocumentIdAndTargetNodeName(getDocumentNumber(), newNodeName);
        desiredActions.add(ActionRequestType.APPROVE.getCode());
        desiredActions.add(ActionRequestType.COMPLETE.getCode());
        if (KewApiServiceLocator.getWorkflowDocumentActionsService().documentWillHaveAtLeastOneActionRequest(
                reportCriteria.build(), desiredActions, false)) {
            if (StringUtils.isNotBlank(newNodeName)) {
                if (StringUtils.isNotBlank(newNodeName)) {
                    if (newNodeName.equalsIgnoreCase(PurapWorkflowConstants.BUDGET_NODE)
                            || newNodeName.equalsIgnoreCase(PurapWorkflowConstants.FYI_BUDGET)) {
                        String note = OLEConstants.SufficientFundCheck.PREQ_NOTE;
                        DocumentService documentService = SpringContext.getBean(DocumentService.class);
                        Note apoNote = documentService.createNoteFromDocument(this, note);
                        this.addNote(apoNote);
                        documentService.saveDocumentNotes(this);
                    }
                }
            }
        }
    } catch (Exception e) {
        String errorMsg = "Workflow Error found checking actions requests on document with id "
                + getDocumentNumber() + ". *** WILL NOT UPDATE PURAP STATUS ***";
        LOG.error(errorMsg, e);
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:36,代码来源:OlePaymentRequestDocument.java

示例4: addPurchaseOrderNote

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
public void addPurchaseOrderNote(DocumentRouteLevelChange levelChangeEvent) {

        String newNodeName = levelChangeEvent.getNewNodeName();
        RoutingReportCriteria.Builder reportCriteria = RoutingReportCriteria.Builder
                .createByDocumentIdAndTargetNodeName(getDocumentNumber(), newNodeName);
        if (newNodeName != null
                && (newNodeName.equalsIgnoreCase(PurapWorkflowConstants.BUDGET_NODE) || newNodeName
                .equalsIgnoreCase(PurapWorkflowConstants.FYI_BUDGET))) {
            String note = "";
            if(newNodeName.equalsIgnoreCase(PurapWorkflowConstants.BUDGET_NODE)){
                 note = OLEConstants.SufficientFundCheck.POA_NOTE;
            }
            if(newNodeName.equalsIgnoreCase(PurapWorkflowConstants.FYI_BUDGET)){
                note = OLEConstants.SufficientFundCheck.FYI_NOTE;
            }
            DocumentService documentService = SpringContext.getBean(DocumentService.class);
            Note apoNote = documentService.createNoteFromDocument(this, note);
            this.addNote(apoNote);
            String documentTypeName = this.getDocumentHeader().getWorkflowDocument().getDocumentTypeName();
            if (documentTypeName != null
                    && documentTypeName.equals(OLEConstants.FinancialDocumentTypeCodes.PURCHASE_ORDER_AMENDMENT)) {
                documentService.saveDocumentNotes(this);
            }

        }

    }
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:28,代码来源:OlePurchaseOrderAmendmentDocument.java

示例5: doRouteLevelChange

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * @see org.kuali.rice.krad.document.DocumentBase#doRouteLevelChange(org.kuali.rice.kew.framework.postprocessor.DocumentRouteLevelChange)
 */
@Override
public void doRouteLevelChange(DocumentRouteLevelChange levelChangeEvent) {

    super.doRouteLevelChange(levelChangeEvent);
    try {
        String newNodeName = levelChangeEvent.getNewNodeName();
        List<String> desiredActions = new ArrayList<String>(2);
        RoutingReportCriteria.Builder reportCriteria = RoutingReportCriteria.Builder
                .createByDocumentIdAndTargetNodeName(getDocumentNumber(), newNodeName);
        desiredActions.add(ActionRequestType.APPROVE.getCode());
        desiredActions.add(ActionRequestType.FYI.getCode());
        desiredActions.add(ActionRequestType.COMPLETE.getCode());
        if (KewApiServiceLocator.getWorkflowDocumentActionsService().documentWillHaveAtLeastOneActionRequest(
                reportCriteria.build(), desiredActions, false)) {
            if (StringUtils.isNotBlank(newNodeName)) {
                if (StringUtils.isNotBlank(newNodeName)) {
                    if (newNodeName.equalsIgnoreCase(PurapWorkflowConstants.BUDGET_NODE)
                            || newNodeName.equalsIgnoreCase(PurapWorkflowConstants.FYI_BUDGET)) {
                        String note = "";
                        if (newNodeName.equalsIgnoreCase(PurapWorkflowConstants.BUDGET_NODE)) {
                            note = OLEConstants.SufficientFundCheck.INV_NOTE;
                        }
                        if (newNodeName.equalsIgnoreCase(PurapWorkflowConstants.FYI_BUDGET)) {
                            note = OLEConstants.SufficientFundCheck.FYI_NOTE;
                        }
                        DocumentService documentService = SpringContext.getBean(DocumentService.class);
                        Note apoNote = documentService.createNoteFromDocument(this, note);
                        this.addNote(apoNote);
                        documentService.saveDocumentNotes(this);
                    }
                }
            }
        }
    } catch (Exception e) {
        String errorMsg = "Workflow Error found checking actions requests on document with id "
                + getDocumentNumber() + ". *** WILL NOT UPDATE PURAP STATUS ***";
        LOG.error(errorMsg, e);
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:43,代码来源:OleInvoiceDocument.java

示例6: addDocumentNoteAfterClosing

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * @see org.kuali.ole.module.cg.service.CloseService#addDocumentNoteAfterClosing(String)
 */
protected boolean addDocumentNoteAfterClosing(ProposalAwardCloseDocument close, String noteText) {
    DocumentService service = SpringContext.getBean(DocumentService.class);
    try {
        service.createNoteFromDocument(close, noteText);
        service.approveDocument(close, noteText, null);
    }
    catch (WorkflowException we) {
        we.printStackTrace();
        return false;
    }
    return true;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:16,代码来源:CloseServiceImpl.java

示例7: cancelAccountsPayableDocumentByCheckingDocumentStatus

import org.kuali.rice.krad.service.DocumentService; //导入方法依赖的package包/类
/**
 * @see org.kuali.ole.module.purap.document.service.AccountsPayableService#cancelAccountsPayableDocumentByCheckingDocumentStatus(org.kuali.ole.module.purap.document.AccountsPayableDocument, java.lang.String)
 */
@Override
public void cancelAccountsPayableDocumentByCheckingDocumentStatus(AccountsPayableDocument document, String noteText) throws Exception {
    DocumentService documentService = SpringContext.getBean(DocumentService.class);

    if (PurapConstants.CreditMemoStatuses.APPDOC_IN_PROCESS.equals(document.getApplicationDocumentStatus())) {
        //prior to submit, just call regular cancel logic
        documentService.cancelDocument(document, noteText);
    } else if (PurapConstants.CreditMemoStatuses.APPDOC_AWAITING_ACCOUNTS_PAYABLE_REVIEW.equals(document.getApplicationDocumentStatus())) {
        //while awaiting AP approval, just call regular disapprove logic as user will have action request
        documentService.disapproveDocument(document, noteText);
    } else if (document instanceof PaymentRequestDocument && PurapConstants.PaymentRequestStatuses.APPDOC_AWAITING_FISCAL_REVIEW.equals(document.getApplicationDocumentStatus()) && ((PaymentRequestDocument) document).isPaymentRequestedCancelIndicator()) {
        // special logic to disapprove PREQ as the fiscal officer
        DocumentActionParameters.Builder p = DocumentActionParameters.Builder.create(document.getDocumentNumber(), document.getLastActionPerformedByPersonId());
        p.setAnnotation("Document cancelled after requested cancel by " + GlobalVariables.getUserSession().getPrincipalName());
        KewApiServiceLocator.getWorkflowDocumentActionsService().disapprove(p.build());
    } else {
        UserSession originalUserSession = GlobalVariables.getUserSession();
        WorkflowDocument originalWorkflowDocument = document.getDocumentHeader().getWorkflowDocument();
        //any other time, perform special logic to cancel the document
        if (!document.getDocumentHeader().getWorkflowDocument().isApproved()) {
            try {
                // person canceling may not have an action requested on the document
                Person userRequestedCancel = SpringContext.getBean(PersonService.class).getPerson(document.getLastActionPerformedByPersonId());
                GlobalVariables.setUserSession(new UserSession(getOleSelectDocumentService().getSelectParameterValue(OLEConstants.SYSTEM_USER)));

                WorkflowDocumentService workflowDocumentService = SpringContext.getBean(WorkflowDocumentService.class);
                WorkflowDocument newWorkflowDocument = workflowDocumentService.loadWorkflowDocument(document.getDocumentNumber(), GlobalVariables.getUserSession().getPerson());
                document.getDocumentHeader().setWorkflowDocument(newWorkflowDocument);

                String annotation = "Document Cancelled by user " + originalUserSession.getPerson().getName() + " (" + originalUserSession.getPerson().getPrincipalName() + ")";
                if (ObjectUtils.isNotNull(userRequestedCancel)) {
                    annotation.concat(" per request of user " + userRequestedCancel.getName() + " (" + userRequestedCancel.getPrincipalName() + ")");
                }
                documentService.superUserDisapproveDocument(document, annotation);
            } finally {
                GlobalVariables.setUserSession(originalUserSession);
                document.getDocumentHeader().setWorkflowDocument(originalWorkflowDocument);
            }
        } else {
            // call gl method here (no reason for post processing since workflow done)
            SpringContext.getBean(AccountsPayableService.class).cancelAccountsPayableDocument(document, "");
            document.getDocumentHeader().getWorkflowDocument().logAnnotation("Document Cancelled by user " + originalUserSession.getPerson().getName() + " (" + originalUserSession.getPerson().getPrincipalName() + ")");
        }
    }

    Note noteObj = documentService.createNoteFromDocument(document, noteText);
    document.addNote(noteObj);
    SpringContext.getBean(NoteService.class).save(noteObj);
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:53,代码来源:AccountsPayableServiceImpl.java


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