首页 > 其他 > 详细

BOTP代码调用

时间:2015-04-20 10:58:35      阅读:180      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!