package jnpf.model.personnels.dto.roster;

import jnpf.model.personnels.dto.black.FtbPersonnelsBlacklistAddDTO;
import jnpf.model.personnels.dto.turnover.FtbPersonnelsJobTrialRejectedCreateDTO;
import lombok.Data;

import javax.validation.constraints.Size;

@Data
public class FtbjobTrialRejectedDTO extends FtbPersonnelsJobTrialRejectedCreateDTO {

    /**
     * 试岗驳回原因
     */
    @Size(max = 500, message = "试岗驳回原因不能超过500个字符")
    private String reasonsForJobRejection;

    /**
     * 是否纳入黑名单，0不纳入，1纳入
     */
    private Integer whetherToBeIncluded;

    /**
     * 黑名单期限，0三个月，1六个月，2一年，3一年六个月，4两年，5三年，6五年，7永久
     */
    private Integer type;

    /**
     * 员工ID，页面显示
     */
    private String userSystemId;

    /**
     * 黑名单类型id
     */
    private String blackTypeId;

    /**
     * 纳入黑名单原因
     */
    @Size(max = 500, message = "纳入黑名单原因不能超过500个字符")
    private String reason;

    public static FtbPersonnelsBlacklistAddDTO convertBlacklistAddDto(FtbjobTrialRejectedDTO ftbjobTrialRejectedDTO) {
        if (ftbjobTrialRejectedDTO == null) {
            return null;
        }
        FtbPersonnelsBlacklistAddDTO ftbPersonnelsBlacklistAddDTO = new FtbPersonnelsBlacklistAddDTO();
        ftbPersonnelsBlacklistAddDTO.setType(ftbjobTrialRejectedDTO.getType());
        ftbPersonnelsBlacklistAddDTO.setUserSystemId(ftbjobTrialRejectedDTO.getUserSystemId());
        ftbPersonnelsBlacklistAddDTO.setBlackTypeId(ftbjobTrialRejectedDTO.getBlackTypeId());
        ftbPersonnelsBlacklistAddDTO.setReason(ftbjobTrialRejectedDTO.getReason());
        ftbPersonnelsBlacklistAddDTO.setUserId(ftbjobTrialRejectedDTO.getUserId());
        ftbPersonnelsBlacklistAddDTO.setUserName(ftbjobTrialRejectedDTO.getUserName());
        ftbPersonnelsBlacklistAddDTO.setOrgName(ftbjobTrialRejectedDTO.getOrgName());
        ftbPersonnelsBlacklistAddDTO.setPostName(ftbjobTrialRejectedDTO.getEntryPostName());
        ftbPersonnelsBlacklistAddDTO.setPhone(ftbjobTrialRejectedDTO.getPhoneNumber());
        return ftbPersonnelsBlacklistAddDTO;
    }

}
