金蝶EAS BOS开发典型示例代码
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
F G @ A payInfo.setBizState(BillBizState.create);// @ A payInfo.setSave(true);//Boolean
H 6 7 I P PaymentBillItemInfo itemInfo new PaymentBillItemInfo();//
6 7 % & EntityViewInfo evi = new EntityViewInfo();// 6 7 5 $ FilterInfo i = new FilterInfo();//
i.getFilterItems().add( new FilterItemInfo("number", "ddff", CompareType.EQUELS));
userInfo.setId(BOSUuid.read("867d5df6-00f8-1000-e000-0009c0a81089sysu"));
BOSUuid 6 7 8 9 ( )
userInfo.setName(“John”);
userInfo.setNumber(“2000”);
// 4 5
public void setReceiveType() { this.kDComboBox2.removeAllItems(); List list = new List(); Iterator it = ReceiveType.iterator(); while (it.hasNext()) { list.add(ReceiveType.getEnum(it.toString()).toString()); } }
// Y`y T U 1 Y`tG
Y ` y CurrencyCollection co = c. getCurrencyCollection ();// 2 Y`$ tG
Y ` y CurrencyCollection co = c.getCurrencyCollection(evi);// 3 Y` oql $ t G
IUIFactory uiFactory = null; uiFactory = UIFactory
hp q ( r s T t n o .createUIFactory("com.kingdee.eas.base.uiframe.client.UIModelDialogFactory"); //
IUIWindow uiWindow = uiFactory
AuxAccountEditUI ui = (AuxAccountEditUI) this.getUIContext().get("Owner");
}
12 给 Query 传过滤条件
EntityViewInfo evi = new EntityViewInfo();
6 7 5 $ FilterInfo filterInfo = new FilterInfo(); //
3 单据新增代码
! //"# $ !% &
¤"# '( )
PaymentBillInfo payInfo = new PaymentBillInfo();
payInfo.setNumber(“1001”);
//01 2 3
UserInfo userInfo = new UserInfo();
S2TUVWX II`POa'byjme(cetPn)tKBip¤lkl i=PiaiyPBayilBl i=ll.Paadydmneewnt(BpailylFInafcoto);r/y/W.geXtR'em(ot)eInasbtancced();e//Yf`a8g9h4 5 d e f Y
6 7 d e f String id="8b35b903-00f8-1000-e000-0008c0a81089errt";
ObjectUuidPK pk = new ObjectUuidPK(BOSUuid.read(id));//
c.getValue(pk); : c.getCurrencyInfo(pk);
i.getFilterItems().add( new FilterItemInfo("id", "ddff", CompareType.EQUELS));
i. setMaskString(" (#0 and #1)");
Q evi.setFilter(i);// R 5 $ Q R Y ` @ A evi.getSelector().add(new SelectorItemInfo("id"));//
// PaymentBillInfo payInfo2 = iPayBill.getValue(pk);
4.p
q
单据修改代码
$ !%&
IPaymentBill iPayBill = PaymentBillFactory.getRemoteInstance();
6 7 d e f String id="8b35b903-00f8-1000-e000-0008c0a81089errt";
evi.getSelector().add(new SelectorItemInfo("*")); evi.getSelector().add(new SelectorItemInfo("company.id")); evi.getSelector().add(new SelectorItemInfo("company.name"));
{
int mode = ((Integer)this.getUIContext().get("EASMode")).intValue();
AccountTableInfo accountTableInfo = (AccountTableInfo) this.getUIContext().get("table");
create(
Leabharlann Baidu
m n o ( ) u v w "com.kingdee.eas.basedata.master.auxacct.client.AccountSelectUI", /*
*/
map);
2 x h uiWiYnd`owe.shfowi(y); t G
private void loadContext()
6 7 @ A BigDecimal ex = new BigDecimal("343434.445");// B C BigDecimal ex2 = new BigDecimal(12345678901234567.8);//
payInfo.setExchangeRate(ex); payInfo.setCreator(userInfo);
Y ` y CurrencyCollection co = c. getCurrencyCollection (evi);//
10. 获取值对象
CurrencyInfo cur = new CurrencyInfo();
6 7 8 9 ( ) ICurrency c = CurrencyFactory.getRemoteInstance();//
5. 单据删除代码
4 iPayBill.remove(pk);// 5 d e f u v! G wx Y ` y
6. 单据回写代码
7. 单据反写代码
8. 单据审核代码
9. 获取集合
CurrencyInfo cur = new CurrencyInfo();
6 7 8 9 ( ) ICurrency c = CurrencyFactory.getRemoteInstance();//
//cjp cu
CtrlUnitInfo cuInfo = (CtrlUnitInfo) this.getUIContext().get("cu");
AsstAccountInfo asstAccountInfo = (AsstAccountInfo) this.getUIContext().get("auxAccount");
filterInfo.setMaskString("#0 and #1 "); evi.setFilter(filterInfo);
if (mainQuery == null) { mainQuery = new EntityViewInfo();
}
Q R 5 $ mainQuery.setFilter(filterInfo); //
11.
界面之间传递参数
1 ydefghity
HashMap map = new HashMap();
map.put("Owner", this); //j k lm n o UI UI ( )
map.put("EASMode", new Integer(this.EASMode)); map.put("table", this.accountTablePrompBox.getData()); map.put("cu", currentCtrlUnit); map.put("auxAccount", this.asstAccountPromptBox.getData());
itemInfo.setLineNo(34); itemInfo.setAmounts(ex2);
Q R I P payInfo.getEntries().add(itemInfo);// Q R I P payInfo.getEntries().add(new ErrandTaskItemInfo());//
ObjectUuidPK pk = new ObjectUuidPK(BOSUuid.read(id));//
Y ` ' ( ) r PaymentBillInfo payInfo = iPayBill.getValue(pk);// Y ` @ A System.out.println("this:"+ payInfo.getExchangeRate());// p q @ A @ A payInfo.setExchangeRate(ex);// s t G iPayBill.update(pk, payInfo);//
filterInfo.getFilterItems().add( new FilterItemInfo("typelink.id", info.getId(), CompareType.EQUALS));
filterInfo.getFilterItems().add( new FilterItemInfo("currencyCompany.id", companyID, CompareType.EQUALS));
D E@ A payInfo.setAuditDate(new Date(System.currentTimeMillis()));//
Timestamp createdate = new Timestamp(System.currentTimeMillis()); payInfo.setCreateDate(createdate);
this.execQuery();
13.
接 3口z方3 {法|的}访问方式
CurrencyInfo cur = new CurrencyInfo();
6 7 8 9 ( ) ICurrency c = CurrencyFactory.getRemoteInstance();//
c4.ge~tCurr{en|cy}Collection();
CurrencyInfo cur = new CurrencyInfo();
6 7 8 9 ( ) ICurrency c = CurrencyFactory. getLocalInstance (ctx);//
c. getCurrencyCollection();
14.
特别控件的初始化
1 ComboBox
¡¢£ ¤¥ ¦§¨©
BOS
1 BigDecimal 类型的使用方式
BigDecimal amounts = new BigDecimal(String.valueOf(0.00));
2 通过 String 转换成 pk:
ObjectUuidPK pk = new ObjectUuidPK(paymentInfo.getId());
H 6 7 I P PaymentBillItemInfo itemInfo new PaymentBillItemInfo();//
6 7 % & EntityViewInfo evi = new EntityViewInfo();// 6 7 5 $ FilterInfo i = new FilterInfo();//
i.getFilterItems().add( new FilterItemInfo("number", "ddff", CompareType.EQUELS));
userInfo.setId(BOSUuid.read("867d5df6-00f8-1000-e000-0009c0a81089sysu"));
BOSUuid 6 7 8 9 ( )
userInfo.setName(“John”);
userInfo.setNumber(“2000”);
// 4 5
public void setReceiveType() { this.kDComboBox2.removeAllItems(); List list = new List(); Iterator it = ReceiveType.iterator(); while (it.hasNext()) { list.add(ReceiveType.getEnum(it.toString()).toString()); } }
// Y`y T U 1 Y`tG
Y ` y CurrencyCollection co = c. getCurrencyCollection ();// 2 Y`$ tG
Y ` y CurrencyCollection co = c.getCurrencyCollection(evi);// 3 Y` oql $ t G
IUIFactory uiFactory = null; uiFactory = UIFactory
hp q ( r s T t n o .createUIFactory("com.kingdee.eas.base.uiframe.client.UIModelDialogFactory"); //
IUIWindow uiWindow = uiFactory
AuxAccountEditUI ui = (AuxAccountEditUI) this.getUIContext().get("Owner");
}
12 给 Query 传过滤条件
EntityViewInfo evi = new EntityViewInfo();
6 7 5 $ FilterInfo filterInfo = new FilterInfo(); //
3 单据新增代码
! //"# $ !% &
¤"# '( )
PaymentBillInfo payInfo = new PaymentBillInfo();
payInfo.setNumber(“1001”);
//01 2 3
UserInfo userInfo = new UserInfo();
S2TUVWX II`POa'byjme(cetPn)tKBip¤lkl i=PiaiyPBayilBl i=ll.Paadydmneewnt(BpailylFInafcoto);r/y/W.geXtR'em(ot)eInasbtancced();e//Yf`a8g9h4 5 d e f Y
6 7 d e f String id="8b35b903-00f8-1000-e000-0008c0a81089errt";
ObjectUuidPK pk = new ObjectUuidPK(BOSUuid.read(id));//
c.getValue(pk); : c.getCurrencyInfo(pk);
i.getFilterItems().add( new FilterItemInfo("id", "ddff", CompareType.EQUELS));
i. setMaskString(" (#0 and #1)");
Q evi.setFilter(i);// R 5 $ Q R Y ` @ A evi.getSelector().add(new SelectorItemInfo("id"));//
// PaymentBillInfo payInfo2 = iPayBill.getValue(pk);
4.p
q
单据修改代码
$ !%&
IPaymentBill iPayBill = PaymentBillFactory.getRemoteInstance();
6 7 d e f String id="8b35b903-00f8-1000-e000-0008c0a81089errt";
evi.getSelector().add(new SelectorItemInfo("*")); evi.getSelector().add(new SelectorItemInfo("company.id")); evi.getSelector().add(new SelectorItemInfo("company.name"));
{
int mode = ((Integer)this.getUIContext().get("EASMode")).intValue();
AccountTableInfo accountTableInfo = (AccountTableInfo) this.getUIContext().get("table");
create(
Leabharlann Baidu
m n o ( ) u v w "com.kingdee.eas.basedata.master.auxacct.client.AccountSelectUI", /*
*/
map);
2 x h uiWiYnd`owe.shfowi(y); t G
private void loadContext()
6 7 @ A BigDecimal ex = new BigDecimal("343434.445");// B C BigDecimal ex2 = new BigDecimal(12345678901234567.8);//
payInfo.setExchangeRate(ex); payInfo.setCreator(userInfo);
Y ` y CurrencyCollection co = c. getCurrencyCollection (evi);//
10. 获取值对象
CurrencyInfo cur = new CurrencyInfo();
6 7 8 9 ( ) ICurrency c = CurrencyFactory.getRemoteInstance();//
5. 单据删除代码
4 iPayBill.remove(pk);// 5 d e f u v! G wx Y ` y
6. 单据回写代码
7. 单据反写代码
8. 单据审核代码
9. 获取集合
CurrencyInfo cur = new CurrencyInfo();
6 7 8 9 ( ) ICurrency c = CurrencyFactory.getRemoteInstance();//
//cjp cu
CtrlUnitInfo cuInfo = (CtrlUnitInfo) this.getUIContext().get("cu");
AsstAccountInfo asstAccountInfo = (AsstAccountInfo) this.getUIContext().get("auxAccount");
filterInfo.setMaskString("#0 and #1 "); evi.setFilter(filterInfo);
if (mainQuery == null) { mainQuery = new EntityViewInfo();
}
Q R 5 $ mainQuery.setFilter(filterInfo); //
11.
界面之间传递参数
1 ydefghity
HashMap map = new HashMap();
map.put("Owner", this); //j k lm n o UI UI ( )
map.put("EASMode", new Integer(this.EASMode)); map.put("table", this.accountTablePrompBox.getData()); map.put("cu", currentCtrlUnit); map.put("auxAccount", this.asstAccountPromptBox.getData());
itemInfo.setLineNo(34); itemInfo.setAmounts(ex2);
Q R I P payInfo.getEntries().add(itemInfo);// Q R I P payInfo.getEntries().add(new ErrandTaskItemInfo());//
ObjectUuidPK pk = new ObjectUuidPK(BOSUuid.read(id));//
Y ` ' ( ) r PaymentBillInfo payInfo = iPayBill.getValue(pk);// Y ` @ A System.out.println("this:"+ payInfo.getExchangeRate());// p q @ A @ A payInfo.setExchangeRate(ex);// s t G iPayBill.update(pk, payInfo);//
filterInfo.getFilterItems().add( new FilterItemInfo("typelink.id", info.getId(), CompareType.EQUALS));
filterInfo.getFilterItems().add( new FilterItemInfo("currencyCompany.id", companyID, CompareType.EQUALS));
D E@ A payInfo.setAuditDate(new Date(System.currentTimeMillis()));//
Timestamp createdate = new Timestamp(System.currentTimeMillis()); payInfo.setCreateDate(createdate);
this.execQuery();
13.
接 3口z方3 {法|的}访问方式
CurrencyInfo cur = new CurrencyInfo();
6 7 8 9 ( ) ICurrency c = CurrencyFactory.getRemoteInstance();//
c4.ge~tCurr{en|cy}Collection();
CurrencyInfo cur = new CurrencyInfo();
6 7 8 9 ( ) ICurrency c = CurrencyFactory. getLocalInstance (ctx);//
c. getCurrencyCollection();
14.
特别控件的初始化
1 ComboBox
¡¢£ ¤¥ ¦§¨©
BOS
1 BigDecimal 类型的使用方式
BigDecimal amounts = new BigDecimal(String.valueOf(0.00));
2 通过 String 转换成 pk:
ObjectUuidPK pk = new ObjectUuidPK(paymentInfo.getId());