botp生成目标数据,并建立上查下查关系
来源:互联网 发布:ehr人力资源软件 编辑:程序博客网 时间:2024/06/06 02:24
代码中调用botp规则来生成目标单据,并建立 上查下查关系的方法:
protected void callBotpService(Context ctx, String botpName,MaterialRequestBillInfo billInfo, List entryIds) throws BOSException, BTPException, EASBizException {
//自动生成XX单据
IBOTMapping botFac = BOTMappingFactory.getLocalInstance(ctx);
BOTMappingInfo botInfo = null;
BOTMappingCollection botCol = botFac.getBOTMappingCollection("select id,srcEntityname,destentityName where name='"+botpName+"' and extRule.isEffected=1 ");
if(botCol.size()==1){
botInfo = botCol.get(0);
}else{
throw new BOSException("BOTP("+botpName+")不存在或未启用!");
}
IBTPManager iBTPManager = BTPManagerFactory.getLocalInstance(ctx);
BTPTransformResult btpResult = iBTPManager.transformForBotp(new String[] { billInfo.getId().toString() }, new String[] { "entry" }, entryIds, null, botInfo.getDestEntityName(),
new ObjectUuidPK(botInfo.getId().toString()),botInfo.getSrcEntityName());
if (btpResult.getBills().size()<=0) {
return;
}
BOTRelationCollection relations = btpResult.getBOTRelationCollection();
Map map = getMapByRelation(relations);
for (int i = 0; i < btpResult.getBills().size(); i++) {
IObjectValue destBillInfo = btpResult.getBills().getObject(i);
CoreBillBaseInfo destBill = (CoreBillBaseInfo) destBillInfo;
BOTRelationCollection botrelationcollection =(BOTRelationCollection)map.get(destBill.getId().toString());
iBTPManager.saveRelations(destBill, botrelationcollection);
}
}
public Map getMapByRelation(BOTRelationCollection relations) {
Map map = new HashMap();
for (int i = 0; i < relations.size(); i++) {
BOTRelationInfo relationInfo = relations.get(i);
String oid = relationInfo.getDestObjectID();
if (map.get(oid) != null) {
BOTRelationCollection botrelationcollection=(BOTRelationCollection) map.get(oid);
botrelationcollection.add(relationInfo);
map.put(oid, botrelationcollection);
} else {
BOTRelationCollection botrelationcollection = new BOTRelationCollection();
botrelationcollection.add(relationInfo);
map.put(oid, botrelationcollection);
}
}
return map;
关联关系表头:实体(BOTRelation)表(T_BOT_Relation)字段别名参考值描述srcEntityID源实体BosTypeBFBCAD51bosTypedestEntityID目标实体BosType500AB75EbosTypesrcObjectID源对象IDkcYAAAIQ0ui/vK1RiddestObjectID目标对象IDrV/n+mBsQcW1681XLqJCelAKt14=iddate转换日期2013/12/300:00:00当前日期operatorID操作ID87212(当前人的名称编号都可以)relationEntries关系分录对应分录,每条分录都对一个分录规则BOTMappingID转换规则idjxIXJwEREADgAE3AfwAAAQRRIsQ=id(实体:BOTMapping
表:T_BOT_Mapping)botp规则的idisEffected是否生效1type类型0
参考语句:insert into T_BOT_Relation(fid,fsrcEntityID,fdestEntityID,fsrcObjectID,fdestObjectID,foperatorID,fBOTMappingID,fisEffected,ftype)
values(newbosid('59302EC6'),'C48A423A','CC3E933B','iMsAAAAHsMHEikI6','iMsAAAAHsOTMPpM7','user','6a7669e6-0108-1000-e000-2136c0a812fd045122C4',1,0) 关联关系分录:实体(BOTRelationEntry)表(T_BOT_RelationEntry)字段别名参考值描述srcObjectID源对象IDkcYAAAIQ0ui/vK1R表头记录的源对象IDdestObjectID目标对象IDrV/n+mBsQcW1681XLqJCelAKt14=表头记录的目标对象IDsrcEntryID源分录IDkcYAAAIQ0ul6YBWh记录源分录对象IDdestEntryID目标分录IDeV3H6QkzQpuenoWSZNxcUhF3S7Q=记录目标分录对象IDsrcEntryPropName源分录属性名__src.entry可为空destEntryPropName目标分录属性名__dest.entry可为空srcPropertyName源属性名为空即可destPropertyName目标属性名id统一id即可value值为空即可relation单头idwWqp5eBTTnaYUcZP4AtDZFkwLsY=记录单头id
protected void callBotpService(Context ctx, String botpName,MaterialRequestBillInfo billInfo, List entryIds) throws BOSException, BTPException, EASBizException {
//自动生成XX单据
IBOTMapping botFac = BOTMappingFactory.getLocalInstance(ctx);
BOTMappingInfo botInfo = null;
BOTMappingCollection botCol = botFac.getBOTMappingCollection("select id,srcEntityname,destentityName where name='"+botpName+"' and extRule.isEffected=1 ");
if(botCol.size()==1){
botInfo = botCol.get(0);
}else{
throw new BOSException("BOTP("+botpName+")不存在或未启用!");
}
IBTPManager iBTPManager = BTPManagerFactory.getLocalInstance(ctx);
BTPTransformResult btpResult = iBTPManager.transformForBotp(new String[] { billInfo.getId().toString() }, new String[] { "entry" }, entryIds, null, botInfo.getDestEntityName(),
new ObjectUuidPK(botInfo.getId().toString()),botInfo.getSrcEntityName());
if (btpResult.getBills().size()<=0) {
return;
}
BOTRelationCollection relations = btpResult.getBOTRelationCollection();
Map map = getMapByRelation(relations);
for (int i = 0; i < btpResult.getBills().size(); i++) {
IObjectValue destBillInfo = btpResult.getBills().getObject(i);
CoreBillBaseInfo destBill = (CoreBillBaseInfo) destBillInfo;
BOTRelationCollection botrelationcollection =(BOTRelationCollection)map.get(destBill.getId().toString());
iBTPManager.saveRelations(destBill, botrelationcollection);
}
}
public Map getMapByRelation(BOTRelationCollection relations) {
Map map = new HashMap();
for (int i = 0; i < relations.size(); i++) {
BOTRelationInfo relationInfo = relations.get(i);
String oid = relationInfo.getDestObjectID();
if (map.get(oid) != null) {
BOTRelationCollection botrelationcollection=(BOTRelationCollection) map.get(oid);
botrelationcollection.add(relationInfo);
map.put(oid, botrelationcollection);
} else {
BOTRelationCollection botrelationcollection = new BOTRelationCollection();
botrelationcollection.add(relationInfo);
map.put(oid, botrelationcollection);
}
}
return map;
}
botp关系对照表:
表:T_BOT_Mapping)botp规则的idisEffected是否生效1type类型0
参考语句:insert into T_BOT_Relation(fid,fsrcEntityID,fdestEntityID,fsrcObjectID,fdestObjectID,foperatorID,fBOTMappingID,fisEffected,ftype)
values(newbosid('59302EC6'),'C48A423A','CC3E933B','iMsAAAAHsMHEikI6','iMsAAAAHsOTMPpM7','user','6a7669e6-0108-1000-e000-2136c0a812fd045122C4',1,0)
botp关系对照分录表:
- botp生成目标数据,并建立上查下查关系
- 金蝶EAS,BOS,BOTP,源单据与目标单据关联关系
- BOTP生成多条凭证
- DataSet基础-建立包含多个表的数据集(dataset),并建立表间制约关系
- 存储过程 从临时表中把数据分倒到多个表,并建立对应关系、历史记录
- 建立DataTable并加入数据
- 调用EAS单据转换规则(BOTP),生成下游单据
- BOTP生成模式——单据级生成和分录级生成
- xmlhttp组件获取远程文件并筛选出目标数据
- xmlhttp组件获取远程文件并筛选出目标数据
- 通过数据分析改进并达成SEO优化目标
- EAS,BOS,校验业务单据是否已经通过BOTP生成指定下游单据
- 使用EMF建立模型并生成Java代码
- Android 建立文件夹、生成文件并写入文本文件内容
- Android 建立文件夹、生成文件并写入文本文件内容
- Android 建立文件夹、生成文件并写入文本文件内容
- Shell脚本实现数据父子关系定义——目标:将目标数据批量导入MySQL数据库
- 使用Navicat生成ER关系图并导出
- cpp中的volatile关键字
- Eclipse设置:背景与字体大小和xml文件中字体大小调整
- Android自适应不同分辨率或不同屏幕大小的layout布局(横屏|竖屏)
- Java I/O工作机制及优化
- 批处理常用命令总结和WindowsXP下运行命令使用大全及优化
- botp生成目标数据,并建立上查下查关系
- SlidingupPanel
- 动态代理--java实现
- 为Amazon EC2 Instance 设置允许ping
- 免费 webservice 收集
- Jquery php Json Ajax POST GET
- 基本语言细节--《The C++ Programming Language 》--(2)类型和声明
- .owner = THIS_MODULE为什么加“点”的原因
- Java中的中文编码问题