用友NC客户化开发帮助文档 - 图文
更新时间:2024-04-20 23:05:01 阅读量: 综合文库 文档下载
- 用友nc接口开发推荐度:
- 相关推荐
NC开发帮助
? A
? Accsubjdoc
// 通过系统提供的会计科目接口查询所有会计科目 Accsubjdoc itf =
(Accsubjdoc) NCLocator.getInstance().lookup(Accsubjdoc.class.getName());
nc.vo.bd.b02.AccsubjVO[] targetSubjVos = itf.queryAccsubjVOs(pk_glorgbook, null, false);
作者:jieely
AccperiodVO
//查询会计期间
AccperiodVO[] accperiodVOs =
(AccperiodVO[]) HYPubBO_Client.queryByCondition(AccperiodVO.class, \
? addBetch
a.无参批量更新
String sql = \?aaa? where dept_code=?bbb?\session.addBatch(sql); //添加需要执行的同构SQL int rows = session.executeBatch(); //执行
b.有参批量更新
String sql = \?aaa? where dept_code=?”; SQLParameter param = new SQLParameter(); //构造参数对象 param.addParam(“bbb”); //添加参数
session.addBatch(sql, param); //添加需要执行的同构SQL int rows = session.executeBatch(); //执行
? afterEdit
@Override//表的编辑后赋默认值方法(UI类重写方法) *先执行afterEdit,后执行公式*
public void afterEdit(BillEditEvent event) {
super.afterEdit(event);
if(event.getKey().equals(\)) {
this.getBillCardPanel().execHeadEditFormulas(); }
else if (event.getTableCode().equals(\) && {
this.getBillCardPanel().setBodyValueAt(new UFBoolean('N'), event.getRow(), this.getBillCardPanel().setBodyValueAt(new UFBoolean('Y'), event.getRow(), }
event.getKey().equals(\))
\); \); }
? ALTER
//增加字段
ALTER TABLE tablea ADD newcol char(20)
//更改字段名
ALTER TABLE tablea CHANGE newcol newrow char(50)
//更改字段类型
ALTER TABLE tablea MODIFY newrow char(30)
//删除字段
ALTER TABLE tablea DROP newrow
? ASSVO
凭证辅助核算弹出窗口相关类
AssRefTableEditorRenderer FreeValueEditDialog VoucherTable FreeValueList
? ArrayList
ArrayList list = new ArrayList(); …..
list.add();
SettleVO[] vos = new SettleVO[list.size()]; vos = list.toArray(vos);//List与VO数组转换
? B
? BillCode
//得到单据号
BillcodeGenerater billNoGen = new BillcodeGenerater(); billno = billNoGen.getBillCode(\
? BillData
BillData bd = getBillCardPanel().getBillData();
? BillItem
BillItem item = bd.getBodyItem(NodeInfo.NAME_TABLECODE1, \);
? BillField
@Override//修改单据状态时需重写此方法
protected IBillField createBillField() {
return BillField.getInstance(); }
? Billtable
//设置表体默认选择行号
getBillCardPanelWrapper().getBillCardPanel().getBillTable().changeSelection(0, 0, true, true);
? Button
//自定义按钮
public ButtonVO getFujian_btn() { }
ButtonVO btnVO = new ButtonVO();
btnVO.setBtnNo( IprivateButton.Fujian_btn ); btnVO.setBtnName( \附件管理\ ); btnVO.setHintStr( \附件管理\ );
btnVO.setOperateStatus( new int[]{IBillOperate.OP_NOTEDIT} ); // 在非新增return btnVO;
和非编辑状态下可用
//在UI中设置按钮状态
getButtonManager().getButton(nc.ui.trade.button.IBillButton.Add).setEnabled(false);
//单据初始化时去掉无用按钮 public void removeBtn() {
getButtonManager().getButton(IBillButton.Line).removeChildButton(getButtonMana
ger().getButton(IBillButton.InsLine));
getButtonManager().getButton(IBillButton.Line).removeChildButton(getButtonMana}
ger().getButton(IBillButton.CopyLine));
//把按钮变亮
m_boMinusSelf.setEnabled(true); ui.updateButton(m_boMinusSelf);
? Byte[]
public static final byte[] m_ENTER = {0x0d, 0x0a};//换行符 ASCII码: 0x0d 0x0a
? C
? CaseWhen
ORACLE: Case…..When 语句
SELECT
(CASE dr WHEN 0 THEN '有效' WHEN 1 THEN '无效' END) AS 显示 FROM bd_corp
? catch
try{
}
catch(DbException e){
}
//如果是语法错误
if(e.isBadSQLGrammar()){ }
//如果是数据一致性错误
if(e.isDataIntegrityViolation()){ }
Logger.error(\数据一致性错误:\+e.getMessage(),e); Logger.error(\语法错误:\+e.getMessage(),e);
? CheckRule
<前台校验类> XXXUICheckRule //校验数据是否重复
public IUniqueRule[] getItemUniqueRules(String tablecode) {
if( \{
IUniqueRule[] unique = null; unique = new IUniqueRule[]{
new UniqueRule(\座类编码不能重复\String[]{(\ }
}
};
return unique;
return null;
//校验是否为空
public ICheckRule[] getItemCheckRules(String tablecode) {
CheckRule[] rules = new CheckRule[] {
\,
new CheckRule(\【NC结算方式编码】\, false, null, null) }
};
return rules;
? checkPrerequisite
//对于控制集团不能打开节点,只有公司可以打开节点的处理
//在ClientUI中覆写Toftpanel的方法:
public String checkPrerequisite()
{
String pk_corp = _getCorp().getPk_corp(); if (pk_corp.equals(\
return \当前处于集团,此功能点无法进入\ }
return null; }
? ClientEnvironment
? Column
//单据模板获得jtable可通过getBillCardPanel().getBillTable() //获取列表模型 TableColumnModel tcm=table.getColumnMode(); //第n列设置为隐藏
TableColumn hideColumn = table.getColumn(\第n列\ //隐藏第n列设置
tcm.removeColumn(hideColumn); //显示第n列设置
tcm.addColumn(hideColumn); //把i列移动到第j列 tcm.moveColumn(i, j);
getBillCardPanel().getBodyPanel().hideTableCol(strKey);//隐藏 getBillCardPanel().getBodyPanel().showTableCol(strKey);//显示
? ComboBox
UIComboBox typeCom = this.getBillCardPanel().getBodyItem(\typeCom.addItems(Object[] obj);
(UIComboBox)
? Connection
PersistenceManager sessionManager = PersistenceManager.getInstance(); JdbcSession session = sessionManager.getJdbcSession(); Connection con = session.getConnection(); PreparedStatement stmt = null; stmt = prepareStatement(con, sql); finally{ stmt.close(); con.close();
sessionManager.release();}
? ConnectException
//启动NC时抛异常
java.net.ConnectException: Connection refused: connect 原因:80端口被占用
? ConditionVO
//取查询对话框VO值
ConditionVO[] conVOs = getQueryDLG().getConditionVO(); for (int i = 0; i < conVOs.length; i++)
{
if (\.equals(conVOs[i].getFieldCode())) { }
else if() { }
}
……
billdate = conVOs[i].getValue();
? Coperatorid
//操作员所对应业务员
cworkpsnid->getColValue(bd_psndoc,pk_psndoc,pk_psnbasdoc,getColValue(sm_userandclerk,pk_psndoc,userid,coperatorid))
? createQueryDLG()
/**
* 重写父类方法,取得查询对话框,如有动态显示下拉框和默认值需重写此方法 */
protected QueryDLG createQueryDLG() {
FundReportDLG dlg = new FundReportDLG(); dlg.setTempletID(
getUIControl()._getPk_corp(), this.getModuleCode(),
getUIControl()._getOperator(), null);
//设置默认日期
QueryConditionVO[] qryvos = dlg.getConditionDatas(); for(int i=0;i if(qryvos[i].getFieldCode().equals(\)){ qryvos[i].setValue(getClientEnvironment().getDate().toString()); } } } break; return dlg; ? CARDPANEL if(clientUI.isListPanelSelected())//如果是选取的列表界面 clientUI.setCurrentPanel(BillTemplateWrapper.CARDPANEL); ? Control control userpasswords2 //运行【用户帐户】 ? Custflag 说明:0客户 1供应商 2既是客户又是供应商 3既是供应商又是客户 ? D ? DapCall nc.ui.pf.pub.DapCall getPkcorp()//取公司 getOperator()//取操作员 ? dataNotNullValidate // 验证不能为空的字段 getBillCardPanelWrapper().getBillCardPanel().dataNotNullValidate(); ? dataSource String dataSource = DataSourceCenter.getInstance().getSourceName();//取当前数据源 ? Date UFDate date = ClientEnvironment.getInstance().getDate();//得到登陆日期 select to_char(last_day(to_date('20100625','yyyymmdd')),'dd') from dual;//得到每月多少天 ? DateFormat public class DateTest { public static void main(String[] args) { String dates = \日期时间 DateFormat df = new SimpleDateFormat(\日期格式化辅助类 Date d; try { d = df.parse(dates);//格式化日期 if (d.getDay() == 0 || d.getDay() == 6)//判断是不是双休日 System.out.println(\日期:[\是双休日\ else System.out.println(\日期:[\不是双休日\ } catch (ParseException e) { e.printStackTrace(); } } } ? dataNotNullValidate public void onBoSave() throws Exception { getBillCardPanelWrapper().getBillCardPanel().getBillData().dataNotNullValidate boolean flag = true; try { } catch (IllegalArgumentException e) { } catch (Exception e) { } super.onBoRefresh(); if(flag) this.getSelfUI().showErrorMessage(\【资产名称】已存在,请检查\); return ; Logger.info(e); flag = false; super.onBoSave(); ();//UAP模板设置必输项 } ? Decode DECODE的语法:DECODE(value,if1,then1,if2,then2,if3,then3,...,else) 表示如果value等于if1时,DECODE函数的结果返回then1,...,如果不等于任何一个if值,则返回else。通过一些函数或计算替代value,是可以使DECODE函数具备大于、小于或等于功能。 ? Delete 删除废数据的方法如下: 有个表有3个字段ID, PID, NAME; 用父子结构来保存树的信息。 其中ID代表节点编号,PID是父节点编号; 由于删除的时候只删除了ID = id的记录, 没有把所有PID指向id的数据删除,导致大量无用的数据滞留 DELETE FROM TEST1 WHERE ID IN (SELECT ID FROM TEST1 MINUS SELECT ID FROM TEST1 START WITH PID IS NULL CONNECT BY PRIOR ID = PID); //删除表中重复记录: DELETE FROM a a1 WHERE ROWID IN (SELECT rd FROM (SELECT ROWID rd, ROW_NUMBER() OVER(PARTITION BY bm,mc ORDER BY ROWID) rn FROM a) WHERE rn <> 1); ? delLine //表体增删行的操作,注意加上这一句代码 if ( event.getKey().equals(\) ) { for( int i = 0 ; i < delnum ;i++) { } this.getBillCardPanel().getBodyPanel().getTable().selectAll(); this.getBillCardPanel().delLine(); for( int j = 0 ; addnum.intValue() > 0 && j < addnum.intValue() ;j++ ) { } } this.getBillCardPanel().addLine(); this.getBillCardPanel().setBodyValueAt( \ + (j+1) , j, \); ? DesktopPanel //nc.ui.sm.desktop.DesktopPanel private void initialize(){ //============TODO modify by jtxr_jieely 【环保部项目专用】登陆后自动隐藏左侧树状条 String pk_corp = nc.ui.pub.ClientEnvironment.getInstance().getCorporation().getPrimaryKey(); if(\.equals(pk_corp))//只针对144001公司,主键为1002 { setLayout(new BorderLayout()); setBackground(new Color(0xC1CCDB)); centerPanel = new JPanel(new BorderLayout()); centerPanel.setOpaque(false); centerPanel.setBorder(BorderFactory.createEmptyBorder(5, 3, 3, 5)); centerPanel.add(getTabbedPane(), BorderLayout.CENTER); add(centerPanel, BorderLayout.CENTER); add(getSysFuncBtnPanel(), BorderLayout.NORTH); return; } // ============END 2010-08-25 setLayout(new BorderLayout()); setBackground(new Color(0xC1CCDB)); centerPanel = new JPanel(new BorderLayout()); centerPanel.setOpaque(false); centerPanel.setBorder(BorderFactory.createEmptyBorder(0,3, 2,3)); centerPanel.add(getSingleSidZoomPane(), BorderLayout.WEST); centerPanel.add(getTabbedPane(), BorderLayout.CENTER); add(centerPanel, BorderLayout.CENTER); add(getSysFuncBtnPanel(), BorderLayout.NORTH); } ? DetailReportBaseEx //报表UI类中的反注册按钮方法 protected void setPrivateButtons() { } this.unRegisterButton(ButtonAssets.m_boRefresh); this.unRegisterButton(ButtonAssets.m_boGroup); this.unRegisterButton(ButtonAssets.m_boFilter); this.unRegisterButton(ButtonAssets.m_boCross); this.unRegisterButton(ButtonAssets.m_boSort); ? dialog /** * 启用系统运行提示框 避免造成假死现象 */ private void onButton_import() { } /** * 系统运行提示框 */ private Container getCurrUI() { // 该操作是耗时操作,所以启用系统运行提示框 Runnable runImpDoc = new Runnable() { }; new Thread(runImpDoc).start(); public void run() { } BannerDialog dialog = new BannerDialog(getCurrUI()); dialog.start(); try { } catch (Exception e) { } dialog.end();// 销毁系统运行提示框 dialog.end(); e.printStackTrace(); return; importData(); } return this.getSelfUI(); ? E ? Excel //获取sheet中的HSSFRow对象,如果没有就创建一个 private HSSFRow getRow(HSSFSheet sheet, int rowNum) { HSSFRow row = sheet.getRow(rowNum); return row == null ? sheet.createRow(rowNum) : row; } //获取sheet中的HSSFCell对象,如果没有就创建一个 private HSSFCell getCell(HSSFRow row, short cellNum) { HSSFCell cell = row.getCell(cellNum); return cell == null ? row.createCell(cellNum) : cell; } //单元格赋值 public static void setCellValue(HSSFCell cell ,String cellValue) { cell.setEncoding(HSSFWorkbook.ENCODING_UTF_16);//这一句是解决中文乱码问题 cell.setCellValue(cellValue);//单元格赋值 } //设置单元格背景颜色(为红色) public static void setCellColorRed(HSSFCellStyle style, HSSFCell cell) { style.setFillForegroundColor(HSSFColor.RED.index); style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); cell.setCellStyle(style);; }//说明:HSSFColor里有好多颜色,可根据要求改为其他 //获取单元格背景颜色 public static void getCellColor(HSSFCell cell ) { HSSFCellStyle style = cell.getCellStyle(); short colorIndex = style.getFillForegroundColor(); } ? Exe 1.0 用java调用windows系统的exe文件,比如notepad,calc之类: public class Demo{ public static void main(String args[]){ Runtime rn=Runtime.getRuntime(); Process p=null; try{ p=rn.exec(notepad); }catch(Exception e){ System.out.println(\ } } } 2.0调用其他的可执行文件,例如:自己制作的exe,或是下载安装的软件 public class Demo{ public static void main(String args[]){ Runtime rn=Runtime.getRuntime(); Process p=null; try{ p=rn.exec(\ }catch(Exception e){ System.out.println(\ } } } ? EXP/IMP exp nc50/nc50@MINE file=e:\\0328.dmp OWNER = nc50//导出 imp nc50/nc50@mine file=e:\\0227.dmp fromuser=nc50test touser=nc50//导入 ? ExportExcel import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import javax.swing.JFileChooser; import nc.bs.logging.Logger; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; public class ExportExcel { private ClientUI clientUI = null; public ExportExcel(ClientUI clientUI) { this.clientUI = clientUI; } /** * 生成Excel文件 */ public String makeExcel(Object[] cellVOs) { String[] keys1 = (String[]) cellVOs[0]; String[] keys2 = (String[]) cellVOs[1]; InputStream inputstream = null; OutputStream outputstream = null; String filePath = getFilePath(); if (filePath == null) return filePath; this.CreateExcel(filePath); try { inputstream = new FileInputStream(filePath); HSSFWorkbook book = new HSSFWorkbook(inputstream); HSSFSheet sheet1 = book.getSheetAt(0); for (int i = 0; i < keys1.length; i++) { int rowNum = i; short cellNum1 = 1; String goalPK1 = keys1[i]; HSSFRow row1 = getRow(sheet1, rowNum); setCellValue(getCell(row1, cellNum1), goalPK1); } for (int i = 0; i < keys2.length; i++) { int rowNum = i; short cellNum2 = 2; } } String goalPK2 = keys2[i]; HSSFRow row2 = getRow(sheet1, rowNum); setCellValue(getCell(row2, cellNum2), goalPK2); File excel = new File(filePath); outputstream = new FileOutputStream(excel); book.write(outputstream); } catch (IOException e) { Logger.error(\错误:\} finally { if (inputstream != null) { try { inputstream.close(); } catch (IOException e) { Logger.error(\错误:\ } } if (outputstream != null) { try { outputstream.close(); } catch (IOException e) { Logger.error(\错误:\ } } } return filePath; /** * 获取sheet中的HSSFRow对象,如果没有就创建一个 * * @param sheet * @param rowNum * 所在的行,索引从0开始 * @return */ private HSSFRow getRow(HSSFSheet sheet, int rowNum) { HSSFRow row = sheet.getRow(rowNum); return row == null ? sheet.createRow(rowNum) : row; } /** * 获取sheet中的HSSFCell对象,如果没有就创建一个 * * @param row * HSSFCell对象所在的行 * @param cellNum * 所在的列,索引从0开始 * @return */ private HSSFCell getCell(HSSFRow row, short cellNum) { HSSFCell cell = row.getCell(cellNum); return cell == null ? row.createCell(cellNum) : cell; } /** * 设置单元格值 * * @param cell * @param value */ @SuppressWarnings(\ private void setCellValue(HSSFCell cell, String cellValue) { cell.setEncoding(HSSFWorkbook.ENCODING_UTF_16); cell.setCellValue(cellValue);// 单元格赋值 } /** * 得到生成文件的全路径 * * @return */ private String getFilePath() { String filePath = null; JFileChooser chooser = new JFileChooser(); chooser.setMultiSelectionEnabled(false); chooser.setFileFilter(new javax.swing.filechooser.FileFilter() { public boolean accept(File file) { return file.getName().toLowerCase().endsWith(\ } public String getDescription() { return \工作薄(*.xls)\ } }); int returnVal = chooser.showOpenDialog(clientUI); if (returnVal == JFileChooser.CANCEL_OPTION) { clientUI.showHintMessage(\未生成Excel文件\ } else { try { File file = chooser.getSelectedFile(); filePath = file.getCanonicalPath().endsWith(\file.getCanonicalPath() + \ } catch (IOException e) { Logger.error(\错误:\ e.printStackTrace(); } } return filePath; } /** * 在指定路径下创建Excel文件 } */ private void CreateExcel(String filePath) { FileOutputStream fOut = null; try { HSSFWorkbook workbook = new HSSFWorkbook(); HSSFSheet sheet = workbook.createSheet(\ HSSFRow row = sheet.createRow((short) 0); row.createCell((short) 0); fOut = new FileOutputStream(filePath); workbook.write(fOut); } catch (FileNotFoundException e) { Logger.error(\错误:\ e.printStackTrace(); } catch (IOException e) { Logger.error(\错误:\ e.printStackTrace(); } finally { try { fOut.flush(); fOut.close(); } catch (IOException e) { Logger.error(\错误:\ e.printStackTrace(); } } } ? F ? File //处理单据上的图片类型 //首先在模版上设置此字段数据类型为: 图片类型 //在节点上新增单据时,双击此字段可以选择图片(和参照类似),选择后界面会自动显示 //单据保存时: //得到路径 String path = getBillCardPanel().getHeadItem(\ //取到文件名然后上传到服务器(默认路径是 nchome\\webapps\\nc_web\\ncupload ) File file = new File(path); FileManagerUtil.saveFileToServer(\ //然后可以把服务器存取此 图片的路径和文件名 赋值到VO保存到数据库. //以后查询的时候转载图片: //首先取到此单据 VO 中的: 图片路径和文件名 File file = new File(vo.getUserPhoto); //用下边方法把图片下载到本地(默认是在和缓存同级的 NCCODE/ 下) FileManagerUtil.saveFileToLocal(\//构造 URL URL url = FileManagerUtil.getFileURLLocal(\//为图片字段赋值 ImageIcon = new ImageIcon(url); ((UILabel)getBillCardPanel().getHeadItem(\ImageIcon(url)); ? FileCreate //在用户目录\\jieely\\下创建文件test.txt public static void main(String[] args) { String userhome = System.getProperty(\); String path = \; String absPath = userhome+path; RandomAccessFile mm = null; try { File folder = new File(absPath); if (!folder.exists()) folder.mkdir(); // 如果不存在则建该文件夹 mm = new RandomAccessFile(absPath+\, \); mm.writeBytes(\); } } catch (FileNotFoundException e) { } catch (IOException e) { } Logger.error(e); e.printStackTrace(); Logger.error(e); ? FileFilter A: 设置读取指定类型的文件 public class PhotoFileFilter extends FileFilter { public boolean accept(File f) { if (f.isDirectory() || f.getName().endsWith(\|| f.getName().endsWith(\|| f.getName().endsWith(\ { return true; } else { return false; } } public String getDescription() { return \图片\ } } B:根据规则过滤出符合条件的文件列表 File file = new File(\); FileFilter fileFilter = new FileFilter()//过滤出【导入日期】当天的凭证 { public boolean accept(File pathname) { String tmp = pathname.getName(); if (tmp.startsWith(\) && tmp.endsWith(\)) return true; return false; } }; } File[] files = file.listFiles(fileFilter); ? FTPClient //连接FTP读取文件 FTPClient ftp = new FTPClient(); BufferedReader br = null; try { ftp.connect(“172.168.2.214”, 21); ftp.login(“root”, “root”); ftp.changeWorkingDirectory(“\\oracel\%updata\\”); InputStream is = ftp.retrieveFileStream(“HX_20091124_01.TXT”); if (is == null) throw new BusinessException(\没有有找到需要导入的文件\\n\+ fileName ); InputStreamReader isr = new InputStreamReader(is); br = new BufferedReader(isr); } ? G ? getBillCardPanel getBillCardPanel().getBodySelectedScrollPane().getName();//获得当前操作的页签 ? getBillNo //取得单据号(从NC取,服务器端) String billNo = new nc.bs.trade.business.HYPubBO(). getBillNo(ISYYSBilltype.CTRLDDEPT_BGT_BILL, parentVo.getPk_corp(), null, null); // 设置单据号 //取得单据号(从NC取,客户端) return HYPubBO_Client.getBillNo(getUIControl().getBillType(), _getCorp().getPrimaryKey(), null, null); ? getBodyValue //得到表体选择行的某个字段值 int row = getSelfUI().getBillCardPanel().getBillTable(\).getSelectedRow(); Object code = getSelfUI().getBillCardPanel().getBillTable(\).getValueAt(row, column); ? getBodyValueVOs //得到表体VO BodyVO[] vos = (BodyVO[])ui.getBillCardPanel().getBillModel().getBodyValueVOs(\.wdyx_gg.lbdy.BVO\ ? getBusinessActionType ? public int getBusinessActionType() { } return IBusinessActionType.BD;// getButtonManager //在UI中设置按钮状态 getButtonManager().getButton(nc.ui.trade.button.IBillButton.Add).setEnabled(false); ? getCurrUI //耗时操作,启用系统运行提示框 private void onButton_import(){ Runnable runImpDoc = new Runnable(){ public void run(){ BannerDialog dialog = new BannerDialog(getCurrUI()); dialog.start(); try{ importFile(); } catch(Exception e) { dialog.end(); e.printStackTrace(); return; } dialog.end();//销毁系统运行提示框 } }; new Thread(runImpDoc).start(); } } return this; private Container getCurrUI(){ ? getFormulas // 对参照里的字段设置为参照 @Override//AbstractRefModel public String[][] getFormulas() { return new String[][]{{\,\peratorid)\}}; } ? getHeadCondition // 类MyEventHandler重写方法,作用于多视图共用一表时的查询 protected String getHeadCondition() { } String whereSql = super.getHeadCondition(); if (whereSql == null) whereSql = \ + this.getUIController().getBillType() + \; whereSql = whereSql + \ + else this.getUIController().getBillType() + \; return whereSql; ? getHeadItem //得到表头指定字段值 String code = (String) this.getSelfUI().getBillCardPanel().getHeadItem(\ ? getRowCount //得到表格行数 this.getJScrollPane().getTableModel().getRowCount(); ? getTotalTableModel //得到表体某字段的合计数 UFDouble sum = (UFDouble) this.getBillCardPanel().getTotalTableModel().getValueAt(0, getBillCardPanel().getBillModel().getItemIndex(\ ? getSelectedRow //得到表体选择行 this.getBillCardPanel().getBillTable().getSelectedRow(); ? getValueAt //得到单元格值 this.getJScrollPane().getTableModel().getValueAt(row, col); ? getUser getClientEnvironment().getUser().getPrimaryKey();//得到操作员ID ? GLorgbookpk refCorp = new UIRefPane(); refCorp.setPreferredSize(new java.awt.Dimension(200, 22)); refCorp.setRefNodeName(RefNodeNameConst.GLORGBOOK);//设置参照为【主体帐薄】 refCorp.setMultiSelectedEnabled(true); String pk_corp = String pk_glorgbook = ClientEnvironment.getInstance().getCorporation().getPrimaryKey();//当前公司 BDGLOrgBookAccessor.getDefaultPk_GLOrgBook(pk_corp);//主体帐薄主键 refCorp.setPK(pk_glorgbook); ? H ? HashMap //HashMap存储查询结果集例一 List list = (List)session.executeQuery(sql.toString(), new MapstProcessor()); bodyvos = new KcSpMxBodyVO[list.size()+1]; for(int i=0;i bodyvos[i+1] = new KcSpMxBodyVO(); HashMap hash = (HashMap)list.get(i); Iterator it = hash.keySet().iterator(); while(it.hasNext()){ String key = (String)it.next(); if(\.equals(key)||\.equals(key)){ String forshort = hash.get(\).toString(); String voucherno = hash.get(\).toString(); String vouchercode = forshort +\+ (\+voucherno).substring(voucherno.length()-1); bodyvos[i+1].setAttributeValue(\,vouchercode); } else{ } } bodyvos[i+1].setAttributeValue(key, hash.get(key)); } // HashMap存储查询结果集例二 sessionManager = PersistenceManager.getInstance(); session = sessionManager.getJdbcSession(); ArrayList rslist = (ArrayList) session.executeQuery(sql.toString(), new HashMap hashmap = new HashMap(); if(rslist!=null && rslist.size()>0){ } for(int i=0;i int flag = billBVO[i].getOperateflag(); if(flag == 0){ SrcBillSettle_BVO settleBVO = new SrcBillSettle_BVO(); String settlekey = billBVO[i].getSettlecode(); Object[] ncsettleinfo = (Object[])hashmap.get(settlekey); for(int i=0;i Object[] rows = (Object[])rslist.get(i); hashmap.put(rows[0], rows); ArrayListProcessor()); settleBVO.setPk_ncsettletype(TJYCPubVO.getString_TrimZeroLenAsNull(ncsettleinf settleBVO.setSettlemoney(billBVO[i].getSalesum());// 销售金额 o[1]));// 外键:NC结算方式PK settleBVO.setSettleaccount(TJYCPubVO.getString_TrimZeroLenAsNull(ncsettleinfo[ 2]));// 结算科目 settleBVO.setVdef1(TJYCPubVO.getString_TrimZeroLenAsNull(ncsettleinfo[3]));// } SrcBillSettle_BVO[] settleBVOs = new SrcBillSettle_BVO[list.size()]; list.toArray(settleBVOs); list.add(settleBVO); } NC结算名称 ? HashTable // ArrayList去掉重复数据 public static void main(String[] args){ ArrayList list = new ArrayList(); list.add(\Iterator it1 = list.iterator(); HashTable hash = new HashTable(); while(it1.hasNext()){ Object obj = it1.next(); hash.put(obj, obj); } //HashTable存储时自动去除了重复的数据 Iterator it2 = hash.keySet().iterator(); list = new ArrayList(); while(it2.hasNext()){ list.add(it2.next()); } System.out.println(list.size()); } ? Help //修改帮助页面的标题 E:\%ufsoft\\nchome\\resources\\lang\\simpchn\\funcode 下配置文件 ? I ? IDBCacheBS //后台查询,V55以后必须使用:利用IDBCacheBS进行一般的SQL查询 IDBCacheBS dbcf = (IDBCacheBS) NCLocator.getInstance().lookup(IDBCacheBS.class.getName()); ArrayList result = (ArrayList) dbcf.runSQLQuery(sql, new ArrayListProcessor()); if (result.size() > 0){ for (int i = 0; i < result.size(); i++){ Object[] values = (Object[]) result.get(i); OPERATOR = (String) values[1]; }} ? Iif 公式iif函数 iif(condition,thenvalue,elsevalue)判断条件condition是否满足,如果满足返回第一个值thenvalue,如果不满足返回第二个值elsevalue,比如iif(var1==\函数支持嵌套比如:iif(var1==\例: num->iif(num >0, num,\如果num>0,则num==num,否num=”” ? Int?String ○1int i = Integer.parseInt([String]); ○2int i = Integer.valueOf(my_str).intValue(); ? IVOPersistence IVOPersistence service = IVOPersistence)NCLocator.getInstance().lookup(IVOPersistence.class.getName());//VO持久层接口类 ? J ? JFileChooser JFileChooser chooser = new JFileChooser(); //弹出文件选择框 int result = chooser. showOpenDialog(this); if(result == JFileChooser.CANCEL_OPTION)//取消按钮 //设置上次读取文件的路径 public static File _currentDirectoryPath = null; public File getCurrentDirectoryPath() { } public void setCurrentDirectoryPath(File currentDirectoryPath) { } private File addFile() { File file = null; JFileChooser chooser = new JFileChooser(); chooser.setMultiSelectionEnabled(false); chooser.setCurrentDirectory(this.getCurrentDirectoryPath()); ExcelFileFilter filter = new ExcelFileFilter(); chooser.setFileFilter(filter); int returnVal = chooser.showOpenDialog(ui); if (returnVal == JFileChooser.CANCEL_OPTION) { } else { ui.showHintMessage(\没有选择文件\); return _currentDirectoryPath; _currentDirectoryPath = currentDirectoryPath; _currentDirectoryPath = chooser.getSelectedFile();// 保存文件读取路径 file = chooser.getSelectedFile(); } } if( !file.getPath().toLowerCase().endsWith(\) ) { } ui.showErrorMessage(\请选择正确的数据文件\); return null; return file; //设置是否可多选文件 chooser.setMultiSelectionEnabled(false); //得到选择的文件(可以多选getSelectedFiles()) chooser. getSelectedFile(); //设置读取时显示指定类型的文件 class ExcelFileFilter extends javax.swing.filechooser.FileFilter } public String getDescription() { } return \数据文件(.xls)\; {//内部类.在JfileChooser打开目录时调用 public boolean accept(File file) { } if (file.isDirectory() || return true; return false; file.getPath().toLowerCase().endsWith(\) ) else ? K ? L ? Leaf UIPane.setNotLeafSelectedEnabled(false);//设置参照中非叶子节点不可选择 ? Listener BillTabbedPaneTabChangeListener//多表体页签切换监听 ? List Collections.reverse(list); //倒序输出list ? ListPane getBillListPanel().getHeadTable().getSelectionModel().setSelectionInterval(0, 0); //默认选中列表第一行 protected void initSelfData(){ } this.getBillListPanel().setMultiSelect(true);//设置列表界面可多选 ? Lock ORACLE 数据库查锁 SELECT T2.USERNAME, T2.SID, T2.SERIAL#, T2.LOGON_TIME FROM V$LOCKED_OBJECT T1, V$SESSION T2 WHERE T1.SESSION_ID = T2.SID ORDER BY T2.LOGON_TIME; ORACLE 数据库解锁 ALTER SYSTEM KILL SESSION ' sid,serial#'; ? Logger //DMO打印信息方法 Logger.error(\语法错误:\ ? M ? Menu //去掉表体右键菜单 getMainBillCardPanel().getBillCardPanel().setBodyMenuShow(false); ? MessageDlg ○1MessageDialog.showWarningDlg(this, \系统提示\提示信息\○2this.showErrorMessage(\提示信息\ ? modifyRootNodeShowName UI类构造函数里,加载此方法设置树的根节点显示名称 ? N ? NCLocatorProxy //前台数据访问 IDataDealItf dealData = (IDataDealItf) NCLocatorProxy.getLocator().lookup(IDataDealItf.class.getName()); ? Nvl nvl(zt,?N?) = ?Y? //nvl(a,b)表示.如果a为空的话,那么赋值b给a ? O ? onBoSave 在onbosave()方法里面加入 UI.getBillCardPanel().dataNotNullValidate();//控制设置为”必填”项的字段 ? operatorid //前台查询 ClientEnvironment.getInstance().getUser().getPrimaryKey(); //后台查询 String cuserid = InvocationInfoProxy.getInstance().getUserCode(); String sql = \ + cuserid + \; ArrayList result = (ArrayList) DBCacheFacade.runQuery(sql, new if (result.size() > 0){ } for (int i = 0; i < result.size(); i++){ } Object[] values = (Object[]) result.get(i); Operator = (String) values[1]; ArrayListProcessor()); ? operatordate operatordate = new UFDate(ClientEnvironment.getInstance().getDate().toString()); ? ORACEL 中文字符乱码时,是因为导入数据库时字符集不匹配,需要执行查询语句 select * from V$NLS_PARAMETERS 找到NLS_LANGUAGE 的值,在执行SQL语句的计算机上新增该环境变量。 ? OuterProxy SysInitBO_Client//取系统参数 //获取外系统相关BO的代理 nc.vo.cdm.proxy.OuterProxy getSysInitQry()//获取查询系统参数的接口 getCustManDocQuery()//获取客商管理档案查询类 getCuBasDocQry()//获取客商基本档案查询类 getPFWorkflowQry()//获取审批流查询服务类 getFuncPower()//获取功能权限接口 getCacheVersionBS()//获得UAP缓存版本管理接口 ? P ? plsql 客户端连接: Username:nc55 Password:1 Database:192.168.1.104:1521/orcl ? pkcorp ClientEnvironment.getInstance().getCorporation().getPrimaryKey(); ? Q ? R ? refModel //动态改变参照的UI的话, 例如在bodyRowChange事件中,为表体的某个输入框设置参照UI: public void bodyRowChange(BillEditEvent event) { ...... if ((UITable) event.getSource() == getBillCardPanel().getBillTable(){ if(.......){ UIRefPane refPane = (UIRefPane) getBillCardPanel() .getBodyItem(\ //参照界面 StandInputDlg dlg = new StandInputDlg(this,\参照输入\ Object oData[][] = .....; //为参照UI设置数据 dlg.getUITable().getModel().setData(oData); //将UI放入参照中 refPane.setRefUI(dlg); }else{ ....... } } ? repaint this.getJScrollPane().repaint();//重画界面 this.updateUI();//刷新界面 ? role // 获得操作员所有角色 IUserManageQuery iroleQurery = NCLocator.getInstance().lookup(IUserManageQuery.class); RoleVO[] roleVos = iroleQurery.getUserRole(userid, null); ? Runtime RuntimeEnv.getInstance().getNCHome();//取得中间件所在服务器上的文件路径或目录 ? S ? selectALL if( intBtn==IprivateButton.HtxhSelectAll_btn ) { for( int { i=0;i this.getSelfUI().getBillListPanel().getHeadBillModel().setRowState( i,BillMode } l.SELECTED );//选中 } else if( intBtn==IprivateButton.HtxhSelectNone_btn ) { for( int { i=0;i this.getSelfUI().getBillListPanel().getHeadBillModel().setRowState( i,BillMode } } l.UNSTATE );//反选 ? setCellBackGround //设置单元格颜色 this.getJScrollPane_m().setCellBackGround(row, col, color); ? setCurrentPanel setCurrentPanel(\);//单据初始化设置为卡片界面 ? setDataType billItems[0].setDataType(BillItem.BOOLEAN);//设置单元格数据类型 ? setEnabled boolean isAdd = this.isAdding();//单据为新增状态 boolean isEdit = this.isEditing();//单据为修改状态 this.getSelfUI().getBillCardPanel().getBillModel(\ false );//设置子表页签不可编辑 ? setEdit //设置表头字段不可编辑 this.getBillCardPanel().setHeadItem(\ this.getBillCardPanel().getHeadItem(\setEdit(false); //设置表体字段不可编辑 int editRow = getBillCardPanel().getBillTable().getSelectedRow(); getBillCardPanel().setBodyValueAt(null, editRow, \); getBillCardPanel().getBillModel().setCellEditable(editRow,\false); ? setMaxRows //在NC持久层中为了防止执行大查询后返回结果集合过多导致系统内存溢出系统默认设置 了最大返回结果集行数是10万行,如果如要返回更多行数或者不限制返回行数,需要做如下设置: 在SuperDMO中设置返回行数 SuperDMO superDmo=new SuperDMO(); superDmo. setMaxRows(行数); 如果rows= -1表示不限制返回行数 在BaseDAO中设置返回行数 BaseDAO baseDao=new BaseDAO(); BaseDAO. setMaxRows(行数); 如果rows= -1表示不限制返回行数 在ResultsetProcessor中设置返回行数 BaseProcessor processor=new ArrayListProcessor(); Processor. setMaxRows(行数); 在ResultSet中设置返回行数 CrossDBResultset resultset=( CrossDBResultset)rs; Resultset.setMaxRows(行数); ? setRefModel //设置参照类 m_CorpRefPane.setRefModel(new nc.ui.tjyc.ref.CorpsetInfoRefModel()); ? setShow //设置列的显示/隐藏 ReportItem[] bodyItems = this.getReportBase().getBody_Items();//取出Body_Items ..... ..... if(A) { items[i].setShow(true);//设置第i列可显示 items[j].setShow(false);//设置第j列不可显示 getReportBase().setBody_Items(bodyItems);//重新填装Body_Items } else { items[j].setShow(true);//设置第j列可显示 items[i].setShow(false);//设置第i列不可显示 getReportBase().setBody_Items(bodyItems);//重新填装Body_Items } ? setShowThMark //在单据模板中,设置数字的千位分隔符 getBillListPanel().getBodyScrollPane(\ ? setTatolRowShow // initSelfData内加此句,设置合计行显示 getBillCardWrapper().getBillCardPanel().setTatolRowShow(true); ? setValueAt //设置单元格值 this.getJScrollPane_m().getTable().setValueAt(value, row, col); ? setSort ui.getBillCardPanel().getBillModel() sortByColumn(int column, boolean ascending);//设置列是否排序 ui.getBillCardPanel().getBillTable().setSortEnabled(false);//设置表格是否可排序 ? setWherePart //UI类里设置查询条件 //单表体 private void setWherePart() { UIRefPane zdref = (UIRefPane) AbstractRefModel ref = zdref.getRefModel(); String xl = (String) this.getBillCardPanel().getBodyItem(\).getComponent(); this.getBillCardPanel().getBodyValueAt(this.getBillCardPanel().getBillTable().getSelectedRow(), \); } private void setWherePart() { UIRefPane zdref = AbstractRefModel ref = zdref.getRefModel(); if( getBillCardPanel().getHeadItem(\).getValue() != null ) { if( xl != null || xl != \ ) { } String wherePart = \ + \ + \+ xl +\; ref.setWherePart(wherePart); //主子表 (UIRefPane)this.getBillCardPanel().getHeadItem(\).getComponent(); } } String wherePart = \ + \ + \ '\+getBillCardPanel().getHeadItem(\).getValue()+\; ref.setWherePart(wherePart); //调用 public void afterEdit(BillEditEvent event) { super.afterEdit(event); this.setWherePart(); } //StationInfoRef参照类里定义方法 String wherePart = null; public void setWherePart(String wherePart) { this.wherePart = wherePart; } if(wherePart==null){ } } return \+ this.getPk_corp() +\; return \+ this.getPk_corp() +\ }else{ public String getWherePart() { in \ + wherePart ; ? str_formulas //参照执行公式 A->getColValue(table,B,C,D) A :待负值的字段,对应BillItem的key B :需要取出赋给A的数据库对应的字段 C :数据库table中需要关联的字段 D :关联参数字段 最后相当于执行: select B into A from table where C=D getColValue(tablename,fieldname,pkfield,pkvalue) 根据主键从数据库查询特定字段的值,其功能类似SQL语句: select fieldname from tablename where pkfield = pkvalue 从这条SQL语句可以看出各个参数的含义. xl_code->getColValue(st_assetline, linename, pk_assetline, ssxl) 表体参照字段 要新加一个字段来设置显示公式,并在<关键字名>处填写所需生成主键的字段 String[] str_formulas = new String[] { \ int count = this.getJScrollPane_b().getTable().getRowCount(); for (int i = 0; i < count; i++) { } //关于列表显示主键的解决方法 this.getJScrollPane_b().getTableModel().execFormulas(i, str_formulas); 字段:xl 设为列表不显示 参照型 显示公式: xl_name->getColValue(st_assetline, linename, pk_assetline, xl) 编辑公式 //触发后需要执行的公式.可放在编辑公式里.如 xl_name->getColValue(st_assetline, linename, pk_assetline, xl) //关于执行公式 在单据模板的表头中,设置了编辑公式,在实际应用时却不能自动执行. 可以通过在UI类中的afterEdit()方法来实现,或者是通过语句getBillCardPanel().setAutoExecHeadEditFormula(true);来使表头编辑公式可以自动执行 表体中的编辑公式可以自动执行 ? String ?int ○1String s = String.valueOf(i); ○2String s = Integer.toString(i); ○3String s = \ ? String 数组 StringBuffer stringbuffer = new StringBuffer(\); int i = 0; for(int j = getCount(); i < j; i++) { if(i > 0) stringbuffer.append(\);//第一个不加,然后每个加 stringbuffer.append(getArray(i));//数组的值 } stringbuffer.append(\); ? StringUtil StringUtil.getPYIndexStr(vname, true));//根据中文自动生成拼音 ? Substr update st_xx_jcxx t set t.zc_code = substr(t.zc_code,0,8)||11||substr(t.zc_code,11,18) //Ora截取字符串+拼串 ? SysInitBO_Client 参数的前台公共服务类, 前台使用参数的必须通过该接口调用. ? T ? Table bd_billtype :单据类型pk_billtypecode like 'TI%' bd_busitype :业务类型0>1 bd_bdinfo :基础数据信息bdcode like 'DPLH%' bd_costsubj :收支项目 bd_defdoclist :自定义档案doclistcode like 'PLH%' bd_defused :自定义项引用fun_code like 'HI%' bd_defcsttblnme :自定义项-表名对照PK_DEFCSTTBLNME like 'PLH%' bd_defdef :自定义项定义defcode like 'PLH%' bd_refinfo :参照定义类 dap_insubjclass :科目分录0>1 dap_dapsystem :系统类型systypecode like 'PLH%' pub_billaction :动作脚本 pub_billcode_rule :基本档案单据号规则pk_billtypecode like 'TI%' pub_billcode_obj :单据号对象pk_billtypecode like 'TI%' pub_billtobillrefer :单据参照对照类 pub_billtemplet :单据模板nodecode like 'HI%' pub_billtemplet_t :单据模板子表属性 pub_hotkeyregister :快捷键fun_code like 'HI%' pub_print_dataitem :打印模板数据定义vnodecode like 'HI%' pub_print_template :打印模板vnodecode like 'HI%' pub_query_templet :查询模板node_code like 'HI%' pub_query_condition :查询模板子表pk_templet='' pub_report_templet :报表模板node_code like 'HI%' pub_report_model :报表模板子表pk_templet like 'HI%' pub_report_group :报表模板分组信息表pk_templet = '???' pub_systemplate :系统模板funnode like 'HI%' pub_sysinit :参数注册initcode like 'PLH%' pub_sysinittemp :参数模版initcode like 'PLH%' pub_votable : VO对照表 pub_workflownote :审批流消息 sm_user :操作员0>1 sm_busiworkflow :业务流程0>1 sm_codetocode :节点与模块对应关系Funccode ='HI' sm_funcregister :功能节点fun_code like 'HI%' sm_butnregister :功能节点按钮parent_id = sm_funcregister.cfunid sm_createcorp :建帐期间表 ? Tablecount //查询所有表的记录条数 select table_name,num_rows from user_tables ? Time String time = new SimpleDateFormat(\HHmmss\// HHmmss:24小时格式; hhmmss:12小时格式 //后台取服务器时间 UFDateTime serverTime = SFServiceFacility.getServiceProviderService().getServerTime(); ? to_char oracle 函数 ? to_number oracle 函数 ? truncate //删除表所有记录 truncate table 表名 速度快,而且效率高,因为: TRUNCATE TABLE 在功能上与不带 WHERE 子句的 DELETE 语句相同:二者均删除表中的全部行。但 TRUNCATE TABLE 比 DELETE 速度快,且使用的系统和事务日志资源少。 DELETE 语句每次删除一行,并在事务日志中为所删除的每行记录一项。TRUNCATE TABLE 通过释放存储表数据所用的数据页来删除数据,并且只在事务日志中记录页的释放。 TRUNCATE TABLE 删除表中的所有行,但表结构及其列、约束、索引等保持不变。新行标识所用的计数值重置为该列的种子。如果想保留标识计数值,请改用 DELETE。如果要删除表定义及其数据,请使用 DROP TABLE 语句。 对于由 FOREIGN KEY 约束引用的表,不能使用 TRUNCATE TABLE,而应使用不带 WHERE 子句的 DELETE 语句。由于 TRUNCATE TABLE 不记录在日志中,所以它不能激活触发器。 TRUNCATE TABLE 不能用于参与了索引视图的表。 ? U ? UFDouble SafeCompute//UFDouble工具类,加减乘除操作 ? UIRefPane 参照取值 UIRefPane ref = (UIRefPane)this.getBillCardPanel().getHeadItem(\ref.getRefPK()//主键 ref.getRefCode()//编码 ref.getRefName()//名称 ref.getRefValue( \参照内字段值 //字段为参照且不检查合法性,允许录入非参照内容 ((UIRefPane)getBillCardPanel().getBodyItem(\where t.zc_name like '%一次性费用%' ? update UPDATE st_bd_jifang t SET t.jf_name = ( SELECT s.linename||v.lstationname||t.jf_name FROM st_assetline s ,st_station v WHERE t.ssxl = s.pk_assetline AND LENGTH(t.code)=2 ) WHERE t.dr = 0 ? Userhome String userhome = System.getProperty(\//用户路径:我的文档 ? USerID InvocationInfoProxy.getInstance().getUserCode();//后台取操作员id ? V ? W ? X //解决开发环境报java.lang.OutOfMemoryError 在 项目名_server arguments 中的VM arguments 中加 -Xms256m –Xmx512m -XX:MaxNewSize=256m -XX:MaxPermSize=512m ? Y ? Z ? 树:事件处理类 public class AbstractMyEventHandler extends TreeManageEventHandler{}//父类 public class MyEventHandlerextends AbstractMyEventHandler { ? MyEventHandler public MyEventHandler(BillManageUI billUI, IControllerBase control) { } super(billUI, control); ? getHeadCondition //查询条件 protected String getHeadCondition() { String whereSql = super.getHeadCondition(); if (whereSql == null) whereSql = \ + this.getUIController().getBillType() + \; } else whereSql = whereSql + \ + this.getUIController().getBillType() + \; return whereSql; ? onTreeSelected @Override public void onTreeSelected(VOTreeNode node) { } super.onTreeSelected(node); ? onBoAdd @Override public void onBoAdd(ButtonObject arg0) throws Exception { } super.onBoAdd(arg0); VOTreeNode parent = this.getSelectNode(); this.getSelfUI().getBillCardPanel().setHeadItem(\, parent == null ? null : parent.getNodeID()); ? onBoDelete @Override protected void onBoDelete() throws Exception { if (this.getSelectNode().getChildCount() > 0) { } // super.onBoDelete(); // 删除方法 if (getBufferData().getCurrentVO() == null) return; if (MessageDialog.showOkCancelDlg(getBillUI(), this.getSelfUI().showErrorMessage(\存在子节点,不能删除\); return; NCLangRes.getInstance().getStrByID(\, \), NCLangRes.getInstance().getStrByID(\, \), 2) != 1) return; AggregatedValueObject modelVo = getBufferData().getCurrentVO(); getBusinessAction().delete(modelVo, getUIController().getBillType(), if (PfUtilClient.isSuccess()) { } if (getBufferData().getVOBufferSize() == 0) getBillUI().setBillOperate(4); getBillUI().setBillOperate(2); else getBillUI().removeListHeadData(getBufferData().getCurrentRow()); if (getUIController() instanceof ISingleController) { } else { } getBufferData().removeCurrentRow(); ISingleController sctl = (ISingleController) getUIController(); if (!sctl.isSingleDetail()) getBufferData().removeCurrentRow(); getBillUI()._getDate().toString(), getBillUI().getUserObject()); // 删除节点 this.getSelfUI().getBillTreeData().deleteNodeFromTree(this.getSelectNode()); } ? onBoRefresh @Override /**---------------------------------------- * 树管理单据必须重写刷新方法不然他是不会对树进行刷新的 * 因为他的父类刷新方法在ManageEventHandler内和树是没有任何关系的 */ protected void onBoRefresh() throws Exception { nc.ui.hi.hi0139.ClientUI clientUI = clientUI.getBillTree().clearSelection(); ((nc.ui.hi.hi0139.ClientUI)this.getBillTreeManageUI()); clientUI.createBillTree(this.getBillTreeManageUI().getCreateTreeData()); clientUI.afterInit(); clientUI.setBillOperate(nc.ui.trade.base.IBillOperate.OP_INIT); super.onBoRefresh(); } ? onBoSave @Override protected void onBoSave() throws Exception { } boolean isNew = this.isAdding(); super.onBoSave(); if (isNew) // 新增节点 { } CircularlyAccessibleValueObject newVO = String pk = newVO.getPrimaryKey(); this.getSelfUI().getBillTreeData().insertNodeToTree(newVO); this.getSelfUI().getBufferData().getCurrentVO().getParentVO(); ? onBoQuery @Override protected void onBoQuery() throws Exception { } super.onBoQuery(); ? getSelfUI private DhxtUI getSelfUI() { } return (DhxtUI) this.getBillUI(); ? getSelectNode } private VOTreeNode getSelectNode() { } return this.getSelfUI().getBillTreeSelectNode(); ? 树:UI控制类 public class DhxtUICtrl extends AbstractManageController implements ITreeManageController{ //实现此接口 } public boolean isAutoManageTree() { } return true;//自动管理树节点 ? 树:数据类 public class DhxtTreeData implements IVOTreeDataByID { public String getIDFieldName() { } public String getParentIDFieldName() { } public String getShowFieldName() { //此字段若为空刚无法构建树 } public SuperVO[] getTreeVO() { SuperVO[] treeVOs = null; BusinessDelegator business = new BDBusinessDelegator(); try { String pk_corp = treeVOs = return \; return \; return \; ClientEnvironment.getInstance().getCorporation().getPk_corp(); business.queryByCondition(nc.vo.assetmanage.xx.StXxJcxxVO.class, \'ST53' and pk_corp = '\+pk_corp+\ ); } } { } return treeVOs; e.printStackTrace(); }catch(Exception e) ? 树:单据UI类 ? AbstractUI public abstract class AbstractDhxtUI extends MultiChildBillTreeManageUI implements ILinkQuery{ protected AbstractManageController createController() { } @Override protected IVOTreeData createTreeData() { } @Override protected IVOTreeData createTableTreeData() { } return null; return new DhxtTreeData(); return new DhxtUICtrl(); ? UI public class DhxtUI extends AbstractDhxtUI{ protected ManageEventHandler createEventHandler() { } return new MyEventHandler(this, getUIControl()); @Override public void afterInit() throws Exception { super.afterInit(); this.modifyRootNodeShowName( \电话系统\ ); } @Override//编辑后事件 public void afterEdit(BillEditEvent event) { super.afterEdit(event); if( \.equals( event.getKey() ) ) { this.getBillCardPanel().execHeadEditFormulas(); //参照编辑公式 //node_show_name->getColValue(station,lstationname , pk_station, zd) } } } ? 建表空间脚本 ===============================================SQLServer ALTER DATABASE [nc50] ADD FILEGROUP [NNC_DATA01] go ALTER DATABASE [nc50] ADD FILEGROUP [NNC_DATA02] go ALTER DATABASE [nc50] ADD FILEGROUP [NNC_DATA03] go ALTER DATABASE [nc50] ADD FILEGROUP [NNC_INDEX01] go ALTER DATABASE [nc50] ADD FILEGROUP [NNC_INDEX02] go ALTER DATABASE [nc50] ADD FILEGROUP [NNC_INDEX03] go ALTER DATABASE [nc50] ADD FILE(NAME = N'nnc_data01', FILENAME = N'D:\\Program Files\\Microsoft SQL Server\\data\\nnc_data01_Data.NDF' , SIZE = 500, FILEGROWTH = 200) TO FILEGROUP [NNC_DATA01] go ALTER DATABASE [nc50] ADD FILE(NAME = N'nnc_data02', FILENAME = N'D:\\Program Files\\Microsoft SQL Server\\data\\nnc_data02_Data.NDF' , SIZE = 500, FILEGROWTH = 200) TO FILEGROUP [NNC_DATA02] go ALTER DATABASE [nc50] ADD FILE(NAME = N'nnc_data03', FILENAME = N'D:\\Program Files\\Microsoft SQL Server\\data\\nnc_data03_Data.NDF' , SIZE = 500, FILEGROWTH = 200) TO FILEGROUP [NNC_DATA03] go ALTER DATABASE [nc50] ADD FILE(NAME = N'nnc_index01', FILENAME = N'D:\\Program Files\\Microsoft SQL Server\\data\\nnc_index01_Data.NDF' , SIZE = 200, FILEGROWTH = 100) TO FILEGROUP [NNC_INDEX01] go ALTER DATABASE [nc50] ADD FILE(NAME = N'nnc_index02', FILENAME = N'D:\\Program Files\\Microsoft SQL Server\\data\\nnc_index02_Data.NDF' , SIZE = 200, FILEGROWTH = 100) TO FILEGROUP [NNC_INDEX02] go ALTER DATABASE [nc50] ADD FILE(NAME = N'nnc_index03', FILENAME = N'D:\\Program Files\\Microsoft SQL Server\\data\\nnc_index03_Data.NDF' , SIZE = 200, FILEGROWTH = 100) TO FILEGROUP [NNC_INDEX03] Go ===============================================Oracle CREATE TABLESPACE NNC_DATA01 DATAFILE 'D:\\ORACLE\\ORADATA\\ORA10G\\nnc_data01.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K ; CREATE TABLESPACE NNC_DATA02 DATAFILE 'D:\\ORACLE\\ORADATA\\ORA10G\\nnc_data02.dbf' SIZE 300M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K ; CREATE TABLESPACE NNC_DATA03 DATAFILE 'D:\\ORACLE\\ORADATA\\ORA10G\\nnc_data03.dbf' SIZE 500M AUTOEXTEND ON NEXT 100M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 512K ; CREATE TABLESPACE NNC_INDEX01 DATAFILE 'D:\\ORACLE\\ORADATA\\ORA10G\\nnc_index01.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K ; CREATE TABLESPACE NNC_INDEX02 DATAFILE 'D:\\ORACLE\\ORADATA\\ORA10G\\nnc_index02.dbf' SIZE 300M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K ; CREATE TABLESPACE NNC_INDEX03 DATAFILE 'D:\\ORACLE\\ORADATA\\ORA10G\\nnc_index03.dbf' SIZE 500M AUTOEXTEND ON NEXT 100M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K ; CREATE USER NC50 IDENTIFIED BY NC50 DEFAULT TABLESPACE NNC_DATA01 TEMPORARY TABLESPACE temp; GRANT connect,dba to NC50; ===============================================DB2 CREATE DATABASE NCTEST ON '/BigData' USING CODESET GBK TERRITORY CN COLLATE USING SYSTEM CATALOG TABLESPACE MANAGED BY DATABASE USING ( FILE '/BigData/NCTEST/Catalogdata1' 128000 ) USER TABLESPACE MANAGED BY DATABASE USING ( FILE '/BigData/NCTEST/Userdata1' 512000 ) TEMPORARY TABLESPACE MANAGED BY DATABASE USING ( FILE '/BigData/NCTEST/Tempspace1' 768000 ) connect to NCTEST user db2inst1 using db2inst1 CREATE Bufferpool NCUSED4 SIZE 102400 PAGESIZE 4K CREATE Bufferpool NCUSED16 SIZE 38400 PAGESIZE 16K CREATE REGULAR TABLESPACE NNC_DATA01 PAGESIZE 16K MANAGED BY DATABASE USING ( FILE '/BigData/NCTEST/nnc_data01' 204800) EXTENTSIZE 8 OVERHEAD 24.1 PREFETCHSIZE 8 TRANSFERRATE 0.9 BUFFERPOOL NCUSED16 CREATE REGULAR TABLESPACE NNC_INDEX01 PAGESIZE 4K MANAGED BY DATABASE USING ( FILE '/BigData/NCTEST/nnc_index01' 204800) EXTENTSIZE 32 OVERHEAD 24.1 PREFETCHSIZE 32 TRANSFERRATE 0.9 BUFFERPOOL NCUSED4 CREATE REGULAR TABLESPACE NNC_DATA02 PAGESIZE 16K MANAGED BY DATABASE USING ( FILE '/BigData/NCTEST/nnc_data02' 20480) EXTENTSIZE 8 OVERHEAD 24.1 PREFETCHSIZE 8 TRANSFERRATE 0.9 BUFFERPOOL NCUSED16 CREATE REGULAR TABLESPACE NNC_INDEX02 PAGESIZE 4K MANAGED BY DATABASE USING ( FILE '/BigData/NCTEST/nnc_index02' 40960) EXTENTSIZE 32 OVERHEAD 24.1 PREFETCHSIZE 32 TRANSFERRATE 0.9 BUFFERPOOL NCUSED4 CREATE REGULAR TABLESPACE NNC_DATA03 PAGESIZE 16K MANAGED BY DATABASE USING ( FILE '/BigData/NCTEST/nnc_data03' 204800) EXTENTSIZE 8 OVERHEAD 24.1 PREFETCHSIZE 8 TRANSFERRATE 0.9 BUFFERPOOL NCUSED16 CREATE REGULAR TABLESPACE NNC_INDEX03 PAGESIZE 4K MANAGED BY DATABASE USING ( FILE '/BigData/NCTEST/nnc_index03' 204800) EXTENTSIZE 32 OVERHEAD 24.1 PREFETCHSIZE 32 TRANSFERRATE 0.9 BUFFERPOOL NCUSED4 CREATE USER TEMPORARY TABLESPACE USERTEMP PAGESIZE 4 K MANAGED BY DATABASE USING ( FILE '/BigData/NCTEST/Usertemp1' 2560000 ) EXTENTSIZE 64 OVERHEAD 10.67 PREFETCHSIZE 64 TRANSFERRATE 0.04 BUFFERPOOL NCUSED4 CREATE SYSTEM TEMPORARY TABLESPACE TEMPSPACE2 PAGESIZE 16 K MANAGED BY DATABASE USING ( FILE '/BigData/NCTEST/Tempspace2' 192000 ) EXTENTSIZE 32 OVERHEAD 10.67 PREFETCHSIZE 32 TRANSFERRATE 0.04 BUFFERPOOL NCUSED16 GRANT DBADM,CREATETAB,BINDADD,CONNECT,CREATE_NOT_FENCED_ROUTINE,IMPLICIT_SCHEMA,LOAD,CREATE_EXTERNAL_ROUTINE,QUIESCE_CONNECT,SECADM ON DATABASE TO USER db2inst1; GRANT DBADM,CREATETAB,BINDADD,CONNECT,CREATE_NOT_FENCED_ROUTINE,IMPLICIT_SCHEMA,LOAD,CREATE_EXTERNAL_ROUTINE,QUIESCE_CONNECT,SECADM ON DATABASE TO USER db2inst1; GRANT USE OF TABLESPACE NNC_DATA01 TO USER db2inst1 WITH GRANT OPTION; GRANT USE OF TABLESPACE NNC_DATA02 TO USER db2inst1 WITH GRANT OPTION; GRANT USE OF TABLESPACE NNC_DATA03 TO USER db2inst1 WITH GRANT OPTION; GRANT USE OF TABLESPACE NNC_INDEX01 TO USER db2inst1 WITH GRANT OPTION; GRANT USE OF TABLESPACE NNC_INDEX02 TO USER db2inst1 WITH GRANT OPTION; GRANT USE OF TABLESPACE NNC_INDEX03 TO USER db2inst1 WITH GRANT OPTION; GRANT USE OF TABLESPACE USERTEMP TO USER db2inst1 WITH GRANT OPTION; CONNECT RESET; ? 下拉框设置 例:将一个字段的数据类型设置为“下拉框”,并且设置参照名称为“SX,01,02,03,04,05”。 设置查询模板某一字段的数据类型是“下拉” ,然后在参照类型中输入字符串“IX,自由态,游离态,...” IX,UPP10080806-000024=外部单位,UPP10080806-000040=内部核算单位,UPP10080806-000041=内部法人单位,UPP10080806-000042=内部渠道成员 CX,UC000-0001589=客户,UC000-0000275=供应商,UC000-0001574=客商 I,工行,招行,人行,建行 字符串的前缀有 I IX C CX S SX 六种代表不同的含义: I 将下拉框的索引号作为整型返回 IX 将下拉框的索引号作为整型返回 C 将下拉框的索引号作为Char类型返回
正在阅读:
用友NC客户化开发帮助文档 - 图文04-20
病理学 名词解释08-20
画鼻子游戏作文600字07-12
股东利润分配请求权纠纷11-21
呕心之作----三七功效05-31
那张脸作文500字07-14
内师大学生消费状况调查报告05-31
中国多媒体教学学报中学数学05-20
市政工程物探技术报告07-10
计算机基础知识框架04-24
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 用友
- 客户
- 文档
- 帮助
- 图文
- 开发
- 2016年尔雅选修课《科学启蒙》课后习题答案
- 一、办公室存在的主要安全隐患有哪些?
- 中考语文诗歌鉴赏快速提高 精讲精练20题(含答案)(1)
- 2015-2016学年度上学期三年级语文期中考试质量分析
- 中班美术评课稿
- 《材料成型设备》实验指导书
- 《早》教学设计
- 中国移动产品入库流程
- 出入境边防检查常遇问题
- 办理《北京市工作居住证》工作流程
- 北京科技大学金属学真题
- 中登业务规则 - 图文
- 捐衣物活动后的感谢信
- CAD的字体文件分类有哪些建筑工程类独家文档首发
- 2015年GCT语文真题及答案解析
- 六年级奥数分数百分数应用题学生版
- 物业公司对讲机使用管理规定
- 第十四章一次函数测试题
- 网吧电影下载全攻略rtsp协议(原创)知道
- 兰州各大高校校团委信息~ - 图文