package jnpf.model.personnels.vo.regular;

import jnpf.model.cultivate.vo.offline.FtbCultivateOfflineFileVO;
import jnpf.model.personnels.dto.salary.FtbPersonnelsSalaryInfo;
import jnpf.model.personnels.po.FtbPersonnelsRegularManagement;
import jnpf.model.personnels.vo.task.FtbPersonnelsAuditInfoVO;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Title:FtbPersonnelsRegularInfoVO
 * @Author:peng.hao
 * @create: 2024/2/120:34
 */
@Data
public class FtbPersonnelsRegularInfoVO {

    private String id;

    /**
     * 1,手动转正 2,审批
     */
    private String flag;

    /**
     * 系统展示userId
     */
    private String systemWokerId;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 用户姓名
     */
    private String userName;

    /**
     * 工号
     */
    private String jobNumber;

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

    /**
     * 试用期
     * 100	无试用期
     * 101	1个月内
     * 102	1个月
     * 103	2个月
     * 104	3个月
     * 105	4个月
     * 106	5个月
     * 107	6个月
     * 108	7个月
     * 109	8个月
     */
    private String probation;
    /**
     * 试用期天数，如果是1个月内，这里就是天数
     */
    private String probationPeriodDay;

    /**
     * 直属主管
     */
    private String immediateSuperId;

    /**
     * 直属主管name
     */
    private String immediateSuperName;
    /**
     * 计划转正日期
     */
    private Date schedConverDate;

    /**
     * 实际转正日期
     */
    private Date actualConverDate;


    /**
     * 所属组织id
     */
    private String orgId;

    /**
     * 所属组织名称
     */
    private String orgName;
    /**
     * 入职岗位id
     */
    private String onboardPostId;

    /**
     * 入职岗位名称
     */
    private String onboardPostName;

    /**
     * 入职职等id
     */
    private String onboardGradeId;

    /**
     * 入职职等name
     */
    private String onboardGradeName;
    /**
     * 转正岗位id
     */
    private String regularPostId;

    /**
     * 转正岗位名称
     */
    private String regularPostName;

    /**
     * 转正职等id
     */
    private String regularGradeId;

    /**
     * 转正职等name
     */
    private String regularGradeName;

    /**
     * 入职薪酬
     */
    private BigDecimal startingSalary;

    /**
     * 转正薪酬
     */
    private BigDecimal regularSalary;


    /**
     * 附件信息上限10个
     */
    private List<FtbCultivateOfflineFileVO> files;


    /**
     * 转正备注
     */
    private String remarksConver;

    /**
     * 审核信息 意见是否必填 是否具有填写权限 勾选权限
     */
    private FtbPersonnelsAuditInfoVO auditInfo;

    /**
     * 办理人
     */
    private String creatorUserId;
    /**
     * 办理人
     */
    private String creatorUserName;
    /**
     * 办理时间
     */
    private Date creatorTime;

    /**
     * 申请来源 0,员工申请,1,审批办理,2直接办理
     */
    private Integer applicationSource;

    /**
     * 审批id
     */
    private String taskInfoId;
    /**
     * 转正审批状态(0,待审批,1审批中,2,审核通过,3,审核不通过,4,撤销,5未办理, 6手动转正,)
     */
    private Integer transferStatus;


    /**
     * 考勤组
     */
    private String attendanceGroupName;

    /**
     * 是否调整薪酬(0,否,1是)
     */
    private String isAdjustSalary;


    /**
     * 薪资结构(0,不使用,1使用)
     */
    private String salaryStructure;

    /**
     * 薪资生效日期
     */
    private Date payrollEffectiveDate;


    /**
     *  薪资详情 (v1.1)
     */
    private List<FtbPersonnelsSalaryInfo> salaryStructureList;

    /**
     *  版本号 区分是否为老版本审批数据 0为老版本 1为新版审批
     */
    private Integer versionNum;

    /**
     * 薪资调整原因
     */
    private String  reasonsForSalaryAdjustments;
    /**
     * 班组id
     */
    private String teamID;
    /**
     * 班组名称
     */
    private String teamName;

    /**
     * 调薪方式 1.加薪 2.降薪
     */
    private Integer salaryType;

    /**
     * 薪资序列
     *  1职级标准 2自定义标准
     */
    private Integer payrollSequence;

    /**
     * 薪资序列名称
     */
    private String payrollSequenceName;
    /**
     * 薪资序列 id
     */
    private String payrollSequenceId;

    public static FtbPersonnelsRegularInfoVO convertFtbPersonnelsRegularInfoVO(FtbPersonnelsRegularManagement regularManagement) {
        if (regularManagement == null) {
            return null;
        }
        FtbPersonnelsRegularInfoVO ftbPersonnelsRegularInfoVO = new FtbPersonnelsRegularInfoVO();
        ftbPersonnelsRegularInfoVO.setSystemWokerId(regularManagement.getSystemWokerId());
        ftbPersonnelsRegularInfoVO.setUserId(regularManagement.getUserId());
        ftbPersonnelsRegularInfoVO.setUserName(regularManagement.getUserName());
        ftbPersonnelsRegularInfoVO.setDateOfEntry(regularManagement.getDateOfEntry());
        ftbPersonnelsRegularInfoVO.setJobNumber(regularManagement.getJobNumber());
        ftbPersonnelsRegularInfoVO.setProbation(regularManagement.getProbation());
        ftbPersonnelsRegularInfoVO.setProbationPeriodDay(regularManagement.getProbationPeriodDay());
        ftbPersonnelsRegularInfoVO.setImmediateSuperId(regularManagement.getImmediateSuperId());
        ftbPersonnelsRegularInfoVO.setImmediateSuperName(regularManagement.getImmediateSuperName());
        ftbPersonnelsRegularInfoVO.setSchedConverDate(regularManagement.getSchedConverDate());
        ftbPersonnelsRegularInfoVO.setActualConverDate(regularManagement.getActualConverDate());
        ftbPersonnelsRegularInfoVO.setOrgId(regularManagement.getOrgId());
        ftbPersonnelsRegularInfoVO.setOrgName(regularManagement.getOrgName());
        ftbPersonnelsRegularInfoVO.setOnboardPostId(regularManagement.getOnboardPostId());
        ftbPersonnelsRegularInfoVO.setOnboardPostName(regularManagement.getOnboardPostName());
        ftbPersonnelsRegularInfoVO.setOnboardGradeId(regularManagement.getOnboardGradeId());
        ftbPersonnelsRegularInfoVO.setOnboardGradeName(regularManagement.getOnboardGradeName());
        ftbPersonnelsRegularInfoVO.setRegularPostId(regularManagement.getRegularPostId());
        ftbPersonnelsRegularInfoVO.setRegularPostName(regularManagement.getRegularPostName());
        ftbPersonnelsRegularInfoVO.setRegularGradeId(regularManagement.getRegularGradeId());
        ftbPersonnelsRegularInfoVO.setRegularGradeName(regularManagement.getRegularGradeName());
        ftbPersonnelsRegularInfoVO.setStartingSalary(regularManagement.getStartingSalary());
        ftbPersonnelsRegularInfoVO.setRegularSalary(regularManagement.getRegularSalary());
        ftbPersonnelsRegularInfoVO.setRemarksConver(regularManagement.getRemarksConver());
        ftbPersonnelsRegularInfoVO.setTransferStatus(regularManagement.getTransferStatus());
        ftbPersonnelsRegularInfoVO.setApplicationSource(regularManagement.getApplicationSource());
        ftbPersonnelsRegularInfoVO.setTaskInfoId(regularManagement.getTaskInfoId());
        ftbPersonnelsRegularInfoVO.setIsAdjustSalary(regularManagement.getIsAdjustSalary());
        ftbPersonnelsRegularInfoVO.setSalaryStructure(regularManagement.getSalaryStructure());
        ftbPersonnelsRegularInfoVO.setPayrollEffectiveDate(regularManagement.getPayrollEffectiveDate());
        ftbPersonnelsRegularInfoVO.setVersionNum(regularManagement.getVersionNum());
        ftbPersonnelsRegularInfoVO.setCreatorTime(regularManagement.getCreatorTime());
        ftbPersonnelsRegularInfoVO.setCreatorUserId(regularManagement.getCreatorUserId());
        ftbPersonnelsRegularInfoVO.setId(regularManagement.getId());
        return ftbPersonnelsRegularInfoVO;
    }
}
