码迷,mamicode.com
首页 > 其他好文 > 详细

BOTP代码调用

时间:2015-04-20 10:59:10      阅读:184      评论:0      收藏:0      [点我收藏+]

标签:

//根据映射名称,获取映射关系对应的主键

public static IObjectPK getBotmpID(Context ctx){
  String sql = "select fid from T_BOT_Mapping t where t.fname = ?";
  IRowSet rowset = null;
  try {
    rowset = DbUtil.executeQuery(ctx,sql,new Object[]{ruleName});
    if(rowset.next())
      return new ObjectUuidPK(rowset.getString("fid"));
  } catch (BOSException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
  }
  return null;
}

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);
  }
}

原文链接:http://xy0792.iteye.com/blog/789210

BOTP代码调用

标签:

原文地址:http://www.cnblogs.com/cyhj/p/4440740.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!