
package nc.bs.pub.action;

import nc.bs.framework.common.NCLocator;
import nccloud.bs.hrkq.hrkq.aggbusi.plugin.bpplugin.MonthOtTimeVOPluginPoint;
import nc.bs.pubapp.pf.action.AbstractPfAction;
import nc.bs.pubapp.pub.rule.ApproveStatusCheckRule;
import nc.impl.pubapp.pattern.rule.processer.CompareAroundProcesser;
import nccloud.itf.hrkq.hrkq.IMonthottimevoMaintain;
import nc.vo.hrkq.monthottime.AggMonthOtTimeVO;
import nc.vo.pub.BusinessException;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;

public class N_6QOT_APPROVE extends AbstractPfAction<AggMonthOtTimeVO> {

        public N_6QOT_APPROVE() {
                super();
        }

        @Override
        protected CompareAroundProcesser<AggMonthOtTimeVO> getCompareAroundProcesserWithRules(
                        Object userObj) {
                CompareAroundProcesser<AggMonthOtTimeVO> processor = new CompareAroundProcesser<AggMonthOtTimeVO>(
                                MonthOtTimeVOPluginPoint.APPROVE);
                processor.addBeforeRule(new ApproveStatusCheckRule());
                return processor;
        }

        @Override
        protected AggMonthOtTimeVO[] processBP(Object userObj,
                        AggMonthOtTimeVO[] clientFullVOs, AggMonthOtTimeVO[] originBills) {
                AggMonthOtTimeVO[] bills = null;
                IMonthottimevoMaintain operator = NCLocator.getInstance().lookup(
                                IMonthottimevoMaintain.class);
                try {
                        bills = operator.approve(clientFullVOs, originBills);
                        
                        
                } catch (BusinessException e) {
                        ExceptionUtils.wrappBusinessException(e.getMessage());
                }
                return bills;
        }

}
