• nc65单据穿透


    nc65单据穿透

    jych项目

    1.支出合同台账合同号字段可以穿透到对应的单据上

    一个合同号穿透到一个物质设备采购合同上

    1.支出合同台账单据模板合同号字段卡片下和列表下高级属性勾选是否超链接
    在这里插入图片描述

    2.支出合同台账中增加监听类
    HeadItemLinkListener.java

    package nc.ui.jych.zchttz.ace.view;
    
    import nc.desktop.ui.WorkbenchEnvironment;
    import nc.funcnode.ui.FuncletInitData;
    import nc.funcnode.ui.FuncletWindowLauncher;
    import nc.ui.pub.bill.BillItemHyperlinkEvent;
    import nc.ui.pub.bill.BillItemHyperlinkListener;
    import nc.vo.jych.paymentorder.AggPaymentOrderVO;
    import nc.vo.jych.utils.PenetrateQuery;
    import nc.vo.jych.wzsbcght.AggWzsbcghtVO;
    import nc.vo.jych.zchttz.ZchttzVO;
    import nc.vo.pub.BusinessException;
    import nc.vo.pubapp.pattern.exception.ExceptionUtils;
    import nc.vo.sm.funcreg.FuncRegisterVO;
    import nc.vo.zkch.utils.NullValueUtils;
    
    public class HeadItemLinkListener implements BillItemHyperlinkListener{
    	public ListView list;
    	@Override
    	public void hyperlink(BillItemHyperlinkEvent event) {
    		//获取超链接的字段
    		String key = NullValueUtils.getNullStringValue(event.getItem().getKey());
    		//获取行号
    		int row  = event.getRow();
    		//获取到这一行对应的 
    		ZchttzVO vo = (ZchttzVO) getList().getBillCardPanel().getBillModel().getBodyValueRowVOByVisualValue(row, ZchttzVO.class.getName());
    		String htbh = vo.getHtbh();
    		try {
    			FuncletInitData data = new FuncletInitData();
    			data.setInitType(100);
    			FuncRegisterVO funvo = null;
    			if (key.equals("nyfkmny")) {
    				AggPaymentOrderVO[] queryData = PenetrateQuery.getInstances().getZchttzPaymentData(htbh);
    				data.setInitData(queryData);
    				funvo = WorkbenchEnvironment.getInstance().getFuncRegisterVO("H7H1H136");
    			} else if(key.equals("htbh")){//add by hanh
    				AggWzsbcghtVO[] queryData = PenetrateQuery.getInstances().getQueryWzsbcghtVOByHt(htbh);
    				data.setInitData(queryData);
    				funvo = WorkbenchEnvironment.getInstance().getFuncRegisterVO("H7H1H162");
    			}
    			//需要进入节点
    			FuncletWindowLauncher.openFuncNodeInTabbedPane(getList().getBillCardPanel(), funvo, data, null, true);
    		} catch (BusinessException e) {
    			// TODO 自动生成的 catch 块
    			ExceptionUtils.wrappBusinessException(e.getMessage());
    		}
    	}
    	public ListView getList() {
    		return list;
    	}
    
    	public void setList(ListView list) {
    		this.list = list;
    	}
    
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56

    3.给监听类注入到对应字段
    ListView.java

    package nc.ui.jych.zchttz.ace.view;
    
    
    public class ListView extends nc.ui.pubapp.uif2app.view.ShowUpableBatchBillTable{
    	private static final long serialVersionUID = 1L;
    	
    	@Override
    	public void initUI() {
    		
    		super.initUI();		
    		getBillCardPanel().setTatolRowShow(true);
    		HeadItemLinkListener listener = new HeadItemLinkListener();
    		listener.setList(this);
    		getBillCardPanel().getBodyItem("nyfkmny").addBillItemHyperlinkListener(listener);
    		getBillCardPanel().getBodyItem("htbh").addBillItemHyperlinkListener(listener);
    	}
    
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19

    4.在public端的工具类util包下的PenetrateQuery.java类中增加根据合同编号查询物质设备采购合同的方法

    	/**
    	 * 根据合同编号查询物质设备采购合同对应的物质设备采购合同登记
    	 * add by hanh
    	 */
    	public AggWzsbcghtVO[] getQueryWzsbcghtVOByHt(String htbh) throws BusinessException {
    		// TODO 自动生成的方法存根
    		SqlBuilder sql = new SqlBuilder();
    		sql.append(" select pk_wzsbcght ");
    		sql.append(" from jych_wzsbcght ");
    		sql.append(" where nvl(dr, 0) = 0	");
    		sql.append(" and htbh = '"+htbh+"'");
    		List<String> list = (List<String>) getBs().executeQuery(sql.toString(), new ColumnListProcessor());
    		if (list != null  && list.size() >0) {
    			AbstractBill[] bills = getQueryService().queryAbstractBillsByPks(AggWzsbcghtVO.class, list.toArray(new String[0]));
    			List<AggWzsbcghtVO> aggvolist = new ArrayList<AggWzsbcghtVO>();
    			for (AbstractBill bill : bills) {
    				AggWzsbcghtVO aggvo = (AggWzsbcghtVO) bill;
    				aggvolist.add(aggvo);
    			}
    			return aggvolist.toArray(new AggWzsbcghtVO[0]);
    		}
    		return null;
    	}
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23

    5.在要穿透的物质设备采购合同单据中增加监听类
    WzsbcghtListener.java

    package nc.ui.jych.wzsbcght.ace.listener;
    
    import nc.funcnode.ui.FuncletInitData;
    import nc.vo.jych.wzsbcght.AggWzsbcghtVO;
    
    public class WzsbcghtListener extends nc.ui.pubapp.uif2app.model.DefaultFuncNodeInitDataListener {
    
    	@Override
    	public void initData(FuncletInitData data) {
    		// TODO 自动生成的方法存根
    		if (data != null && data.getInitType() == 100) {
    			AggWzsbcghtVO[] aggvos =  (AggWzsbcghtVO[])data.getInitData();
    			getModel().initModel(aggvos);
    
    		} else {
    			super.initData(data);
    		}
    	}
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19

    6.在要穿透的物质设备采购合同单据的xml中注入新增加的监听类

    	
    	<bean id="InitDataListener" class="nc.ui.jych.wzsbcght.ace.listener.WzsbcghtListener">
    		<property name="model" ref="bmModel"/>
    		<property name="context" ref="context">property>
    		<property name="voClassName" value="nc.vo.jych.wzsbcght.AggWzsbcghtVO"/>
    	bean>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    2.销售合同台账合同号字段可以穿透到对应的单据上

    一个合同号穿透到一个销售合同登记上(但考虑到这张单子有被金额穿透的情况,这种情况下点击该金额会有多个单子穿透到销售合同登记上,所以要和被按钮穿透的情况公用一个监听类,查到的数据就得用List去接收)

    1.HeadItemlinkListener.java

    package nc.ui.jych.xshttz.view;
    
    import java.util.ArrayList;
    import java.util.List;
    
    import nc.bs.framework.common.NCLocator;
    import nc.desktop.ui.WorkbenchEnvironment;
    import nc.funcnode.ui.FuncletInitData;
    import nc.funcnode.ui.FuncletWindowLauncher;
    import nc.itf.jych.IXshttzMaintain;
    import nc.ui.pub.bill.BillItemHyperlinkEvent;
    import nc.ui.pub.bill.BillItemHyperlinkListener;
    import nc.vo.jych.kpsq.AggKpsqVO;
    import nc.vo.jych.receiptvoucher.AggReceiptVoucherVO;
    import nc.vo.jych.utils.PenetrateQuery;
    import nc.vo.jych.xshtdj.AggXshtdjVO;
    import nc.vo.jych.xshttz.XshttzVO;
    import nc.vo.pub.BusinessException;
    import nc.vo.pubapp.pattern.exception.ExceptionUtils;
    import nc.vo.sm.funcreg.FuncRegisterVO;
    import nc.vo.zkch.utils.NullValueUtils;
    
    /**
     * 字段超链接监听
     * @author zhangjk
     * @ddate 20023-09-11
     */
    public class HeadItemlinkListener implements BillItemHyperlinkListener{
    
    	public ListView list;
    	
    	@Override
    	public void hyperlink(BillItemHyperlinkEvent event) {
    		//获取超链接的字段
    		String key = NullValueUtils.getNullStringValue(event.getItem().getKey());
    		//获取行号
    		int row  = event.getRow();
    		//获取到这一行对应的 
    		XshttzVO vo = (XshttzVO) getList().getBillCardPanel().getBillModel().getBodyValueRowVOByVisualValue(row, XshttzVO.class.getName());
    		String pk_xshtdj = vo.getPk_xshtdj();
    		String htbh = vo.getHtbh();
    		try {
    			FuncletInitData data = new FuncletInitData();
    			data.setInitType(100);
    			FuncRegisterVO funvo = null;
    			if (key.equals("ykpje")) {
    				AggKpsqVO[] queryData = PenetrateQuery.getInstances().getQueryKpsqVOByHt(pk_xshtdj);
    
    				data.setInitData(queryData);
    				funvo = WorkbenchEnvironment.getInstance().getFuncRegisterVO("H7H1H181");
    			} else if (key.equals("yskje")) {
    				AggReceiptVoucherVO[] queryData = PenetrateQuery.getInstances().getQueryReceiptByHt(pk_xshtdj);
    
    				data.setInitData(queryData);
    				funvo = WorkbenchEnvironment.getInstance().getFuncRegisterVO("H7H1H135");
    			} else if(key.equals("htbh")){//add by hanh
    				AggXshtdjVO[] queryData = PenetrateQuery.getInstances().getQueryXshtdjVOByHt(htbh);
    				List<AggXshtdjVO> list = new ArrayList<AggXshtdjVO>();
    				list.add(queryData[0]);
    				data.setInitData(list);
    				funvo = WorkbenchEnvironment.getInstance().getFuncRegisterVO("H7H1H168");
    			}
    			//需要进入节点
    			FuncletWindowLauncher.openFuncNodeInTabbedPane(getList().getBillCardPanel(), funvo, data, null, true);
    		} catch (BusinessException e) {
    			ExceptionUtils.wrappBusinessException(e.getMessage());
    		}
    	}
    
    	public ListView getList() {
    		return list;
    	}
    
    	public void setList(ListView list) {
    		this.list = list;
    	}
    	
    	private IXshttzMaintain service;
    
    	private IXshttzMaintain getService(){
    		if(service == null){
    			service = NCLocator.getInstance().lookup(IXshttzMaintain.class);
    		}
    		return service;
    	}
    
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88

    2.XshtdjListener.java

    package nc.ui.jych.xshtdj.ace.listener;
    
    import java.util.List;
    
    import nc.funcnode.ui.FuncletInitData;
    import nc.vo.jych.xshtdj.AggXshtdjVO;
    
    public class XshtdjListener extends nc.ui.pubapp.uif2app.model.DefaultFuncNodeInitDataListener {
    
    	@Override
    	public void initData(FuncletInitData data) {
    		// TODO 自动生成的方法存根
    		if (data != null && data.getInitType() == 100) {
    			List<AggXshtdjVO> aggvolist =  (List<AggXshtdjVO>)data.getInitData();
    			getModel().initModel(aggvolist.toArray(new AggXshtdjVO[0]));
    
    		} else {
    			super.initData(data);
    		}
    	}
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
  • 相关阅读:
    体细胞杂交第六弹!worthington组织培养术语终章
    图表背后的故事:数据可视化的威力与影响
    熊市来临,加密货币公司将广告支出削减了 90%
    Android NDK底层BUG,记录:connect、socket(AF_INET, SOCK_STREAM, 0) 等系统套接字接口函数崩溃问题。
    EXCEL的查询功能Vlookup
    新库上线 | CnOpenDataA股上市公司IPO申报发行文本数据
    Apache Airflow Celery Broker 远程命令执行 (CVE-2020-11981)漏洞复现
    [Swift学习] 访问控制 Access Control, private、public、filePrivate等修饰符
    SpringBoot的流浪宠物系统
    自动铣刀式分板机市场分析
  • 原文地址:https://blog.csdn.net/weixin_45714641/article/details/134076554