關於EAS 套打配置審批結果資訊的相關思路

來源:互聯網
上載者:User

在我們配置套開啟發的時候,有時候我們需要單據流程的審批結果資訊,對於有的流程我們可能異常終止過,我們如果需要擷取當前的審批結果資訊的話的情況,我們可以參考一下幾點思路

1、首先需要在套打管理中新增一個動態中繼資料 其中名稱、別名可以自訂

2、在欄位列表中添加我們需要套打出來的欄位 比如 審批人、審批結果、審批意見  類型(String)

3、在我們的套打模版(套打設計器中添加審批意見元素據)————資料——添加中繼資料——套打元素據,選擇我們的審批中繼資料

4、在我們的editUI中編寫代碼(重寫方法,一級對應的sql)
    public void actionPrint_actionPerformed(ActionEvent e) throws Exception {
          ArrayList idList = new ArrayList();
            if (editData != null && !StringUtils.isEmpty(editData.getString("id"))) {
                idList.add(editData.getString("id"));
            }
            if (idList == null || idList.size() == 0 || getTDQueryPK() == null || getTDFileName() == null)
                return;
            MyDataProvider data = new MyDataProvider();
            com.kingdee.bos.ctrl.report.forapp.kdnote.client.KDNoteHelper appHlp = new com.kingdee.bos.ctrl.report.forapp.kdnote.client.KDNoteHelper();
            appHlp.printPreview(getTDFileName(), data, javax.swing.SwingUtilities.getWindowAncestor(this));
        super.actionPrint_actionPerformed(e);
    }

    public void actionPrintPreview_actionPerformed(ActionEvent e)
            throws Exception {
          ArrayList idList = new ArrayList();
            if (editData != null && !StringUtils.isEmpty(editData.getString("id"))) {
                idList.add(editData.getString("id"));
            }
            if (idList == null || idList.size() == 0 || getTDQueryPK() == null || getTDFileName() == null)
                return;
            MyDataProvider data = new MyDataProvider();
            com.kingdee.bos.ctrl.report.forapp.kdnote.client.KDNoteHelper appHlp = new com.kingdee.bos.ctrl.report.forapp.kdnote.client.KDNoteHelper();
            appHlp.printPreview(getTDFileName(), data, javax.swing.SwingUtilities.getWindowAncestor(this));
        super.actionPrintPreview_actionPerformed(e);
    }

    
    public class MyDataProvider extends AbstractPrintDataProvider{

        
        @Override
        public IRowSet getData(R1PrintDataSource dataSource) throws Exception {
            IRowSet irow = null;
            String curBillID = editData.getId().toString();
            IQueryExecutor iqec = null;  
            FilterInfo filterInfo = new FilterInfo();  
            EntityViewInfo viewInfo = new EntityViewInfo();
            if("PurchaseRequestBillQuery.bos-query".equals(dataSource.getId())){
                iqec = QueryExecutorFactory.getRemoteInstance(new MetaDataPK(  
                        "com.kingdee.eas.custom.office.purchase.app",  
                        "PurchaseRequestBillQuery"));  
                filterInfo.getFilterItems().add(  
                        new FilterItemInfo("id", curBillID,  
                                CompareType.EQUALS));  
                viewInfo.setFilter(filterInfo);  
                iqec.setObjectView(viewInfo);  
                iqec.option().isAutoTranslateBoolean = true;  
                iqec.option().isAutoTranslateEnum = true;  
                            
                try {
                    irow = iqec.executeQuery();
                } catch (BOSException e) {
                    MsgBox.showInfo("擷取套打資料有誤:"+e.getMessage());
                }
                
                
            }
            if("PurchaseRequestAppove".equals(dataSource.getId())){

                FilterInfo filter= WfUtils.getApproveFilter(curBillID);
                String filterSql=filter.toSql();
                filterSql=filterSql.substring(filterSql.indexOf("IN"));
                StringBuffer sql = new StringBuffer();
                sql.append("SELECT ");
                sql.append("A.FID AS billID2,")
                    .append("A.FCreateTime as auditDate,")
                    .append("A.FIsPass  as auditResult,")
                    .append("B.FName_l2 as auditPerson,")
                    .append("A.FOpinion_l2 as auditAdvise");
                sql.append(" FROM T_BAS_MultiApprove A")
                    .append(" INNER JOIN T_PM_User   B ON A.FCreatorID = B.FID")
                    .append(" INNER JOIN T_BD_Person   C ON B.FPersonId = C.FID");                
                sql.append(" where A.FBillID='").append(curBillID).append("' AND fstatus = 1  and A.fassignmentid ").append(filterSql).append(" order by

A.FCreateTime");
                
                
                ISQLExecutor isexe = SQLExecutorFactory.getRemoteInstance(sql.toString());
                try {
                    irow = isexe.executeSQL();
                    return irow;
                } catch (BOSException e) {
                    MsgBox.showInfo("擷取套打資料有誤:"+e.getMessage());
                }
            }
            if("PurchaseRequestBillR1Query".equals(dataSource.getId())){
                iqec = QueryExecutorFactory.getRemoteInstance(new MetaDataPK(  
                        "com.kingdee.eas.custom.office.purchase.app",  
                        "PurchaseRequestBillR1Query"));  
                filterInfo.getFilterItems().add(  
                        new FilterItemInfo("id", curBillID,  
                                CompareType.EQUALS));  
                viewInfo.setFilter(filterInfo);  
                iqec.setObjectView(viewInfo);  
                iqec.option().isAutoTranslateBoolean = true;  
                iqec.option().isAutoTranslateEnum = true;  
                            
                try {
                    irow = iqec.executeQuery();
                } catch (BOSException e) {
                    MsgBox.showInfo("擷取套打資料有誤:"+e.getMessage());
                }
            }
            return irow;
        
        }
        
    }
    

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.