package jnpf.model.cultivate.dto.apply;

import jnpf.model.cultivate.dto.offline.FtbCultivateOfflineFileDTO;
import jnpf.model.cultivate.po.apply.FtbCultivatePromotionPostApply;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @Title: FtbCultivatePromotionPostApplyCreateDto
 * @Author: peng.hao
 * @create: 2023/12/2515:50
 */
@Data
public class FtbCultivatePromotionPostApplyCreateDto {


    /**
     * 当前岗位id
     */
    @NotNull(message = "当前岗位id,不能为空")
    private String postId;

    /**
     * 当前岗位名称
     */
    private String postName;

    /**
     * 用户id
     */
    @NotNull(message = "用户id,不能为空")
    private String userId;
    /**
     * 用户名词
     */
    private String userName;

    /**
     * 晋升原因
     */
    private String promotionReason;

    /**
     * 审批人id
     */
    private String reviewUserId;

    /**
     * 当前岗位职等id
     */
    private String postRankId;

    /**
     * 当前岗位职等名称
     */
    private String postRankName;
    /**
     * 晋升岗位id
     */
    @NotNull(message = "晋升岗位id,不能为空")
    private String postPromotionId;

    /**
     * 晋升岗位名称
     */
    private String postPromotionName;


    /**
     * 晋升岗位职等id
     */
    @NotNull(message = "晋升岗位职等id,不能为空")
    private String postRankPromotionId;
    /**
     * 晋升岗位职等名称
     */
    private String postRankPromotionName;

    /**
     * 组织主键id
     */
    @NotNull(message = "组织主键id,不能为空")
    private String orgId;

    /**
     * 组织主键名称
     */
    private String orgName;

    /**
     * 当前晋升组织主键id
     */
    @NotNull(message = "当前晋升组织主键id,不能为空")
    private String orgCurrentId;

    /**
     * 组织主键名称
     */
    private String orgCurrentName;
    /**
     * 附件信息上限3个
     */
    @Size(max = 3, message = "附件信息上限3个")
    @Valid
    private List<FtbCultivateOfflineFileDTO> files;


    private Integer source;


    public static FtbCultivatePromotionPostApply coverFtbCultivatePromotionPostApplyCreateDto(FtbCultivatePromotionPostApplyCreateDto dto) {
        if (dto == null) {
            return null;
        }
        FtbCultivatePromotionPostApply ftbCultivatePromotionPostApply = new FtbCultivatePromotionPostApply();
        ftbCultivatePromotionPostApply.setPostId(dto.getPostId());
        ftbCultivatePromotionPostApply.setPostName(dto.getPostName());
        ftbCultivatePromotionPostApply.setUserId(dto.getUserId());
        ftbCultivatePromotionPostApply.setUserName(dto.getUserName());
        ftbCultivatePromotionPostApply.setPromotionReason(dto.getPromotionReason());
        ftbCultivatePromotionPostApply.setReviewUserId(dto.getReviewUserId());
        ftbCultivatePromotionPostApply.setPostRankId(dto.getPostRankId());
        ftbCultivatePromotionPostApply.setPostRankName(dto.getPostRankName());
        ftbCultivatePromotionPostApply.setPostPromotionId(dto.getPostPromotionId());
        ftbCultivatePromotionPostApply.setPostPromotionName(dto.getPostPromotionName());
        ftbCultivatePromotionPostApply.setPostRankPromotionId(dto.getPostRankPromotionId());
        ftbCultivatePromotionPostApply.setPostRankPromotionName(dto.getPostRankPromotionName());
        ftbCultivatePromotionPostApply.setOrgId(dto.getOrgId());
        ftbCultivatePromotionPostApply.setOrgName(dto.getOrgName());
        ftbCultivatePromotionPostApply.setOrgCurrentId(dto.getOrgCurrentId());
        ftbCultivatePromotionPostApply.setOrgCurrentName(dto.getOrgCurrentName());
        ftbCultivatePromotionPostApply.setSource(dto.getSource());
        return ftbCultivatePromotionPostApply;
    }

}
