package jnpf.model.cultivate.v2.position.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import jnpf.model.cultivate.po.position.FtbCultivatePositionCourse;
import jnpf.model.cultivate.v2.enums.PositionBusinessSourceEnum;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
public class AppCultivatePositionCourseVo extends BusinessSourceVo implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private String id;

    /**
     * 课程主键ID
     */

    private String courseId;

    /**
     * 课程名称
     */
    private String courseName;
    /**
     * 课程显示id
     */
    private String courseIdShow;
    /**
     * 岗位ID
     */

    private String postRankId;

    /**
     * 职级ID
     */
    private String gradeId;

    /**
     * 岗位学习主键ID
     */

    private String postLearnId;

    /**
     * 是否必修，0必修，1选修
     */

    private Integer compulsory;


    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastModifyTime;


    /**
     * 学习状态 1已学习，0未学习,2学习中
     */
    private Integer learnState;
    /**
     * 学习进度
     */
    private String learnProgress;


    public void convert(FtbCultivatePositionCourseWithNameVo positionCourse) {
        this.setId(positionCourse.getId());
        this.setCourseId(positionCourse.getCourseId());
        this.setPostRankId(positionCourse.getPostRankId());
        this.setGradeId(positionCourse.getGradeId());
        this.setBusinessSource(PositionBusinessSourceEnum.POST_LEARNING);
        this.setPostLearnId(positionCourse.getPostLearnId());
        this.setBusinessSourceId(positionCourse.getPostLearnId());
        this.setCompulsory(positionCourse.getCompulsory());
    }


    /**
     * 岗位学习课程关联考试表
     */
    private List<AppCultivatePositionCourseExamVo> exam;
    /**
     * 岗位学习课程关联鉴定表
     */
    private List<AppCultivatePositionCourseIdentityVo> identity;

    /**
     * 岗位学习课程关联练习表
     */
    private List<AppCultivatePositionCoursePracticeVo> practiceList;

    private List<AppCultivatePositionCourseCertificateVo> certificate;
}