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

import kd.bos.form.events.SetFilterEvent;
import kd.bos.list.ListShowParameter;
import kd.bos.list.plugin.AbstractListPlugin;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;

/**
 * @author zhouc
 * @date 2024/4/15 14:40
 * @className DelivernoticeList
 * @description 发货通知单表单插件
 */
public class DelivernoticeList extends AbstractListPlugin {
    @Override
    public void setFilter(SetFilterEvent e) {
        super.setFilter(e);
        ListShowParameter parameter = (ListShowParameter) this.getView().getFormShowParameter();
        String billFormId = parameter.getBillFormId();
        if("yem_es_delivernotice_zj".equals(billFormId)){
            e.addCustomQFilter(new QFilter("yem_billtype.number", QCP.equals,"yem_es_delivernotice_zj"));
        }
        if("yem_es_delivernotice_pj".equals(billFormId)){
            e.addCustomQFilter(new QFilter("yem_billtype.number", QCP.equals,"yem_es_delivernotice_pj"));
        }
        if("yem_es_delivernotice_o".equals(billFormId)){
            e.addCustomQFilter(new QFilter("yem_billtype.number", QCP.equals,"yem_es_delivernotice_o"));
        }
    }
}
