package jnpf.model.cultivate.dto.position;

import jnpf.model.cultivate.po.position.FtbCultivatePositionExam;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * 添加岗位学习考试
 *
 * @author fantaibao
 * @date 2023/12/17
 */
@Data
public class FtbCultivatePositionJobLearnExamDTO {
    /**
     * 考试主键ID
     */
    @NotBlank(message = "未选择岗位学习考试")
    private String examId;

    /**
     * 岗位学习主键ID
     */
    @NotBlank(message = "岗位学习主键ID不能为空")
    private String postLearnId;

    /**
     * 岗位主键ID
     */
    @NotBlank(message = "岗位主键ID不能为空")
    private String postRankId;

    public FtbCultivatePositionExam convertFtbCultivatePositionExam(FtbCultivatePositionJobLearnExamDTO ftbCultivatePositionJobLearnExamDTO) {
        if (ftbCultivatePositionJobLearnExamDTO == null) {
            return null;
        }
        FtbCultivatePositionExam ftbCultivatePositionExam = new FtbCultivatePositionExam();
        ftbCultivatePositionExam.setEnabledMark(0);
        ftbCultivatePositionExam.setExamId(ftbCultivatePositionJobLearnExamDTO.getExamId());
        ftbCultivatePositionExam.setPostLearnId(ftbCultivatePositionJobLearnExamDTO.getPostLearnId());
        ftbCultivatePositionExam.setPostRankId(ftbCultivatePositionJobLearnExamDTO.getPostRankId());
        return ftbCultivatePositionExam;
    }
}
