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

import com.yem.wm.im.transferorder.vaildator.TransFerOrderSubmitMustInputValidator;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.plugin.PreparePropertysEventArgs;

import java.util.List;

/**
 * @Description: 调拨订单申请单提交必录校验，配置的校验不生效
 * @Date: 2024/5/30 14:25
 * @Created: by ZZSLL
 */

public class TransFerOrderSubmitMustInputOp extends AbstractOperationServicePlugIn {

    @Override
    public void onPreparePropertys(PreparePropertysEventArgs e) {
        super.onPreparePropertys(e);
        List<String> fieldKeys = e.getFieldKeys();
        fieldKeys.add("yem_materiel");
        fieldKeys.add("yem_materialname");
        fieldKeys.add("yem_shippersalesorg");
        fieldKeys.add("yem_deliveryinventoryorg");
        fieldKeys.add("yem_entryoutwarehouse");
        fieldKeys.add("yem_receinventoryorg");
        fieldKeys.add("yem_entryinwarehouse");
        fieldKeys.add("yem_deliverywarehouse");
        fieldKeys.add("yem_receinventory");
        fieldKeys.add("yem_supwarehouse");
        fieldKeys.add("yem_cuswarehouse");
        fieldKeys.add("yem_unit");
        fieldKeys.add("yem_baseunit");
        fieldKeys.add("yem_planindate");
        fieldKeys.add("yem_planoutdate");
    }

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