package nc.impl.fa.reduce.rule;

import nc.bs.am.framework.action.ActionContext;
import nc.bs.am.framework.action.IRule;
import nc.vo.fa.reduce.ReduceBodyVO;
import nc.vo.fa.reduce.ReduceHeadVO;
import nc.vo.fa.reduce.ReduceVO;
import nc.vo.pub.BusinessException;
import nccloud.web.byz.action.ARCApproveAction;

public class SendARCReduceRule implements IRule<ReduceVO> {
	@Override
	public void process(ActionContext<ReduceVO> context, ReduceVO... aggVos) throws BusinessException {
		if (aggVos == null || aggVos.length == 0) {
			throw new BusinessException("VO为空");
		}

		for (ReduceVO aggvo : aggVos) {
			ReduceHeadVO hvo = (ReduceHeadVO) aggvo.getParentVO();
			ReduceBodyVO[] bvo =  (ReduceBodyVO[]) aggvo.getChildrenVO();
			if ("碧优资".equals(hvo.getDef10())) {
				// 推送给ARC
				new ARCApproveAction().sendApprove(bvo[0].getPk_card(), hvo.getDef11(), 2);
			}
		}
	}
}
