package jnpf.model.personnels.dto.staff.employment;

import jnpf.model.personnels.dto.staff.roster.StaffDepartDto;
import jnpf.model.personnels.dto.staff.roster.WorkerGroupDataDto;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @Author: peng.hao
 * @create: 2024/10/21
 */
@Data
public class FtbPersonnelsTurnoverLogVO {
    /**
     * 姓名
     */
    private String  name;

    /**
     * 员工ID
     */
    private String  employeeID;


    /**
     *入职日期
     */
    private Date dateOfEntry;

    /**
     * 办理日期
     */
    private Date  processingDate;

    /**
     * 离职原因
     */
    private String reasonForLeaving;
    /**
     * 类型 1办理离职 2 试岗驳回
     */
    private Integer type;

    /**
     * 组织信息
     */
    private List<WorkerGroupDataDto> workerGroupDataDto;

    /**
     * 操作人
     */
    private String operator;

    public static FtbPersonnelsTurnoverLogVO covert(StaffDepartDto dto) {
        if (dto == null) {
            return null;
        }
        FtbPersonnelsTurnoverLogVO ftbPersonnelsTurnoverLogVO = new FtbPersonnelsTurnoverLogVO();
        ftbPersonnelsTurnoverLogVO.setReasonForLeaving(dto.getReasonForLeaving());
        ftbPersonnelsTurnoverLogVO.setType(dto.getType());
        ftbPersonnelsTurnoverLogVO.setWorkerGroupDataDto(dto.getWorkerGroupDataDto());
        ftbPersonnelsTurnoverLogVO.setEmployeeID(dto.getEmployeeID());
        ftbPersonnelsTurnoverLogVO.setDateOfEntry(dto.getActualStartDate());
        return ftbPersonnelsTurnoverLogVO;
    }
}
