package jnpf.model.personnels.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import jnpf.base.entity.SuperEntity;
import jnpf.model.personnels.dto.emp.FtbEmpAddNewDTO;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 员工入职表
 *
 * @author admin
 * @create 2024-02-01
 */

@Getter
@Setter
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName(value = "ftb_personnels_staff_employment_apply")
public class FtbPersonnelsStaffEmploymentApply extends SuperEntity.SuperCUBaseEntity<String> implements Serializable {
    /**
     * 手机号
     */
    @TableField(value = "F_Phone")
    private String phone;

    /**
     * 姓名
     */
    @TableField(value = "F_WorkerName")
    private String workerName;

    /**
     * 用户id
     */
    @TableField(value = "F_UserId")
    private String userId;

    /**
     * 用户id
     */
    @TableField(value = "F_SystemUserId")
    private String systemWokerId;

    /**
     * 组织id
     */
    @TableField(value = "F_CurrOrg")
    private String currOrg;
    /**
     * 组织id
     */
    @TableField(value = "F_CurrOrgName")
    private String currOrgName;

    /**
     * 岗位id
     */
    @TableField(value = "F_CurrPosition")
    private String currPosition;

    /**
     * 岗位id
     */
    @TableField(value = "F_CurrPositionName")
    private String currPositionName;
    /**
     * 职等id
     */
    @TableField(value = "F_CurrRank")
    private String currRank;
    /**
     * 职等id
     */
    @TableField(value = "F_CurrRankName")
    private String currRankName;
    /**
     * 班组id
     */
    @TableField(value = "F_CurrGroupId")
    private String currGroupId;
    /**
     * 班组id
     */
    @TableField(value = "F_CurrGroupName")
    private String currGroupName;

    /**
     * 合同类型ID
     */
    @TableField(value = "F_ContractType")
    private String contractType;

    /**
     * 入职日期
     */
    @TableField(value = "F_ExpectedStartDate")
    private Date expectedStartDate;

    /**
     * 实际入职日期
     */
    @TableField(value = "F_ActualStartDate")
    private Date actualStartDate;

    /**
     * 来源关联信息名称
     */
    @TableField(value = "F_SourceRelation")
    private String sourceRelation;


    /**
     * 来源关联信息ID
     */
    @TableField(value = "F_SourceRelationId")
    private String sourceRelationId;

    /**
     * 身份证号
     */
    @TableField(value = "F_IdCard")
    private String idCardNum;


    /**
     * 来源，0、后台办理 1、APP端个人内推  2、门店招聘、3、组织招聘
     */
    @TableField(value = "F_Source")
    private Integer source;

    /**
     * 是否提交了入职登记表：0、未提交  1、已提交
     */
    @TableField(value = "F_IsSubmitForm")
    private Integer isSubmitForm;

    /**
     * 到岗状态：0、未到岗 1、已到岗 2、已逾期
     */
    @TableField(value = "F_Status")
    private Integer status;

    /**
     * 入职次数，大于1重复入职
     */
    @TableField(value = "F_JoinNum")
    private Integer joinNum;


    /**
     * 办理人
     */
    @TableField(value = "F_OpUser")
    private String opUser;

    /**
     * 办理人姓名
     */

    @TableField(value = "F_OpUserName")
    private String opUserName;

    /**
     * 入职薪酬
     */
    @TableField(value = "F_EntryMoney")
    private BigDecimal entryMoney;

    /**
     * 是否需要审批：0、需要审批  1、不需要审批
     */
    @TableField(value = "F_IsNeedCheck")
    private Integer isNeedCheck;

    /**
     * 审批状态：0,待审批,1审批中,2,审核通过,3,审核不通过
     */
    @TableField(value = "F_CheckStatus")
    private Integer checkStatus;

    /**
     * 附件，逗号分割
     */
    @TableField(value = "F_Files")
    private String files;

    /**
     * 有效标志，1无效 0有效
     */
    @TableField(value = "F_EnabledMark")
    private Integer enabledMark;

    /**
     * 短链
     */
    @TableField(value = "F_ShortUrl")
    private String shortUrl;

    /**
     * 审批id
     */
    @TableField(value = "F_TaskInfoId")
    private String taskInfoId;


    /**
     * 入职备注
     */
    @TableField(value = "F_OnboardingRemarks")
    private String onboardingRemarks;

    /**
     * 考勤组
     */

    @TableField(value = "F_AttendanceGroup")
    private String attendanceGroup;

    /**
     * 薪资结构(0,不使用,1使用)
     */
    @TableField(value = "F_SalaryStructure")
    private String salaryStructure;
    /**
     * 是否使用薪酬 默认不使用 0不使用 1使用
     */
    @TableField(value = "F_IsAdjustSalary")
    private Integer isAdjustSalary;

    /**
     * 薪酬总额
     */
    @TableField(value = "F_SalaryTotalAmount")
    private BigDecimal salaryTotalAmount;

    /**
     * 照片
     */
    @TableField(value = "F_PhotoFiles")
    private String photoFiles;

    /**
     *  薪酬临时数据存储
     */
    @TableField(value = "F_SalaryData")
    private String salaryData;

    /**
     *  版本号 区分是否为老版本审批数据 0为老版本 1为新版审批
     */
    @TableField(value = "F_VersionNum")
    private Integer versionNum;

    /**
     * app入职签名承诺截图
     */
    @TableField(value = "F_RegisterImg")
    private String registerImg;

    /**
     * 薪资调整原因
     */
    @TableField(value = "F_ReasonsForSalary")
    private String  reasonsForSalaryAdjustments;
    /**
     * 用户头像url
     */
    @TableField(value = "F_UserHeadLog")
    private String  userHeadLog;

    /**
     * 薪资序列
     *  1职级标准 2自定义标准
     */
    @TableField(value = "F_PayrollSequence")
    private Integer payrollSequence;

    /**
     * 薪资序列 id
     */
    @TableField(value = "F_PayrollSequenceId")
    private String payrollSequenceId;


    /**
     * 计划转正时间
     */
    @TableField(value = "F_PlanProbationaryDate")
    private Date planProbationaryDate;


    /**
     * 薪资序列名称
     */
    @TableField(value = "F_PayrollSequenceName")
    private String payrollSequenceName;

    /**
     * 员工类型
     */
    @TableField(value = "F_WorkerType")
    private String workerType;

    /**
     * 工作状态
     */
    @TableField(value = "F_WorkerStatus")
    private String workerStatus;

    /**
     * 直属主管
     */
    @TableField(value = "F_AffiliatedReportsTo")
    private String affiliatedReportsTo;

    /**
     * 试用期
     */
    @TableField(value = "F_ProbationPeriod")
    private String probationPeriod;


    /**
     * 试用期天数
     */
    @TableField(value = "F_ProbationPeriodDay")
    private String probationPeriodDay;

    public static FtbEmpAddNewDTO covert(FtbPersonnelsStaffEmploymentApply apply) {
        if (apply == null) {
            return null;
        }
        FtbEmpAddNewDTO ftbEmpAddNewDTO = new FtbEmpAddNewDTO();
        ftbEmpAddNewDTO.setPhone(apply.getPhone());
        ftbEmpAddNewDTO.setWorkerName(apply.getWorkerName());
        ftbEmpAddNewDTO.setCurrOrgId(apply.getCurrOrg());
        ftbEmpAddNewDTO.setCurrPositionId(apply.getCurrPosition());
        ftbEmpAddNewDTO.setCurrRankId(apply.getCurrRank());
        ftbEmpAddNewDTO.setCurrGroupId(apply.getCurrGroupId());
        ftbEmpAddNewDTO.setSource(apply.getSource());
        ftbEmpAddNewDTO.setRegisterImg(apply.getRegisterImg());
        ftbEmpAddNewDTO.setId(apply.getId());
        ftbEmpAddNewDTO.setIdCard(apply.getIdCardNum());
        ftbEmpAddNewDTO.setIsSubmitForm(apply.getIsSubmitForm());
        return ftbEmpAddNewDTO;
    }

}
