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

import com.fasterxml.jackson.annotation.JsonFormat;
import jnpf.model.cultivate.po.task.FtbCultivateLearnTaskPhase;
import lombok.Data;

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

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

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


    /**
     * 学习任务主键id
     */
    private String taskId;

    /**
     * 证书颁发规则考试[1-合格，2-优秀]
     */
    private Integer certificateExam;

    /**
     * 证书颁发规则鉴定[1-合格，2-优秀]
     */
    private Integer certificateIdentification;

    /**
     * 考试合格后才能进行鉴定：[0-否，1-是]
     */
    private Integer qualified;

    /**
     * 是否考试合格鉴定合格练习完成才完成任务，1-是  0-否
     */
    private Integer isPassComplete;

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


    /**
     * 阶段状态(0未开始,1进行中,2已完成)
     */
    private Integer phaseStatus;

    public void convert(FtbCultivateLearnTaskPhase phase) {
        this.setId(phase.getId());
        this.setTaskId(phase.getTaskId());
        this.setCertificateExam(phase.getCertificateExam());
        this.setCertificateIdentification(phase.getCertificateIdentification());
        this.setQualified(phase.getQualified());
        this.setIsPassComplete(phase.getIsPassComplete());
        this.setCreateTime(phase.getCreatorTime());
    }
}
