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

import com.yem.wm.im.xpricelibrary.validator.XPriceLibrarySubmitValidator;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.plugin.PreparePropertysEventArgs;
import kd.bos.entity.plugin.args.EndOperationTransactionArgs;

/**
 * @author zhouc
 * @date 2024/1/30 11:30
 * @className XPriceLibrarySubmitOp
 * @description 价格库变更单【提交】服务插件
 */
public class XPriceLibrarySubmitOp extends AbstractOperationServicePlugIn {

    @Override
    public void onPreparePropertys(PreparePropertysEventArgs e) {
        e.getFieldKeys().add("yem_billtype");//单据类型
        e.getFieldKeys().add("yem_optional");//选装
        e.getFieldKeys().add("yem_replaceable");//替换
        e.getFieldKeys().add("yem_retrofitting");//加装
        e.getFieldKeys().add("yem_salesmarkup_o");//选装销售加价
        e.getFieldKeys().add("yem_profilename_o");//选装销售加价
        e.getFieldKeys().add("yem_salesmarkup_re");//替换销售加价
        e.getFieldKeys().add("yem_profilename_re");//替换销售加价
        e.getFieldKeys().add("yem_salesmarkup_rt");//加装销售加价
        e.getFieldKeys().add("yem_profilename_rt");//替换销售加价
    }

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

    @Override
    public void endOperationTransaction(EndOperationTransactionArgs e) {
        super.endOperationTransaction(e);

    }
}
