用友uap nc65开发 二次登陆节点打开控制校验

来源:互联网 发布:怎么删除软件 编辑:程序博客网 时间:2024/05/17 03:52
用友uap nc65开发  二次登陆节点打开前控制校验
前面一次博客讲了二次登陆节点的产生,现在对二次登陆节点打开前进行控制。
在未登陆服务中心打开节点时提示如下


主要代码:重写FuncletWindowEngine类的openNodeImple方法


在方法中加入校验:
//判断是否二次登录if(isManagerSec()==false){MessageDialog.showErrorDlg(null, "条件检验错误", "请先登录服务中心!");return;}
附关键代码:
private void openNodeImple(OpenParam openParam) throws Exception {// Component invoker = openParam.invoker;try {String logMsg = "opening node:" + frVO.getFuncode() + " / "+ frVO.getFun_name() + " / " + frVO.getOwn_module();Logger.debug(logMsg);Component parent = openParam.parent;IFuncletWindow window = findOpenedWindow(openParam);if (window != null) {showWindowInEDT(window);if (openParam.initData != null) {try {window.getCurrFunclet().initData(openParam.initData);} catch (Throwable th) {Logger.error(th.getMessage(), th);}}return;}UserExit.getInstance().setBusiaction(NCLangRes.getInstance().getStrByID("sfbase","FWEngine-0000", null,new String[] { frVO.getFun_name() })/* 打开节点-{0} */);if (!canOpen(openParam)) {return;}//判断是否二次登录if(isManagerSec()==false){MessageDialog.showErrorDlg(null, "条件检验错误", "请先登录服务中心!");return;}openningCount++;if (isTopLevelComp()) {// liyf 2016-09-26 直接弹窗显示openWindow();} else {String logText = dealOpenNodeForLogMonitor();long t1 = System.currentTimeMillis();FuncletWidgetContainer fwContainer = createFuncletWidgetContainer(openParam);long t2 = System.currentTimeMillis() - t1;String text = logText + " cost time " + t2;Logger.debug(text);if (fwContainer != null) {String windowTitle = openParam.windowTitle;if (windowTitle == null || windowTitle.trim().length() == 0) {windowTitle = FuncPowerTreeSupport.getFuncNodeDisplayName(frVO);// .getFunTransStr(frVO.getFun_code(),}// frVO.getFun_name());FuncWindowType type = openParam.funcWindowType;if (type.equals(FuncWindowType.FRAME)) {window = new FuncNodeFrame(windowTitle, fwContainer);FuncNodeFrame frame = (FuncNodeFrame) window;if (openParam.size != null) {frame.setSize(openParam.size);}// frame.setLocationRelativeTo(openParam.parent);setWindowToScreenCenter(frame);} else if (type.equals(FuncWindowType.DIALOG)) {boolean modal = openParam.modal;Window owner = null;Component comp = openParam.parent;if (comp != null)owner = ClientToolKit.getWindowFromComponent(comp);// JOptionPane.getFrameForComponent(comp);// window = new FuncNodeDialog(owner, windowTitle,// modal, fwContainer);//window = new FuncNodeDialog(owner, windowTitle, modal,fwContainer, openParam.isResetable());FuncNodeDialog dlg = ((FuncNodeDialog) window);if (openParam.size != null) {dlg.setSize(openParam.size);}// dlg.setLocationRelativeTo(dlg.getParent());setWindowToScreenCenter(dlg);} else if (type.equals(FuncWindowType.FORCEMODALDLG)) {Window owner = null;Component comp = openParam.parent;if (comp != null)owner = ClientToolKit.getWindowFromComponent(comp);// JOptionPane.getFrameForComponent(comp);window = new FuncNodeForceModalDlg(owner, windowTitle,fwContainer, openParam.isResetable());FuncNodeForceModalDlg dlg = (FuncNodeForceModalDlg) window;if (openParam.size != null) {dlg.setSize(openParam.size);}// dlg.setLocationRelativeTo(dlg.getParent());setWindowToScreenCenter(dlg);} else {ExtTabbedPane tabbedPane = WorkbenchEnvironment.getInstance().getWorkbench().getWorkSpaceTabbedPane();if (parent != null && parent instanceof ExtTabbedPane) {tabbedPane = (ExtTabbedPane) parent;}window = new FuncNodePanel(tabbedPane, fwContainer,windowTitle);}showWindowInEDT(window);showAlterFilesInThread(window);}}} catch (Throwable thr) {Logger.error(thr.getMessage(), thr);} finally {openningCount--;}}

/** * 节点判断 是否二次登录 * @return */private boolean isManagerSec(){boolean  isLogin= true;String nodeModule= frVO.getFuncode().trim();//合同管理中心  H303113510boolean  b1=nodeModule.equals("H303113510");//合同变更             H303113517 boolean  b2=nodeModule.equals("H303113517");if( b1||b2){String manageUnit = LogonBO_Client.getManageUnit();if(null==manageUnit){isLogin=false;}}return isLogin;}



0 0
原创粉丝点击