首页 > 其他分享 >bos 生成下游单据,反写上游单据(金蝶内置方法)

bos 生成下游单据,反写上游单据(金蝶内置方法)

时间:2023-02-28 18:06:58浏览次数:37  
标签:金蝶 reverseSave bos ctx srcBillVO 单据 put model srcBillPK


@Override
protected void _reverseSave(Context ctx, IObjectPK srcBillPK,
IObjectValue srcBillVO, BOTBillOperStateEnum billOperStateEnum,
IObjectValue relationInfo) throws BOSException, EASBizException {
reverseSave(ctx, srcBillPK, srcBillVO, billOperStateEnum, relationInfo);
//super._reverseSave(ctx, srcBillPK, srcBillVO, billOperStateEnum, relationInfo);
}

public static void reverseSave(Context ctx, IObjectPK srcBillPK, IObjectValue srcBillVO, BOTBillOperStateEnum bOTBillOperStateEnum, IObjectValue bOTRelationInfo) throws BOSException, EASBizException {
BOTRelationInfo relation = (BOTRelationInfo) bOTRelationInfo;
BOSObjectType bosType = BOSUuid.read(relation.getDestObjectID()).getType();
if (bosType.equals((new VoucherInfo()).getBOSType())) {
CoreBillBaseInfo model = (CoreBillBaseInfo) srcBillVO;
// 删除凭证
if (bOTBillOperStateEnum.equals(BOTBillOperStateEnum.DELETE)) {
//model.put(FLD_FIVOUCHERED, new Integer(0));
// 以下设置单据的凭证信息
model.put("VOUCHERNUMBER", null);
//model.put(FLD_VOUCHERDATE, null);
}
// 生成凭证
else {
String voucherID = relation.getDestObjectID();
VoucherInfo voucherInfo = (VoucherInfo) VoucherFactory.getLocalInstance(ctx).getValue(new ObjectStringPK(voucherID));
//model.put(FLD_FIVOUCHERED, voucherInfo.getNumber() );
// 以下设置单据的凭证信息
model.put("VOUCHERNUMBER", voucherInfo.getNumber());
// model.put(FLD_VOUCHERDATE, voucherInfo.getBookedDate());
}
BOSObjectType bosObjectType = srcBillVO.getBOSType();
ICoreBillBase iCoreBillBase = (ICoreBillBase) BOSObjectFactory.createBOSObject(ctx, bosObjectType);
iCoreBillBase.reverseSave(srcBillPK, (CoreBillBaseInfo) srcBillVO);
}
}

 

标签:金蝶,reverseSave,bos,ctx,srcBillVO,单据,put,model,srcBillPK
From: https://blog.51cto.com/u_11343833/6091641

相关文章