kumarson

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

BOS开发常用代码

Posted on 2013-08-27 15:06  kumarson  阅读(558)  评论(0编辑  收藏  举报
  1 ----1、关于id----------------------------------------
  2 //生成fid
  3 BOSUuid.create("BF0C040E"); //BF0C040E是实体里面的 bostype
  4 
  5 //设值到id
  6 info.setId(BOSUuid.create(info.getBOSType()));
  7 info.setId(BOSUuid.read("vVkYjAEPEADgAAUlwKgSe+lrK44="));    
  8 
  9 //将string转成主键
 10 IObjectPK pk= new ObjectUuidPK();
 11 pk.getKeyValue("vVkYjAEPEADgAAUlwKgSe+lrK44=");
 12 
 13 IObjectPK pk= new ObjectUuidPK();
 14 pk.setKeyValue("id", customer.getId());
 15 customer = FDCCustomerFactory.getRemoteInstance().getFDCCustomerInfo(pk);
 16 
 17 
 18 ----2、查找bostype,bostype表----------------------------
 19 SELECT * FROM T_SYS_ENTITYREF WHERE
 20 --freftablename='T_TEN_BizOpportunity'
 21 fbostype='A1B04DA9'
 22 
 23 select newbosid('A1B04DA9') 
 24 
 25 ynOyREsOAeLgQ8CoZNgB4qGwTak=
 26 
 27 select * from T_TEN_BizOpportunity where fid ='ynOyREsOAeLgQ8CoZNgB4qGwTak='
 28 
 29 
 30 
 31 ----3、EAS7.0数据库脚本添加客户化菜单----------------------------------------
 32     1、获取uuid
 33     select newbosid('11111111')
 34     4bvgUdAhRViKLcF3Adi1tRERERE=
 35     
 36     2、查询父节点的fid 和 flongnumber
 37     select * from t_pm_mainmenuitem
 38     where fname_l2 like '%报表中心%'
 39     union all 
 40     select * from  T_PM_MAINMENUITEM where fid='4bvgUdAhRViKLcF3Adi1tRERERE='
 41     
 42     3、flongnumber  M08WIzFkTLeULbeIZRMXaBdCz6U=
 43        fid 0201MC!22extcenter
 44        
 45     4、0201MC!22extcenter!test11  表示 fid!子节点名称
 46     
 47     5、2,3 表示 父节点和子节点的index   
 48        
 49 If not exists 
 50 (select * from T_PM_MAINMENUITEM where fid='4bvgUdAhRViKLcF3Adi1tRERERE=')
 51 insert into T_PM_MAINMENUITEM 
 52         (FID, FNAME_L1, FNAME_L2,   FNAME_L3,  FNUMBER,FDESCRIPTION_L1, FDESCRIPTION_L2, FDESCRIPTION_L3, FSIMPLENAME, FISLEAF, FLEVEL, FLONGNUMBER,FORDER, FIMAGEPATH, FVISIBLE, FENABLED,FUIOPRT,FOPENMETHOD, FSHORTCUTCODE, FISREPORT,FCREATORID,FCREATETIME, FLASTUPDATEUSERID,FLASTUPDATETIME, FPARENT,FFUNCTION,FCONTROLUNITID,FDISPLAYNAME_L1,FDISPLAYNAME_L2,FDISPLAYNAME_L3,FSYSMENUID,FISMODIFIED,FINDUSTRY,FNOSUIT,FMENUTYPE,FUICLASSNAME,FUICLASSPARAM)
 53 values  ('4bvgUdAhRViKLcF3Adi1tRERERE=','新采购订单','新采购订单','新采购订单','test11',null,null,null,'新采购订单',2,3,'0201MC!22extcenter!test11',null,null,1,1,null,null,null, 0,'00000000-0000-0000-0000-00000000000013B7DE7F',getdate(), '00000000-0000-0000-0000-00000000000013B7DE7F',getdate(), 'M08WIzFkTLeULbeIZRMXaBdCz6U=',null, '11111111-1111-1111-1111-111111111111CCE7AED4',null,null,null,null,0,0, null,10,'com.kingdee.eas.cimc.client.AssetDataEditUI',null)
 54 
 55 
 56 
 57 ----4、单据转换的实体表----------------------------
 58 T_BOT_Relation
 59 T_BOT_RelationEntry
 60 
 61 
 62 ----5、获取当前登录用户的id----------------------------
 63 SysContext.getSysContext().getCurrentUserInfo().getId();
 64 PersonInfo personInfo = SysContext.getSysContext().getCurrentUserInfo();
 65 
 66 
 67 ----6、根据枚举的值取别名----------------------------
 68 FDCBillStateEnum.getEnum(rs.getString("state")).getAlias()
 69 
 70 
 71 ----7、pannel页签的位置----------------------------
 72 this.tabNew.add(this.panelQuote, "报价", 5);//KDTabbedPane:tabNew;KDPanel:panelQuote
 73 
 74 
 75 ----8、查询菜单目录----------------------------
 76 select FDisplayName_L2 from T_PM_MainMenuItem where FName_L2 like '%租赁预测%'  (对标准产品的路径有效)
 77 
 78 
 79 ----9、解决问题“退出EDITUI界面时,出现是否修改的提示”----------------------------
 80 public void actionSubmit_actionPerformed(ActionEvent e) throws Exception
 81 {
 82     super.actionSubmit_actionPerformed(e);
 83     storeFields();
 84     initOldData(editData);
 85 }
 86 
 87 //退出editui时,不检查是否有修改
 88 public boolean isModify() {
 89     return false;
 90 }
 91     
 92 //这个也可以
 93 checkBeforeWindowClosing
 94 
 95 
 96 ----10、Easportal登录链接----------------------------
 97 http://10.197.32.228:6888/eassso/login?service=http%3A%2F%2F10.197.32.228%3A6888%2Feasportal%2FssoWelcome%3FredirectTo%3D%2Findex_sso.jsp&selectDataCenter=0&selectLang=L1
 98 http://10.197.32.228:6888/easportal/index_sso.jsp
 99 
100 
101 ----11、不判断编码重复(controlbean)----------------------------
102 //    @Override
103     protected void _checkNumberDup(Context ctx, IObjectValue model) throws BOSException, EASBizException {
104      // 不需要判断number重复
105     }
106     
107 //    @Override
108     protected void _checkNameDup(Context ctx, IObjectValue model) throws BOSException, EASBizException {
109      // 不需要判断名称重复
110 
111 
112     }
113 
114 ----12、新建状态取到单据的id----------------------------
115 ContractBillInfo info = new ContractBillInfo();
116 IObjectPK pk = null;
117 try {
118 pk = ContractBillFactory.getRemoteInstance().addnew(info);
119 } catch (Exception e1) {
120 e1.printStackTrace();
121 SysUtil.abort();
122 }
123 fid = (BOSUuid.read(pk.toString()) == null) ? "" : BOSUuid.read(pk.toString()).toString();
124 editData.setId(BOSUuid.read(pk.toString()));
125 
126 
127 
128 ----13、获取资源文件数据----------------------------
129 //注:DxflhzConfig   为bos中对应的资源文件名
130 String str=EASResource.getString("com.kingdee.eas.fi.gr.dxflhz.client.DxflhzConfig","headerNumber");     
131 System.out.println("----------str:"+str);
132 
133 
134 ----14、java访问网页----------------------------
135 String url="explorer.exe http://ekptest.carec.com.cn:8088/axis/KmReviewWebserviceService?wsdl";
136 try {
137     Runtime.getRuntime().exec(url);
138 } catch (IOException e3) {
139     e3.printStackTrace();
140 }
141 
142 
143 ------15.设置kdtable排序
144 for (int i = 0; i < tblRecord.getColumnCount(); i++) {
145    tblRecord.getColumn(i).setSortable(true);
146 }
147 KDTSortManager sortManager = new KDTSortManager(tblRecord);
148 sortManager.setSortAuto(true);