package nc.bs.pub.action;

import java.util.Hashtable;

import nc.bs.framework.common.NCLocator;
import nc.bs.ic.m45.ext.rule.M45AfterSignRule;
import nc.bs.pub.compiler.AbstractCompiler2;
import nc.itf.scmpub.reference.uap.group.SysInitGroupQuery;
import nc.pubitf.pu.est.m45.IPurchaseInTOCostAP;
import nc.vo.ic.m45.entity.PurchaseInVO;
import nc.vo.ml.NCLangRes4VoTransl;
import nc.vo.pub.BusinessException;
import nc.vo.pub.compiler.PfParameterVO;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;

public class N_45_AutoMatch extends AbstractCompiler2 {
	private Hashtable m_methodReturnHas = new Hashtable();
	private Hashtable m_keyHas = null;

	public Object runComClass(PfParameterVO vo) throws BusinessException {
		try {
			this.m_tmpVo = vo;

			PurchaseInVO[] inVO = { (PurchaseInVO) getVo() };

			if (!SysInitGroupQuery.isPOEnabled())
				return inVO;
			M45AfterSignRule m45AfterSignRule = new M45AfterSignRule();
			m45AfterSignRule.process(inVO);
			return inVO;
		} catch (Exception ex) {
			ExceptionUtils.marsh(ex);

			return null;
		}
	}

	public String getCodeRemark() {
		return NCLangRes4VoTransl.getNCLangRes().getStrByID("4008002_0", "04008002-0076");
	}

	private void setParameter(String key, Object val) {
		if (this.m_keyHas == null) {
			this.m_keyHas = new Hashtable();
		}
		if (val != null)
			this.m_keyHas.put(key, val);
	}
}
