package com.yem.wm.es.encasement.op;

import com.yem.wm.es.encasement.validator.EncaseMentSubmitValidator;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.plugin.PreparePropertysEventArgs;

import java.util.List;

/**
 * @Classname EncaseMentSubmitOp
 * @Description TODO
 * @Date 2023/12/12 20:21
 * @Created by ZZSLL
 */

public class EncaseMentSubmitOp extends AbstractOperationServicePlugIn
{

    @Override
    public void onPreparePropertys(PreparePropertysEventArgs e)
    {
        super.onPreparePropertys(e);
        List<String> keys = e.getFieldKeys();
        keys.add("yem_im_materialinfo_mi");
        keys.add("yem_shipmentqty");
        keys.add("yem_packingqty");
    }

    @Override
    public void onAddValidators(AddValidatorsEventArgs e)
    {
        super.onAddValidators(e);
        // 明细信息中 已包装数量不能大于装箱数量
        e.addValidator(new EncaseMentSubmitValidator());
    }
}
