package com.yem.wm.es.salesorder.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;
import kd.sdk.plugin.Plugin;

/**
 * 标准单据列表
 */
public class SalesOrdervList extends AbstractListPlugin implements Plugin {

    @Override
    public void setFilter(SetFilterEvent e) {
        super.setFilter(e);
        ListShowParameter parameter = (ListShowParameter) this.getView().getFormShowParameter();
        if(null != parameter) {
            String formId = parameter.getBillFormId();
            if(null != formId && !"".equals(formId)) {
                if("yem_es_salesorder_v1".equals(formId)){
                    QFilter filter = new QFilter("yem_materialclassb2.number", QCP.equals, "ZJ");
                    e.getQFilters().add(filter);
                }else if("yem_es_salesorder_v2".equals(formId)){
                    QFilter filter = new QFilter("yem_materialclassb2.number", QCP.equals, "PJ");
                    e.getQFilters().add(filter);
                }
            }
        }
    }
}