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

import com.yem.wm.im.delivernotice.validator.DeliverNoticeSubmitValidator;
import com.yem.wm.im.delivernotice.validator.DeliverNoticeValidator;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.plugin.PreparePropertysEventArgs;

import java.util.List;

public class DeliverNoticesSubmitOp extends AbstractOperationServicePlugIn {
    @Override
    public void onPreparePropertys(PreparePropertysEventArgs e) {
        super.onPreparePropertys(e);
        List<String> fieldKeys = e.getFieldKeys();
        fieldKeys.add("yem_corebilltype");
        fieldKeys.add("yem_corebillid");
        fieldKeys.add("yem_totalallamount");
        fieldKeys.add("yem_sourcebillid");
        fieldKeys.add("billno");
        fieldKeys.add("yem_es_materialinfo");
        fieldKeys.add("yem_sourceentryid");
        fieldKeys.add("yem_isaccgift");
        fieldKeys.add("yem_acccurrency");
        fieldKeys.add("yem_accrate");
        fieldKeys.add("yem_saleorder");
        fieldKeys.add("yem_products");
        fieldKeys.add("yem_productstree");
        fieldKeys.add("yem_num");
        fieldKeys.add("yem_singleaccamt");
        fieldKeys.add("yem_singleaccamtbase");
        fieldKeys.add("yem_accamt");
        fieldKeys.add("yem_accamtbase");
        fieldKeys.add("yem_remarke");
        fieldKeys.add("yem_contractallamt");
        fieldKeys.add("yem_contractadvanceamt");
        fieldKeys.add("yem_deliveramt");
        fieldKeys.add("yem_thisdeliveramt");
        fieldKeys.add("yem_thisrealityamt");
        fieldKeys.add("yem_amt");
        fieldKeys.add("yem_qty");
        fieldKeys.add("yem_contractnum");
        fieldKeys.add("yem_customer");
        fieldKeys.add("yem_es_materialinfo");
        fieldKeys.add("yem_es_materialinfo.yem_materiel");
        fieldKeys.add("yem_es_materialinfo.seq");
    }
    @Override
    public void onAddValidators(AddValidatorsEventArgs e) {
        super.onAddValidators(e);
//        e.addValidator(new DeliverNoticeSubmitValidator());
        e.addValidator(new DeliverNoticeValidator());
    }
}
