zoukankan      html  css  js  c++  java
  • nc6 用业务插件注册来跑按钮事件

    在实际开发中,有些需求是要求系统单据,编辑或者触发其他按钮来回写其他模块单据

    这时候就能用业务插件方式来触发其他模块的按钮事件,而不用去模块找对应的按钮编辑事件类

    package hz.bs.hzctr.recbill.listener;
    
    import nc.bs.businessevent.BusinessEvent;
    import nc.bs.businessevent.IBusinessEvent;
    import nc.bs.businessevent.IBusinessListener;
    import nc.bs.dao.BaseDAO;
    import nc.vo.arap.gathering.AggGatheringBillVO;
    import nc.vo.arap.gathering.GatheringBillItemVO;
    import nc.vo.arap.gathering.GatheringBillVO;
    import nc.vo.pub.AggregatedValueObject;
    import nc.vo.pub.BusinessException;
    /**
     * 收款单为退款单时,审批后,按表体对应的合同编码回写销售合同对应单据
     * @author Yaolz
     */
    public class RecAbleUnApproveRewSellctrListener implements IBusinessListener {
    	
    	private BaseDAO baseDao;
    	public BaseDAO getBaseDao(){
    		if(baseDao==null){
    			baseDao=new BaseDAO();
    		}
    		return baseDao;
    	}
    
    	@Override
    	public void doAction(IBusinessEvent businessEvent) throws BusinessException  {
    		BusinessEvent e = (BusinessEvent) businessEvent;
    		AggregatedValueObject[] values = (AggregatedValueObject[]) e
    				.getObject();
    		for (int i = 0; i < values.length; i++) {
    			AggGatheringBillVO gatherBillAggVO = (AggGatheringBillVO) values[i];
    			// 收款单表头
    			GatheringBillVO billHVo = (GatheringBillVO) gatherBillAggVO
    					.getParentVO();
    			// 收款单表体
    			GatheringBillItemVO[] gatherBillTtemVos = (GatheringBillItemVO[]) gatherBillAggVO
    					.getChildren(GatheringBillItemVO.class);
    			// 开票日期(业务日期)
    			String billdate = billHVo.getBilldate().toString();
    			// 交易类型为退款
    			if ("F2-Cxx-D2".equals(billHVo.getPk_tradetype())) {
    				for (GatheringBillItemVO bodyVO : gatherBillTtemVos) {
    					String def14 = bodyVO.getDef14();
    					if(def14 != null){
    						String sql = " UPDATE hzctr_sellctr_h SET checkoutdate = '"+billdate+"' WHERE pk_sellctr_h='"+def14+"' ";
    						BaseDAO dao = new BaseDAO();
    						dao.executeUpdate(sql);
    					}
    				}
    			}
    		}
    	}
    
    }
    

      


    作者:冬瓜茶饮料
    出处:http://www.cnblogs.com/dongguacha/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

  • 相关阅读:
    web api 特点
    码农
    到程序员短缺的地方生活,不要到过剩的地方凑热闹
    程序员也要寻找贸易的机会,要参加研讨会
    [Codeforces 863D]Yet Another Array Queries Problem
    [Codeforces 863C]1-2-3
    [Codeforces 864F]Cities Excursions
    [Codeforces 864E]Fire
    [Codeforces 864D]Make a Permutation!
    [Codeforces 864C]Bus
  • 原文地址:https://www.cnblogs.com/dongguacha/p/7145915.html
Copyright © 2011-2022 走看看