金蝶EAS_BOS工作笔记

D:\\EASBOS\\eas\\bos\\BOSModular\\bosruntime\\eclipse\\plugins\\com.kingdee.bos.bosframework_5.4.0

这两个的位置与其他3个不同)

另外5.4版本的BOS工具不能使用其内置的服务器(5.3版本可以这样使用),必须连接EAS服务器,所以EAS服务器必须启动,连接的时候直接填写EAS服务器的IP地址即可

还要注意EAS服务器在打了补丁之后 BOS工具也需要单独打补丁

方法是在BOS工具里面的帮助菜单里面的\更新BOSIDE补丁\然后选择对应的补丁ZIP包就可以了

例如PTM12603.ZIP

最后运行一下D:\\EASBOS\\eas\\bos\\BOSModular\\clear_bosmodular_env.bat BOS 工作流设计过程中出现异常错误信息可以先按照这个步骤来检查 65. 工作流登陆,提示jar不存在

将E:\\EAS54_BOS\\eas\\bos\\BOSModular\\540initflow\\eas540_initial.jar包添加 66. KDSpinner 数字微调器 获取值方法:

Integer accountLevel = (Integer)spnAccountLevel.getValue(); Calendar calendar = GregorianCalendar.getInstance(); calendar.setTimeInMillis(System.currentTimeMillis()); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH)+1;

SpinnerNumberModel yearLevelModel = new SpinnerNumberModel(1, 1,2100, 1); spnYear.setModel(yearLevelModel); spnYear.setValue(new Integer(year)); 67. KDComboBox 下拉选框 获取值方法:

Object objectCurrency = cmbCurrency.getSelectedItem();

CurrencyInfo currencyInfo = (CurrencyInfo)cmbCurrency.getSelectedItem(); customCondition.setCurrencyID(currencyInfo.getId().toString()); customCondition.setCurrencyName(currencyInfo.getName()); 68. 命名规范

KDCheckBox chk****

KDLabel lbl****

KDLabelContainer lblc**** KDSpinner

spn****

cmb**** btn****

KDComboBox KDButton

KDBizPromptBox prmt**** KDTextField txt***** KDRadioBox rb***** kDWorkButton wbtn****

69. 1. http://subclipse.tigris.org/update eclipse 中加入svn插件

2. 安装svn 和 TortoiseSVN

3. 然后把 SVNService.exe 复制 到 svn 安装路径下的bin目录下去

4. 创建文件仓库:svnadmin create D:\\SVNStore

5. 启动服务器:SVNService -install -d -r d:\\ SVNStore

修改服务器目录:SVNService -setup -d -r c:\\otherplace\\ SVNStore

删除服务器目录:SVNService - remove -d -r d:\\ SVNStore Authz:[groups]

project = wp,dy,sg,wy,xsq [SVNStore:/] @project = rw * = r [njnf:/] @project = rw * = r [/]

@project = rw # * = r

70. 表格列值的加减乘除

UIRuleUtil.getBigDecimalValue(table.getCell(i-1,1).getValue())-UIRuleUtil.getBigDecimalValue(table.getCell(i-2,1).getValue())

71. 部署问题

1. q:部署后,登陆服务器,报‘登陆应用服务器失败’。

a:将本服务器不存在的元数据删除掉,如:entity.mapping中没有的实体关系 72. 工作流脚本代码参考:

isCustomer = false;

com.kingdee.eas.basedata.master.cssp.CustomerInfo cstmInfo = new com.kingdee.eas.basedata.master.cssp.CustomerInfo(); isCustomer =

cstmInfo.getBOSType().equals(com.kingdee.bos.util.BOSUuid.read(asstActId).getType()); msgHeader=\; msgBody=\;

com.kingdee.eas.fi.ar.OtherBillInfo info =

com.kingdee.eas.fi.ar.OtherBillFactory.getLocalInstance ( __bosContext ).getOtherBillInfo( new com . kingdee . bos . dao . ormapping . ObjectUuidPK ( billID ) ) ; com.kingdee.eas.basedata.master.cssp.CustomerInfo customerInfo = new com.kingdee.eas.basedata.master.cssp.CustomerInfo();

customerInfo.setId(com.kingdee.bos.util.BOSUuid.read(info.getAsstActID()));

isRequire = com . kingdee . eas . scm . credit . util . CreditUtils . isRequireVerifyCreditAtAudit (__bosContext , info.getCompany() ,customerInfo, com . kingdee . eas . scm . credit . CreditFormulaSceneEnum . ARBILL_VALUE ) ; isOverspend = false; isTimeout=false; if ( isRequire ) {

com . kingdee . eas . scm . credit . CreditCondition creditCondition = new com . kingdee . java.util.Map billNumeric = new java.util.HashMap(); com.kingdee.eas.basedata.assistant.PaymentTypeInfo pt = new eas . scm . credit . CreditCondition ( __bosContext ) ;

6. SVNStore\\conf:文件仓库的conf下配置文件修改:

com.kingdee.eas.basedata.assistant.PaymentTypeInfo();

pt.setId(com.kingdee.bos.util.BOSUuid.read(com.kingdee.eas.scm.sd.sale.util.SaleConstancreditCondition . putCondition ( customerInfo ,info.getCompany(), pt, com . kingdee . eas . billNumeric.put(com.kingdee.eas.scm.credit.CreditCondition.BILL_NUMERIC_AMOUNT,com.king

t.PAYMENTTYPEID_CREDITSALE));

scm . credit . CreditFormulaSceneEnum . ARBILL_VALUE,billNumeric) ;

dee.eas.fi.ar.app.util.ArServerUtils.readSubmitedReceivableBillCreditAmount(__bosContext ,creditCondition)); }

creditAmount=\; usedCreditAmount=\; creditBalance= 0;

isEspeciallyAudit = false; isWarning=false; isCancel=false; overDays=0;

if ( isOverspend || isTimeout ) {

msgHeader = creditCtrlResult.getMsgHeader();

isEspeciallyAudit = creditCtrlResult.isEspeciallyAudit(); isWarning = creditCtrlResult.isWarning(); isCancel = creditCtrlResult.isCancel(); }

msgBody = creditCtrlResult.getMsgBody(); overDays=creditCtrlResult.getOverDays();

creditAmount = creditCtrlResult . getCreditAmount ().toString() ; usedCreditAmount = creditCtrlResult . getUsedCreditAmount ().toString() ; creditCondition.setBillNumeric(billNumeric); creditCondition.setBillNumber(info.getNumber()); creditCondition.setBillDate(info.getBizDate());

creditCtrlResult = com . kingdee . eas . scm . credit . CreditControlFacadeFactory . isTimeout = creditCtrlResult.isTimeout(); isOverspend = creditCtrlResult . isOverspend ( ) ;

getLocalInstance ( __bosContext ).verifyCredit ( creditCondition ) ;

creditBalance = creditCtrlResult . getCreditBalance ().toString() ;

73. 单据生成HTML文件

TransferGUItoHTML ht = new TransferGUItoHTML(this); //EditUI实例 ht.transferToHtml(editData.getId().toString());

System.out.println(ht+\74. 重写排序

mainQuery.getSorter().clear();

mainQuery.getSorter().add(new SorterItemInfo(\ SorterItemInfo sortItem = mainQuery.getSorter().get(0); sortItem.setSortType(SortType.DESCEND);

this.getMainQuery().setFilter(filter);

75. 关于隐藏分录新增、删除按钮的示例代码

54版本的需要手工编辑代码,参考如下方法,将其加入到onload()中调用。 private void hidePanelButtons(KDTable table){ //隐藏按钮 Component c = table.getParent().getParent(); if (c instanceof DetailPanel) {

DetailPanel panel = (DetailPanel) c; //获取btn Component[] components = panel.getComponents(); for(int i = 0; i < components.length; i++){ Component component = components[i]; if (component instanceof KDPanel) { KDPanel kdPanel = (KDPanel) component; if(\panel.remove(kdPanel); }

if(\

Rectangle entryRect = new Rectangle(0, 0,table.getWidth(),table.getHeight()+ 29); kdPanel.setBounds(entryRect);

kdPanel.putClientProperty(\

panel.add(kdPanel, new KDLayout.Constraints(KDLayout.Constraints.ANCHOR_TOP | KDLayout.Constraints.ANCHOR_RIGHT | KDLayout.Constraints.ANCHOR_LEFT | KDLayout.Constraints.ANCHOR_BOTTOM , entryRect)); } } } } }

76. 分录新增,删除,插入前事件,写在Onload方法里

class TableBeforeAction implements BeforeActionListener {

public void beforeAction(BeforeActionEvent arg0) {

try {

if (arg0.getType() == BeforeActionEvent.ACTION_ADD_ROW) { }

// if (kdtPrtCheck() == true) { // arg0.setCancel(true); // }

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4