package jnpf.model.personnels.dto.salary;

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

import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.List;

/**
 * @Title:
 * @Author: peng.hao
 * @create: 2024/7/3:10:56
 */
@Data
public class FtbPersonnelsSalaryTemporaryStorageCreatDto {

    /**
     * 主键id
     */
    private String id;

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

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

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

    /**
     *  薪资详情
     */
    private List<FtbPersonnelsSalaryInfo> salaryStructureList;

    /** 用户id */
    @NotBlank(message = "用户id")
    private String userId;

    /**
     * 配置类型
     * 1 入职审批配置  2 转正审批配置  3 调岗审批配置  5 晋升审批配置
     * */
    private Integer configType;


    public static FtbPersonnelsSalaryTemporaryStorage covert(FtbPersonnelsSalaryTemporaryStorageCreatDto creatDto) {
        if (creatDto == null) {
            return null;
        }
        FtbPersonnelsSalaryTemporaryStorage ftbPersonnelsSalaryTemporaryStorage = new FtbPersonnelsSalaryTemporaryStorage();
        ftbPersonnelsSalaryTemporaryStorage.setIsAdjustSalary(creatDto.getIsAdjustSalary());
        ftbPersonnelsSalaryTemporaryStorage.setSalaryStructure(creatDto.getSalaryStructure());
        ftbPersonnelsSalaryTemporaryStorage.setPayrollEffectiveDate(creatDto.getPayrollEffectiveDate());
        ftbPersonnelsSalaryTemporaryStorage.setUserId(creatDto.getUserId());
        ftbPersonnelsSalaryTemporaryStorage.setConfigType(creatDto.getConfigType());
        return ftbPersonnelsSalaryTemporaryStorage;
    }
}
