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

import com.fasterxml.jackson.annotation.JsonFormat;
import jnpf.model.cultivate.po.position.FtbCultivatePosition;
import jnpf.permission.vo.v2.grades.GradeVO;
import lombok.Data;

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

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

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

    /**
     * 岗位ID
     */
    private String postId;

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

    /**
     * 岗位编码
     */
    private String postEncode;

    /**
     * 是否配置到职级：[0-否，1-是]
     */
    private Integer isConfiguredToGrade;


    /**
     * 排序
     */
    private Long sortCode;

    /**
     * 备注
     */
    private String description;

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

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

    /**
     * 岗位学习课程列表
     */
    private List<FtbCultivatePositionCourseVo> ftbCultivatePositionCourseList;


    /**
     * 岗位关联的职级列表
     */
    private List<GradeVO> gradeVOList;

    private List<FtbCultivatePositionSettingVo> ftbCultivatePositionGradeList;


    public void convert(FtbCultivatePosition position) {
        this.setId(position.getId());
        this.setPostId(position.getPostId());
        this.setIsConfiguredToGrade(position.getIsConfiguredToGrade());
        this.setSortCode(position.getSortCode());
        this.setCreatorTime(position.getCreatorTime());
        this.setLastModifyTime(position.getLastModifyTime());
    }
}
