• [转]服务端直接调用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的名称。

  • 相关阅读:
    js原生实现div渐入渐出
    js刷新界面前事件onbeforeunload
    js手机短信验证
    scroll滚动条样式修改
    省市区三级联动
    js this的含义以及讲解
    炫酷实用的CSS3代码垂直手风琴菜单
    机器学习初探(手写数字识别)HOG图片
    机器学习初探(手写数字识别)matlab读取数据集
    Google B4网络阅读记录(翻译)
  • 原文地址:https://www.cnblogs.com/oktell/p/4601542.html
Copyright © 2020-2023  润新知