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

import com.yem.wm.im.priceLibrary.validator.PriceLibrarySubmitValidator;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.plugin.PreparePropertysEventArgs;

import java.util.List;

/**
 * @author zhouc
 * @date 2024/3/18 21:26
 * @className PriceLibrarySubmitOp
 * @description 价格库提交服务插件
 */
public class PriceLibrarySubmitOp extends AbstractOperationServicePlugIn {
    @Override
    public void onPreparePropertys(PreparePropertysEventArgs e) {
        List<String> fieldKeys = e.getFieldKeys();
        fieldKeys.add("yem_billtype");
        fieldKeys.add("yem_optional");
        fieldKeys.add("yem_replaceable");
        fieldKeys.add("yem_retrofitting");
        fieldKeys.add("yem_salesmarkup_o");
        fieldKeys.add("yem_profilename_o");
        fieldKeys.add("yem_replaceable");
        fieldKeys.add("yem_profilename_re");
        fieldKeys.add("yem_salesmarkup_re");
        fieldKeys.add("yem_retrofitting");
        fieldKeys.add("yem_salesmarkup_rt");
        fieldKeys.add("yem_profilename_rt");
    }

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