package com.kingdee.eas.custom.performancenew.service;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.bsf.service.app.IHRMsfService;
import com.kingdee.bos.metadata.entity.*;
import com.kingdee.bos.sql.ParserException;
import com.kingdee.eas.basedata.org.AdminOrgUnitInfo;
import com.kingdee.eas.basedata.org.JobInfo;
import com.kingdee.eas.basedata.org.PositionInfo;
import com.kingdee.eas.basedata.person.PersonInfo;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.custom.performancenew.*;
import com.kingdee.eas.custom.performancenew.app.orderStatucEnum;
import com.kingdee.eas.framework.CoreBaseInfo;
import com.kingdee.eas.hr.affair.EmpHireBizBillEntryInfo;
import com.kingdee.eas.hr.base.*;
import com.kingdee.eas.hr.base.app.EmpPostExperienceHisHelper;
import com.kingdee.eas.hr.base.util.FileImportHelper;
import com.kingdee.eas.hr.org.HRJobInfo;
import com.kingdee.eas.hr.org.JobGradeInfo;
import com.kingdee.eas.hr.org.JobLevelInfo;
import com.kingdee.shr.base.syssetting.app.io.fileImport.BaseColumnInfo;
import com.kingdee.shr.base.syssetting.app.io.fileImport.BaseImportService;
import com.kingdee.shr.base.syssetting.app.io.fileImport.BaseRowInfo;
import com.kingdee.shr.base.syssetting.app.io.fileImport.ImportException;
import com.kingdee.shr.base.syssetting.app.io.impl.util.EmpHireImportCheck;
import com.kingdee.shr.base.syssetting.app.io.impl.util.FileServiceUtil;
import com.kingdee.shr.base.syssetting.context.SHRContext;
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
import com.kingdee.shr.base.syssetting.ml.SHRWebResource;
import com.kingdee.shr.osf.service.ServiceLocator;
import com.kingdee.shr.shrimport.SHRFileTemplateInfo;
import com.kingdee.util.DateTimeUtils;
import com.kingdee.util.StringUtils;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.util.*;

/**
 * @author qingwu
 * @date 2024/4/19
 * @apiNote 周期季度（专员导入）人员考核等级评分
 */
public class ExamineGradeImportService extends BaseImportService {
    @Override
    protected String getPKSelectString(BaseRowInfo row) {
        String pkSelectString = super.getPKSelectString(row);
        String parentId = getCustomParam("parentId");
        if (StringUtils.isEmpty(parentId)) {
            throw new RuntimeException("绩效考核周期表ID不可为空！！");
        }
        return pkSelectString + " and parent.id ='" + parentId + "'";
    }

    @Override
    protected void beforeSubmitData(CoreBaseInfo coreBaseInfo) throws ImportException {
        String parentId = getCustomParam("parentId");
        ExamineGradePersonEntryInfo examineGradePersonEntryInfo = (ExamineGradePersonEntryInfo) coreBaseInfo;
        examineGradePersonEntryInfo.put("parent", parentId);
        examineGradePersonEntryInfo.setOrderStatuc(orderStatucEnum.closeOrder);
    }
}
