package jnpf.model.personnels.vo.employment;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import jnpf.easyexcel.StaffDateStringConverter;
import lombok.Data;

import java.util.Date;

/**
 * @Title: AddStaffEmploymentApplyExcelERRVO
 * @Author: peng.hao
 * @create: 2024/2/20 11:16
 */
@Data
public class AddStaffEmploymentApplyExcelERRVO {

    /**
     * 姓名
     */
    @ExcelProperty(index = 0,value = "*姓名")
    private String workerName;
    /**
     * 手机号
     */
    @ExcelProperty(index = 1,value = "*手机号码")
    private String phone;
    /**
     * 组织
     */
    @ExcelProperty(index = 2,value = "*组织")
    private String currOrgName;
    /**
     * 组织id
     */
    @ExcelProperty(index = 3,value = "组织ID")
    private String currOrg;

//    /**
//     * 合同类型ID
//     */
//    @ExcelProperty(index = 4, value = "合同类型")
//    private String contractType;
    /**
     * 考勤组
     */
    @ExcelProperty(index = 4, value = "考勤组")
    private String attendanceGroupName;

    /**
     * 预计入职日期
     */
    @ExcelProperty(index = 5, value = "*预计入职日期", converter = StaffDateStringConverter.class)
    @DateTimeFormat(value = "yyyy-MM-dd")
    private Date expectedStartDate;
    /**
     * 入职岗位
     */
    @ExcelProperty(index = 6,value = "*入职岗位")
    private String currPositionName;
    /**
     * 入职岗位id
     */
    @ExcelProperty(index = 7,value = "岗位ID")
    private String currPosition;
    /**
     * 职等id
     */
    @ExcelProperty(index = 8,value = "*入职职等")
    private String currRankName;

    /**
     * 错误备注
     */
    @ExcelProperty(index = 9,value = "错误备注")
    private String errorRemarks;

    public static AddStaffEmploymentApplyExcelERRVO convert(AddStaffEmploymentApplyExcelVO vo) {
        if (vo == null) {
            return null;
        }
        AddStaffEmploymentApplyExcelERRVO addStaffEmploymentApplyExcelERRVO = new AddStaffEmploymentApplyExcelERRVO();
        addStaffEmploymentApplyExcelERRVO.setWorkerName(vo.getWorkerName());
        addStaffEmploymentApplyExcelERRVO.setPhone(vo.getPhone());
        addStaffEmploymentApplyExcelERRVO.setCurrOrgName(vo.getCurrOrgName());
        addStaffEmploymentApplyExcelERRVO.setCurrOrg(vo.getCurrOrg());
//        addStaffEmploymentApplyExcelERRVO.setContractType(vo.getContractTypeName());
        addStaffEmploymentApplyExcelERRVO.setExpectedStartDate(vo.getExpectedStartDate());
        addStaffEmploymentApplyExcelERRVO.setCurrPositionName(vo.getCurrPositionName());
        addStaffEmploymentApplyExcelERRVO.setCurrPosition(vo.getCurrPosition());
        addStaffEmploymentApplyExcelERRVO.setCurrRankName(vo.getCurrRankName());

        addStaffEmploymentApplyExcelERRVO.setAttendanceGroupName(vo.getAttendanceGroupName());
        return addStaffEmploymentApplyExcelERRVO;
    }
}
