package nc.bs.ic.base;

import nc.bs.framework.common.NCLocator;
import nc.impl.pubapp.pattern.rule.IRule;
import nc.itf.th.IThOcrService;
import nc.vo.pu.m25.entity.InvoiceVO;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;


/**
 * 采购发票审批通过取消审批传发票云
 * @author Yaoyu
 * 2023-05-25
 *
 */
public class InvoiceAfterUnApproveEvent implements IRule<InvoiceVO>{
	
	private InvoiceVO[] orgVos = null;
	
	public  InvoiceAfterUnApproveEvent(InvoiceVO[] orgVos) {
		this.orgVos = orgVos;
	}
	@Override
	public void process(InvoiceVO[] vos) {
		try {
			IThOcrService  iThOcrService=(IThOcrService) NCLocator.getInstance().lookup(IThOcrService.class.getName());
			int vostatus = orgVos[0].getParentVO().getFbillstatus();
			if(vostatus == 3) {
				System.out.println();
				iThOcrService.UpdateInvoiceStatus("N", vos);
			}
			
		} catch (Exception e) {
			e.printStackTrace();
			ExceptionUtils.wrappBusinessException(e.getMessage());
		}
		
	}
}


