package jnpf.model.cultivate.dto.position;

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

import javax.validation.constraints.NotBlank;

/**
 * 学习课程鉴定添加DTO
 *
 * @author fantaibao
 * @date 2023/12/28
 */
@Data
public class FtbStudyCourseIdentityAddDTO {
    /**
     * 课程主键ID
     */
    @NotBlank(message = "课程主键ID不能为空")
    private String courseId;

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

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

    /**
     * 实操鉴定主键id
     */
    @NotBlank(message = "实操鉴定主键id不能为空")
    private String identityId;

    public FtbCultivatePositionCourseIdentity convertFtbCultivatePositionCourseIdentity(FtbStudyCourseIdentityAddDTO ftbStudyCourseIdentityAddDTO) {
        if (ftbStudyCourseIdentityAddDTO == null) {
            return null;
        }
        FtbCultivatePositionCourseIdentity ftbCultivatePositionCourseIdentity = new FtbCultivatePositionCourseIdentity();
        ftbCultivatePositionCourseIdentity.setEnabledMark(0);
        ftbCultivatePositionCourseIdentity.setCourseId(ftbStudyCourseIdentityAddDTO.getCourseId());
        ftbCultivatePositionCourseIdentity.setPostRankId(ftbStudyCourseIdentityAddDTO.getPostRankId());
        ftbCultivatePositionCourseIdentity.setPostLearnId(ftbStudyCourseIdentityAddDTO.getPostLearnId());
        ftbCultivatePositionCourseIdentity.setIdentityId(ftbStudyCourseIdentityAddDTO.getIdentityId());
        return ftbCultivatePositionCourseIdentity;
    }

}
