package nckd.jimin.jyyy.hr.hspm.formplugin.web.reform.file.web.manage;

import kd.bos.base.AbstractBasePlugIn;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.datamodel.events.IDataModelListener;
import kd.bos.entity.datamodel.events.PackageDataEvent;
import kd.bos.form.control.Label;
import kd.bos.list.events.ListRowClickListener;
import kd.hr.haos.business.servicehelper.OrgBatchBillHelper;
import kd.hr.hbp.formplugin.web.HRDataBaseList;
import kd.sdk.plugin.Plugin;

import java.util.Date;
import java.util.EventObject;

/**
 * Tyx 2025-06-19
 * 任职经历卡片新增组织长名称
 * hspm_empposorgrel_reform
 */
public class FileManageReformEmpPosListPluginEx extends HRDataBaseList implements ListRowClickListener, IDataModelListener {

    @Override
    public void packageData(PackageDataEvent e) {
        super.packageData(e);
        DynamicObject org = e.getRowData();
        if("company.name".equals(e.getColKey())) {
            Long orgId = org.getLong("adminorg.id");
            Date date = org.getDate("startdate");
            String orgLongName = OrgBatchBillHelper.getOrgLongName(orgId, date, null);
            org.set("description", orgLongName.replace("集团_", ""));
        }
    }

    @Override
    public void afterBindData(EventObject e) {
        super.afterBindData(e);
    }



}