客户修改同步更新税务信息购买方名称
This commit is contained in:
		
							parent
							
								
									015754a403
								
							
						
					
					
						commit
						669855735c
					
				|  | @ -0,0 +1,38 @@ | |||
| package nccloud.api.uapbd.customer.listener; | ||||
| 
 | ||||
| import nc.bs.businessevent.IBusinessEvent; | ||||
| import nc.bs.businessevent.IBusinessListener; | ||||
| import nc.bs.businessevent.bd.BDCommonEvent; | ||||
| import nc.bs.trade.business.HYPubBO; | ||||
| import nc.vo.bd.cust.CustomerVO; | ||||
| import nc.vo.bd.cust.custtax.CusttaxVO; | ||||
| import nc.vo.pub.BusinessException; | ||||
| 
 | ||||
| public class CusttaxUpdateListener  implements IBusinessListener{ | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void doAction(IBusinessEvent event) throws BusinessException { | ||||
| 		HYPubBO bo = new HYPubBO(); | ||||
| 		BDCommonEvent e = (BDCommonEvent) event; | ||||
| 		if(e.getObjs().length>1) { | ||||
| 			return; | ||||
| 		} | ||||
| 		CustomerVO newobjs = (CustomerVO) e.getObjs()[0]; | ||||
| 		CustomerVO oldobjs = (CustomerVO) e.getOldObjs()[0]; | ||||
| 
 | ||||
| 		String newname = newobjs.getName(); | ||||
| 		String oldname = oldobjs.getName(); | ||||
| 		if(oldname!=null && !oldname.equals(newname)) { | ||||
| 			CusttaxVO[] vos = (CusttaxVO[])bo.queryByCondition(CusttaxVO.class, "pk_customer = '"+oldobjs.getPrimaryKey()+"'"); | ||||
| 			if(vos.length>0) { | ||||
| 				for(CusttaxVO vo: vos) { | ||||
| 					vo.setBuyername(newname); | ||||
| 					vo.setStatus(1); | ||||
| 				} | ||||
| 				bo.updateAry(vos); | ||||
| 			} | ||||
| 
 | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
		Loading…
	
		Reference in New Issue