package jnpf.model.cultivate.v2.course.vo.app;

import com.fasterxml.jackson.annotation.JsonFormat;
import jnpf.model.cultivate.v2.enums.PositionBusinessSourceEnum;
import jnpf.model.cultivate.v2.position.vo.BusinessSourceVo;
import jnpf.model.cultivate.v2.task.vo.FtbCultivateLearnTaskIdentificationVo;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

@EqualsAndHashCode(callSuper = true)
@Data
public class AppCultivateCourseIdentityVo extends BusinessSourceVo implements Serializable {
    private static final long serialVersionUID = 1L;

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

    /**
     * 实操鉴定主键id
     */
    private String identityId;
    /**
     * 实操鉴定表名称
     */
    private String identityName;

    /**
     * 创建时间
     */
    @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;

    /**
     * 是否可鉴定 0-不可以 1-可以
     */
    private Integer isCanIdentification;

    /**
     * 鉴定状态(0待鉴定，1已鉴定，2逾期未鉴定)
     */
    private Integer identificationStatus;

    /**
     * 鉴定结果 (0合格，1优秀，2不合格)
     */
    private Integer identificationResult;

    /**
     * 鉴定分数
     */
    private BigDecimal identificationScore;

    /**
     * 用户的鉴定记录id
     */
    private String userIdentityId;
    /**
     * 鉴定完成时间
     */
    private Date identityCompleteTime;

    /**
     * 鉴定封面
     */
    private String coverUrl;

    /**
     * 用时(单位分钟)
     */
    private Integer useTime;

    public void convert(FtbCultivateLearnTaskIdentificationVo identificationEntity) {
        this.setId(identificationEntity.getId());
        this.setIdentityId(identificationEntity.getIdentificationId());
        this.setBusinessSourceId(identificationEntity.getTaskId());
        this.setBusinessSource(PositionBusinessSourceEnum.TASK_LEARNING);
    }
}
