zoukankan      html  css  js  c++  java
  • eas之单据转换规则


    /**
      * BOTP单据转换
      * @param botpNum 转换规则编号
      * @param BillInfo 原单据
      */
     public static void BOTP(String botpNum,CoreBillBaseInfo BillInfo){
      String error = "";
      try {
       // 取得BOPT的映射
       BOTMappingCollection botmapping = BOTMappingFactory.getRemoteInstance().getBOTMappingCollection("select * where    name = '"+botpNum+"'  ");
       BOTMappingInfo btpMappingInfo = null;
       if (botmapping !=null && botmapping.size() == 1) {
        btpMappingInfo = botmapping.get(0);
       } else {
        if(botmapping==null || botmapping.size()<1){
         error = "未找到转换规则  规则编号:"+botpNum;
        }
        if(botmapping.size()>1){
         error = "找到多条转换规则,请删除重复规则。   规则编号:"+botpNum;
        }
        throw new Exception();
       }
       //执行单据转换
       BTPTransformResult transformResult = BTPManagerFactory.getRemoteInstance().transform(BillInfo, btpMappingInfo);

       //取得目标单据列表
       IObjectCollection toBillList = transformResult.getBills();
       
       //保存目标单据
       for (int i = 0; i < toBillList.size(); i++) {  
        CoreBillBaseInfo destBillInfo = (CoreBillBaseInfo) toBillList.getObject(i);
        BTPManagerFactory.getRemoteInstance().saveRelations(destBillInfo, transformResult.getBOTRelationCollection());
       }
       
      } catch (Exception e) {
       if("".equals(error) || error == null){
        alert2("单据转换出错",e.getMessage());
       }else{
        alert2("单据转换出错",error);
       }
      }
     }

  • 相关阅读:
    UIView的常见属性
    Object-C-Foundation-反射
    Object-C-自定义类型归档
    Java集合:HashMap源码剖析
    spring-boot-2.0.3之quartz集成,数据源问题,源码探究
    杂谈篇之我是怎么读源码的,授之以渔
    ElasticSearch 从零到入门
    java实现图片上传功能,并返回图片保存路径
    quartz定时任务及时间设置
    笛子初学者吹什么曲子
  • 原文地址:https://www.cnblogs.com/luojiabao/p/10980372.html
Copyright © 2011-2022 走看看