zoukankan      html  css  js  c++  java
  • [转]服务端直接调用BOTP

    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的名称。

  • 相关阅读:
    洛谷 P1430 序列取数
    洛谷 P2042 维护数列
    洛谷 P3391 【模板】文艺平衡树(Splay)
    Permutation UVA
    treap板子(洛谷 P3369 【模板】普通平衡树(Treap/SBT))
    Jumping Jack CodeForces
    Increasing Sequence CodeForces
    Cunning Gena CodeForces
    Hie with the Pie POJ
    ACboy needs your help HDU
  • 原文地址:https://www.cnblogs.com/oktell/p/4601542.html
Copyright © 2011-2022 走看看