package nccloud.api.impl.ic.m47.fill;

import nc.bs.ic.pub.base.ICRule;
import nc.vo.ic.m47.entity.SubcontInVO;
import nc.vo.ic.pub.rule.ICBodyNshouldassistnumCal;
import nc.vo.ic.pub.rule.ICCountryInfoFillRule;
import nc.vo.ic.pub.rule.ICCvendoridFillRule;
import nc.vo.ic.pub.rule.ICCwarehouseidFillRule;
import nc.vo.ic.pub.rule.ICMaterialFullRule;
import nc.vo.ic.pub.rule.ICNchangestdrateFillRule;
import nc.vo.ic.pub.rule.ICNtaxrateFillRule;
import nc.vo.ic.pub.rule.ICOrgFillRule;
import nc.vo.ic.pub.rule.ICTranstypeFillRule;
import nc.vo.ic.pub.rule.processer.ICAroundProcesser;
import nccloud.api.impl.ic.m47.rule.Choose47DefaultFillRule;

/**
 * @Classname SubcontInSaveFillValue
 * @Description TODO
 * @Version 1.0.0
 * @Date 2025/5/15 10:10
 * @Created by sdlizheng
 */
public class SubcontInSaveFillValue {
    public void setDefaultValue(SubcontInVO[] vos) {
        ICAroundProcesser<SubcontInVO> processer =
                new ICAroundProcesser<SubcontInVO>();

        // 组织
        ICRule<SubcontInVO> rule = new ICOrgFillRule<SubcontInVO>();
        processer.addFillvalueRule(rule);

        // 国家
        rule = new ICCountryInfoFillRule<SubcontInVO>();
        processer.addFillvalueRule(rule);

        // 表头供应商
        rule = new ICCvendoridFillRule<SubcontInVO>();
        processer.addFillvalueRule(rule);

        // 仓库
        rule = new ICCwarehouseidFillRule<SubcontInVO>();
        processer.addFillvalueRule(rule);

        // 交易类型
        rule = new ICTranstypeFillRule<SubcontInVO>();
        processer.addFillvalueRule(rule);

        // 物料
        rule = new ICMaterialFullRule<SubcontInVO>();
        processer.addFillvalueRule(rule);

        // 财务组织等默认值填充
        rule = new Choose47DefaultFillRule<SubcontInVO>();
        processer.addFillvalueRule(rule);

        // 设置汇率
        rule = new ICNchangestdrateFillRule<SubcontInVO>();
        processer.addFillvalueRule(rule);

        // 数量，金额，汇率，税率处理
        rule = new ICBodyNshouldassistnumCal<SubcontInVO>();
        processer.addFillvalueRule(rule);
        //执行
        processer.fillvalue(vos);

    }

}
