kumarson

留下成长点滴...
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

BOS开发常用代码

Posted on 2013-08-27 15:53  kumarson  阅读(3106)  评论(0编辑  收藏  举报

1、关于BOSID

 1 //生成fid
 2 BOSUuid.create("BF0C040E"); //BF0C040E是实体里面的 bostype
 3 
 4 //设值到id
 5 info.setId(BOSUuid.create(info.getBOSType()));
 6 info.setId(BOSUuid.read("vVkYjAEPEADgAAUlwKgSe+lrK44="));    
 7 
 8 //将string转成主键
 9 IObjectPK pk= new ObjectUuidPK();
10 pk.getKeyValue("vVkYjAEPEADgAAUlwKgSe+lrK44=");
11 
12 IObjectPK pk= new ObjectUuidPK();
13 pk.setKeyValue("id", customer.getId());
14 customer = FDCCustomerFactory.getRemoteInstance().getFDCCustomerInfo(pk);


2、查找bostype,bostype表

1 SELECT * FROM T_SYS_ENTITYREF WHERE
2 --freftablename='T_TEN_BizOpportunity'
3 fbostype='A1B04DA9'
4 
5 select newbosid('A1B04DA9') 
6 
7 ynOyREsOAeLgQ8CoZNgB4qGwTak=
8 

9 select * from T_TEN_BizOpportunity where fid ='ynOyREsOAeLgQ8CoZNgB4qGwTak='

 

3、单据转换(BOTP)的实体表

1 T_BOT_Relation
2 T_BOT_RelationEntry


4、获取当前登录用户的id

1 SysContext.getSysContext().getCurrentUserInfo().getId();
2 PersonInfo personInfo = SysContext.getSysContext().getCurrentUserInfo();


5、根据枚举的值取别名

1 FDCBillStateEnum.getEnum(rs.getString("state")).getAlias()


6、pannel页签的位置

1 this.tabNew.add(this.panelQuote, "报价", 5);


7、查询菜单目录

1 select FDisplayName_L2 from T_PM_MainMenuItem where FName_L2 like '%租赁预测%'  (对标准产品的路径有效)

 

8、解决问题“退出EDITUI界面时,出现是否修改的提示”

 1 public void actionSubmit_actionPerformed(ActionEvent e) throws Exception
 2 {
 3     super.actionSubmit_actionPerformed(e);
 4     storeFields();
 5     initOldData(editData);
 6 }
 7 
 8 //退出editui时,不检查是否有修改
 9 public boolean isModify() {
10     return false;
11 }
12     
13 //这个也可以
14 checkBeforeWindowClosing

 

9、不判断编码重复

1     protected void _checkNumberDup(Context ctx, IObjectValue model) throws BOSException, EASBizException {
2      // 不需要判断number重复
3     }
4     
5     protected void _checkNameDup(Context ctx, IObjectValue model) throws BOSException, EASBizException {
6      // 不需要判断名称重复
7     }

 

10、获取资源文件数据

1 //注:DxflhzConfig   为bos中对应的资源文件名
2 String str=EASResource.getString("com.kingdee.eas.fi.gr.dxflhz.client.DxflhzConfig","headerNumber");     
3 System.out.println("----------str:"+str);

 

11、java客户端访问网页

1 String url="explorer.exe http://ekptest.carec.com.cn:8088/axis/KmReviewWebserviceService?wsdl";
2 try {
3     Runtime.getRuntime().exec(url);
4 } catch (IOException e3) {
5     e3.printStackTrace();
6 }

 

12、设置kdtable排序

1 for (int i = 0; i < tblRecord.getColumnCount(); i++) {
2    tblRecord.getColumn(i).setSortable(true);
3 }
4 KDTSortManager sortManager = new KDTSortManager(tblRecord);
5 sortManager.setSortAuto(true);