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.pub.compiler.PfParameterVO;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;


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