package nckd.jxccl.hr.psms.plugin.form.initial;

import kd.bos.common.enums.EnableEnum;
import kd.bos.form.events.SetFilterEvent;
import kd.bos.list.plugin.AbstractListPlugin;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.sdk.plugin.Plugin;
import nckd.jxccl.base.common.enums.psms.TypeStateEnum;
import nckd.jxccl.hr.psms.common.PositionStructureConstant;

/**
* 位体系-已定级人员列表
* @author W.Y.C
* @date 2025/10/5 23:34
* @version 1.0
*/
public class GradedPersonQueryListPlugin extends AbstractListPlugin implements Plugin {

    @Override
    public void setFilter(SetFilterEvent setFilterEvent) {
        //只查询初定的档案
        QFilter filter = new QFilter(PositionStructureConstant.NCKD_DISABLE, QCP.equals,EnableEnum.NO.getCode())
                .and(new QFilter(PositionStructureConstant.NCKD_FIRSTRANK, QCP.equals,EnableEnum.YES.getCode()))
                .and(new QFilter(PositionStructureConstant.NCKD_TYPESTATE, QCP.in, new String[]{TypeStateEnum.IN_SERVICE_LEVEL.getCode(),TypeStateEnum.NEW_ENTRY.getCode()}));
        setFilterEvent.addCustomQFilter(filter);
    }
}