金蝶EAS 通过代码调用BOTP生成下游单据
作者:互联网
Test1Info test1Info = new Test1Info();
Test1Info test1Info = new Test1Info();
IBOTRelation ibot = BOTRelationFactory.getLocalInstance(ctx);
IBOTMapping ibm = BOTMappingFactory.getLocalInstance(ctx);
BOTMappingCollection bc = ibm.getBOTMappingCollection("where name = 'BE007'");
String botmaid = "";
if(bc!=null && bc.size()>0){
botmaid = bc.get(0).getId().toString();
}
createBotRelation(ctx, test1Info, test1Info, ibot, botmaid);
/**
* 生成关联关系
* @param test1Info 源单据对象
* @param test2Info 目标单据对象
*/
private void createBotRelation(Context ctx,Test1Info test1Info,Test2Info test2Info,IBOTRelation ibot,String botmid) throws BOSException{
ArrayList list = ibot.getSrcObjIdBySrcType(test2Info.getId().toString(),test1Info.getBOSType().toString());
if(list!=null && list.size()>0){
return;
}
BOTRelationInfo relation = new BOTRelationInfo();
relation.setAvailable(true);
relation.setBOTMappingID(botmid);
relation.setSrcObjectID(test1Info.getId().toString());
relation.setSrcEntityID(test1Info.getBOSType().toString());
relation.setOperatorID("user");
relation.setDestObjectID(test2Info.getId().toString());
relation.setDestEntityID(test2Info.getBOSType().toString());
relation.setIsEffected(false);
relation.setType(0);
relation.setDate(new Date());
ibot.addnew(relation);
}
标签:Test1Info,金蝶,test1Info,toString,test2Info,BOTP,EAS,ibot,relation 来源: https://blog.csdn.net/sinat_21634237/article/details/112602091