package nckd.jxccl.hr.psms.plugin.form.other.impt;

import kd.bos.orm.query.QFilter;
import kd.hr.hbp.formplugin.web.HRDataBaseList;
import kd.hr.impt.common.plugin.AfterLoadStartPageEventArgs;
import kd.hr.impt.common.plugin.BeforeQueryRefBdEventArgs;
import kd.hr.impt.common.plugin.HRImportPlugin;

import java.util.LinkedHashSet;

/**
* 关键行为项目评价结果
* 实体标识：nckd_keybehavevalprojrslt
* @author W.Y.C
* @date 2025/12/26 14:43
* @version 1.0
*/
public class KeyBeHavEvalProjRsltImportPlugin extends HRDataBaseList implements HRImportPlugin {
    @Override
    public void afterLoadStartPage(AfterLoadStartPageEventArgs args) {
        args.setFormId("nckd_keybehavevalprojrslt");
    }

    @Override
    public void beforeQueryRefBd(BeforeQueryRefBdEventArgs args) {
        String fieldId = args.getFieldId();
        if(fieldId.equalsIgnoreCase("nckd_keybehavconfentry")){
            LinkedHashSet<String> select = new LinkedHashSet<>();
            select.add("id");
            select.add("number");
            select.add("name");
            select.add("nckd_keybehavconf.nckd_org.name");
            select.add("nckd_keybehavconf.nckd_jobseqhr.name");
            args.setSelectFields(select);
            args.setFilters( new QFilter[]{QFilter.of("1=1")});
        }
    }
}
