package com.yem.wm.im.orderproreqbill.op;

import com.yem.wm.im.orderproreqbill.validator.OrderProReqBillSubmitValidator;
import com.yem.wm.im.orderproreqbill.validator.OrderProReqBillValidator;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.plugin.PreparePropertysEventArgs;

import java.util.List;

public class OrderProReqBillSubmitOp extends AbstractOperationServicePlugIn {
    @Override
    public void onPreparePropertys(PreparePropertysEventArgs e) {
        super.onPreparePropertys(e);
        List<String> keys = e.getFieldKeys();

        keys.add("yem_es_materialinfo");
        keys.add("yem_warehouse");
        keys.add("yem_outwhcode");
        keys.add("yem_billtype");


        keys.add("yem_isvmi");
        keys.add("yem_companyorg");
        keys.add("billstatus");
        keys.add("yem_es_materialinfo");


        keys.add("yem_es_materialinfo.yem_materiel");
        keys.add("yem_es_materialinfo.seq");

    }

    @Override
    public void onAddValidators(AddValidatorsEventArgs e) {
        super.onAddValidators(e);
        e.addValidator(new OrderProReqBillSubmitValidator());
        e.addValidator(new OrderProReqBillValidator());
    }
}
