package nc.bs.ic.m4r.approve;

import nc.bs.ic.m4r.approve.rule.AfterApprovingSynchronizeRuleMES;
import nc.bs.ic.m4r.approve.rule.PushInOutBills;
import nc.bs.ic.m4r.base.BPPluginPoint;
import nc.bs.ic.m4r.insert.rule.InvcountDataCheck;
import nc.bs.ic.pub.base.ICAroundProcesser;
import nc.bs.ic.special.approve.ApproveBPTemplate;
import nc.bs.ic.special.approve.IApproveBP;
import nc.bs.ic.special.approve.rule.SpecialAuditDataCheck;
import nc.bs.ic.special.base.IApproveRuleProvider;
import nc.bs.pub.compiler.AbstractCompiler2;
import nc.vo.ic.m4r.entity.InvCountBillVO;

public class ApproveBP implements IApproveBP<InvCountBillVO>, IApproveRuleProvider<InvCountBillVO> {
    public ApproveBP() {
    }

    public InvCountBillVO[] approve(InvCountBillVO[] bills, AbstractCompiler2 script) {
        return (InvCountBillVO[]) (new ApproveBPTemplate(BPPluginPoint.ApproveBP, this)).approve(bills, script);
    }

    public void addApproveAfterRule(ICAroundProcesser<InvCountBillVO> processor) {
        processor.addAfterRule(new PushInOutBills());
        // ΕΜ΅γ£¨ΙσΕϊΊσ΄«MES£©
        processor.addAfterRule(new AfterApprovingSynchronizeRuleMES());
    }

    public void addApproveBeforeRule(ICAroundProcesser<InvCountBillVO> processor) {
        processor.replaceBeforeRuleAt(new InvcountDataCheck(), SpecialAuditDataCheck.class);
    }
}