N_F1_APPROVE

package nc.bs.pub.action;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;

import nc.bs.framework.common.NCLocator;
import nc.bs.pub.compiler.AbstractCompiler2;
import nc.itf.arap.payablebill.IPayablebillItf;
import nc.vo.arap.BusiStatus;
import nc.vo.fipub.exception.ExceptionHandler;
import nc.vo.pub.AggregatedValueObject;
import nc.vo.pub.BusinessException;
import nc.vo.pub.CircularlyAccessibleValueObject;
import nc.vo.pub.compiler.PfParameterVO;

public class N_F1_APPROVE
  extends AbstractCompiler2
{
  private Hashtable<String, Object> m_keyHas = null;

  public Object runComClass(PfParameterVO paraVo)
    throws BusinessException
  {
    try
    {
      if (paraVo.m_preValueVos == null) {
        return null;
      }
      Object obj = null;
      this.m_tmpVo = paraVo;

      procFlowBacth(paraVo);

      List<AggregatedValueObject> list = new ArrayList();
      for (AggregatedValueObject aggvo : paraVo.m_preValueVos)
      {
        Integer bill_status = (Integer)aggvo.getParentVO().getAttributeValue("billstatus");
        if (bill_status.intValue() == BusiStatus.Audit.getBillStatusSubKind()) {
          list.add(aggvo);
        }
      }
      if (list.size() > 0)
      {
        setParameter("context", list.toArray(new AggregatedValueObject[0]));
        Object obj2 = runClass("nc.bs.arap.actions.PayablebillApproveBatchBSAction", "approveVOs", "&context:nc.vo.pub.AggregatedValueObject[]", paraVo, this.m_keyHas);
		//add by 陈志锋  2015-12-25 应付单审批通过后   start
		if(obj2 != null){
			IPayablebillItf iPayablebillItf = NCLocator.getInstance().lookup(IPayablebillItf.class);
			AggregatedValueObject[] vos = (AggregatedValueObject[]) obj2;
			for (int i = 0; i < vos.length; i++) {
				AggregatedValueObject vo = vos[i];
				String billclass = (String) vo.getParentVO().getAttributeValue("billclass");
				String billstatus = vo.getParentVO().getAttributeValue("approvestatus") + "";
				if("yf".equals(billclass) && "1".equals(billstatus)){
					iPayablebillItf.insertInfoMiddle(vo);
				}
			}

		}
        //add by 陈志锋  2015-12-25 应付单审批通过后   end
        return obj2;
      }
      return paraVo.m_preValueVos;
    }
    catch (Exception ex)
    {
      throw ExceptionHandler.handleException(getClass(), ex);
    }
  }

  public String getCodeRemark()
  {
    return " arap action script not allowed to modify ,all rights reserved!";
  }

  protected 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);
    }
  }
}

  

时间: 2024-10-11 04:20:53

N_F1_APPROVE的相关文章