package jnpf.model.cultivate.dto.promotion;

import jnpf.model.cultivate.po.promotion.FtbCultivatePromotionNew;
import jnpf.model.cultivate.vo.promotion.FtbCultivatePromotionPostNewVO;
import lombok.Data;

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

/**
 * @Title: FtbCultivatePromotionCreatDto 
 * @Author: peng.hao
 * @create: 2023/12/1713:38
 */
@Data
public class FtbCultivatePromotionCreatNewDto {
    /**
     * 学习地图主键id
     */
    private String id;

    /**
     * 学习地图名称
     */
    @NotNull(message = "学习地图名称不能为空")
    @Size(max = 50, message = "学习地图名称不能超过50个字符")
    private String promotion;


    /**
     *  学习地图设置(1是,0否)
     * 岗位考试与岗位实操鉴定合格后才能进入下一阶段 (v1.2)
     */
    private Integer learningMapSetting;


    /**
     * 学习地图ID，生成规则见原型
     */
    private String promotionBusinessId;


    /**
     *修改后重新选学(1是,0否)
     */
    private Integer revise;


    /**
     * 通道分级岗位
     */
    private List<FtbCultivatePromotionPostNewVO> postChannelLevel;


    public static FtbCultivatePromotionNew  coverFtbCultivatePromotionCreatDto(FtbCultivatePromotionCreatNewDto creatDto) {
        if (creatDto == null) {
            return null;
        }
        FtbCultivatePromotionNew ftbCultivatePromotion = new FtbCultivatePromotionNew();
        ftbCultivatePromotion.setId(creatDto.getId());
        ftbCultivatePromotion.setPromotion(creatDto.getPromotion());
        ftbCultivatePromotion.setLearningMapSetting(creatDto.getLearningMapSetting());
        ftbCultivatePromotion.setPromotionBusinessId(creatDto.getPromotionBusinessId());
        return ftbCultivatePromotion;
    }
}
