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

import jnpf.model.personnels.po.FtbPersonnelsRegularManagement;
import lombok.Data;

import java.util.Date;

@Data
public class StaffRegularDto {
    /**
     * 所属组织 id
     */
    private String newOrg;

    /**
     * 当前岗位 id
     */
    private String newPosition;

    /**
     * 当前职等 id
     */
    private String newRank;

    /**
     * 组织名称
     */
    private String newOrgName;

    /**
     * 岗位名称
     */
    private String newPositionName;

    /**
     * 职等名称
     */
    private String newRankName;
    /**
     * 上级领导 id
     */
    private String immediateSuperId;

    /**
     * 转正备注
     */
    private String remarks;
    /**
     * 转正日期
     */
    private Date regularDate;

    /**
     * 转正日期
     */
    private Date actualRegularDate;

    /**
     * 入职日期
     */
    private Date dateOfEntry;
    /**
     * 操作人
     */
    private String operator;

    public static StaffRegularDto coverFtbPersonnelsRegularManagement(FtbPersonnelsRegularManagement management) {
        if (management == null) {
            return null;
        }
        StaffRegularDto staffRegularDto = new StaffRegularDto();
        staffRegularDto.setNewOrg(management.getOrgId());
        staffRegularDto.setNewOrgName(management.getOrgName());
        staffRegularDto.setNewPosition(management.getRegularPostId());
        staffRegularDto.setNewPositionName(management.getRegularPostName());
        staffRegularDto.setNewRank(management.getRegularGradeId());
        staffRegularDto.setNewRankName(management.getRegularGradeName());
        staffRegularDto.setImmediateSuperId(management.getImmediateSuperId());
        staffRegularDto.setRemarks(management.getRemarksConver());
        staffRegularDto.setRegularDate(management.getActualConverDate());
        staffRegularDto.setDateOfEntry(management.getDateOfEntry());
        staffRegularDto.setActualRegularDate(management.getActualConverDate());
        staffRegularDto.setOperator(management.getCreatorUserId());
        return staffRegularDto;
    }
}
