欢迎来到天天文库
浏览记录
ID:37511331
大小:94.50 KB
页数:13页
时间:2019-05-24
《BOS开发典型代码文档》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、单据新增代码如:新增一行付款单//构造一条付款单信息(构造值对象)PaymentBillInfopayInfo=newPaymentBillInfo();payInfo.setNumber(“1001”);//关联用户UserInfouserInfo=newUserInfo();userInfo.setId(BOSUuid.read("867d5df6-00f8-1000-e000-0009c0a81089sysu"));//通过BOSUuid建立实体对象userInfo.setName(“John”);user
2、Info.setNumber(“2000”);BigDecimalex=newBigDecimal("343434.445");//建立属性BigDecimalex2=newBigDecimal(12345678901234567.8);//错误payInfo.setExchangeRate(ex);payInfo.setCreator(userInfo);payInfo.setAuditDate(newDate(System.currentTimeMillis()));//时间属性Timestampcreate
3、date=newTimestamp(System.currentTimeMillis());payInfo.setCreateDate(createdate);payInfo.setBizState(BillBizState.create);//枚据属性payInfo.setSave(true);//Boolean属性PaymentBillItemInfoitemInfo=newPaymentBillItemInfo();//建立分录itemInfo.setLineNo(34);itemInfo.setAmoun
4、ts(ex2);payInfo.getEntries().add(itemInfo);//添加分录payInfo.getEntries().add(newErrandTaskItemInfo());//添加分录调用新增方法进行保存IPaymentBilliPayBill=PaymentBillFactory.getRemoteInstance();//获取实体IObjectPKpk=iPayBill.addnew(payInfo);//保存值对象,返回逻辑键,可以通过逻辑键获取值对象(如下)//PaymentBi
5、llInfopayInfo2=iPayBill.getValue(pk);单据修改代码修改一条付款单信息IPaymentBilliPayBill=PaymentBillFactory.getRemoteInstance();Stringid="8b35b903-00f8-1000-e000-0008c0a81089errt";ObjectUuidPKpk=newObjectUuidPK(BOSUuid.read(id));//建立逻辑键PaymentBillInfopayInfo=iPayBill.getValu
6、e(pk);//获取值对象;System.out.println("this:"+payInfo.getExchangeRate());//获取属性payInfo.setExchangeRate(ex);//修改属性属性iPayBill.update(pk,payInfo);//更新数据单据删除代码iPayBill.remove(pk);//通过逻辑键删除单据内容获取集合获取集合CurrencyInfocur=newCurrencyInfo();ICurrencyc=CurrencyFactory.getRemo
7、teInstance();//建立实体对象EntityViewInfoevi=newEntityViewInfo();//建立视图信息FilterInfoi=newFilterInfo();//建立过滤条件i.getFilterItems().add(newFilterItemInfo("number","ddff",CompareType.EQUELS));i.getFilterItems().add(newFilterItemInfo("id","ddff",CompareType.EQUELS));i.se
8、tMaskString("(#0and#1)");evi.setFilter(i);//添加过滤条件evi.getSelector().add(newSelectorItemInfo("id"));//添加获取属性evi.getSelector().add(newSelectorItemInfo("*"));evi.getSelector().add(newSelecto
此文档下载收益归作者所有