[轉]服務端直接調用BOTP

來源:互聯網
上載者:User

標籤:

public static void generateDestBill(Context ctx, String srcBosType,            String destBosType, CoreBillBaseCollection srcBillCollection,            IObjectPK botpPK) throws Exception {        IBOTMapping botMapping = BOTMappingFactory.getLocalInstance(ctx);        CoreBillBaseInfo billInfo = srcBillCollection.get(0);        BOTMappingInfo botMappingInfo = botMapping.getMapping(billInfo, destBosType, DefineSysEnum.BTP);        if (botMappingInfo == null) {            throw new FMException(FMException.NODESTBILL);        }        IBTPManager iBTPManager = BTPManagerFactory.getLocalInstance(ctx);        BTPTransformResult btpResult = null;        /*String[] ids = new String[srcBillCollection.size()];        for (int i = 0; i < srcBillCollection.size(); ++i) {            CoreBaseInfo info = srcBillCollection.get(i);            ids[i] = info.getId().toString();        }*/        btpResult = iBTPManager.transformForBotp(srcBillCollection,destBosType, botpPK);        IObjectCollection destBillCols = btpResult.getBills();        BOTRelationCollection botRelationCols = btpResult.getBOTRelationCollection();        for (int i = 0; i < destBillCols.size(); i++) {            CoreBillBaseInfo destBillInfo = (CoreBillBaseInfo) destBillCols.getObject(i);            iBTPManager.submitRelations(destBillInfo, botRelationCols);        }    }

參數說明:

1、ctx :服務端上下文

2、srcBosType:源單據的BosType

3、destBosType:目標單據的BosType

4、srcBillCollection:源單據集合,可以批量轉換

5、botpPK:要使用的BOTP的PK。

可以通過表T_BOT_Mapping尋找到id,將id轉換成PK。

select t.fid from T_BOT_Mapping t where t.fname=‘***‘,***是botp的名稱。

[轉]服務端直接調用BOTP

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.