package jnpf.model.cultivate.vo.learn;

import jnpf.model.cultivate.po.learn.FtbCultivateLearnTask;
import lombok.Data;

import java.util.Date;

/**
 * @Author: peng.hao
 * @create: 2024/9/9:17:08
 */
@Data
public class FtbCultivateLearnTaskInfoForAppVO {

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

    /** 任务分类主键id */
    private String taskClass;

    /** 任务分类主键id */
    private String taskClassName;

    /** 任务名称 */
    private String taskName;

    /**
     * 任务状态整体状态  (0未发布,1未开始,2进行中,3已结束)
     */
    private Integer taskStats;

    /**
     * 任务状态（对用户）  0未开始，1进行中，2已完成，3已逾期
     */
    private Integer studyStats;

    /** 任务类型(0,长期,1限时) */
    private Integer taskType;

    /** 任务限时开始时间 */
    private Date timeLimitStartTime;

    /** 任务限时结束时间 */
    private Date timeLimitEndTime;

    /** 学员限时完成单位(0,天,1,小时) */
    private Integer timeCompletionUnit;

    /** 学员限时完成(0,限时,1不限时) */
    private Integer studentTimeCompletion;

    /** 限时完成天数(上线365天) */
    private Integer timeCompletionDays;

    public static FtbCultivateLearnTaskInfoForAppVO convert(FtbCultivateLearnTask info) {
        if (info == null) {
            return null;
        }
        FtbCultivateLearnTaskInfoForAppVO ftbCultivateLearnTaskInfoForAppVO = new FtbCultivateLearnTaskInfoForAppVO();
        ftbCultivateLearnTaskInfoForAppVO.setTaskClass(info.getTaskClass());
        ftbCultivateLearnTaskInfoForAppVO.setTaskName(info.getTaskName());
        ftbCultivateLearnTaskInfoForAppVO.setTaskType(info.getTaskType());
        ftbCultivateLearnTaskInfoForAppVO.setTimeLimitStartTime(info.getTimeLimitStartTime());
        ftbCultivateLearnTaskInfoForAppVO.setTimeLimitEndTime(info.getTimeLimitEndTime());
        ftbCultivateLearnTaskInfoForAppVO.setStudentTimeCompletion(info.getStudentTimeCompletion());
        ftbCultivateLearnTaskInfoForAppVO.setTimeCompletionUnit(info.getTimeCompletionUnit());
        ftbCultivateLearnTaskInfoForAppVO.setTimeCompletionDays(info.getTimeCompletionDays());
        ftbCultivateLearnTaskInfoForAppVO.setId(info.getId());
        ftbCultivateLearnTaskInfoForAppVO.setTaskStats(info.getStatus());
        return ftbCultivateLearnTaskInfoForAppVO;
    }

}
