4.EAS代码代码示例
4.1单据新增代码
//如:新增一行付款单 //构造一条付款单信息(构造值对象) PaymentBillInfo payInfo = new PaymentBillInfo(); payInfo.setNumber("1001"): //关联用户 UserInfo userInfo = new UserInfo(); userInfo.setId(BOSUuid.read("867d5df6-00f8-1000-e000-0009c0a81089sysu"))://BOSUuid建立实体对象 userInfo.setName("John"); userInfo.setNumber("2000"); BigDecimal ex=new BigDecimal("343434.445")://建立属性 BigDecimal ex2 new BigDecimal(12345678901234567.8)//错误 payInfo.setExchangeRate(ex); payInfo.setCreator(userInfo); payInfo.setAuditDate(new Date(System.currentTimeMillis());//时间属性 Timestamp createdate = new Timestamp(System.currentTimeMillis()); payInfo.setCreateDate(createdate); payInfo.setBizState(BillBizState.create)://枚据属性 payInfo.setSave(true);//Boolean属性 PaymentBillltemInfo itemInfo=new PaymentBillItemInfo():/建立分录 itemInfo.setLineNo(34); itemInfo.setAmounts(ex2); payInfo..getEntries().add(itemInfo);//添加分录 payInfo.getEntries().add(new ErrandTaskItemInfo());//添加分录 //调用新增方法进行保存 IPaymentBill iPayBill=PaymentBillFactory.getRemoteInstance();//获取实体 lObjectPK pk=iPayBill.addnew(payInfo)://保存值对象,返回逻辑键,可以通过逻辑键获取值对象
4.2单据修改代码
//修改一条付款单信息 IPaymentBill iPayBill = PaymentBillFactory.getRemoteInstance(); String id="8b35b903-00f8-1000-c000-0008c0a81089crrt", ObjectUuidPK pk=new ObjectUuidPK(BOSUuid.read(id)://建立逻辑键 PaymentBilllnfo payInfo=iPayBill.getValue(pk)://获取值对象: System.out.println("this:"+payInfo.getExchangeRate())://获取属性 payInfo.setExchangeRate(ex)//修改属性属性 iPayBill.update(pk,payInfo);//更新数据
4.3单据删除代码
ObjectUuidPK pk=new ObjectUuidPK(BOSUuid.read(id)://建立逻辑键 iPayBill.remove(pk)://通过逻辑键别除单据内容获取集合
4.4获取集合
标签:示例,iPayBill,payInfo,userInfo,pk,new,EAS,代码 From: https://www.cnblogs.com/ketoli/p/17545055.html