package jnpf.model.cultivate.vo.learn;

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

import java.util.Date;
import java.util.List;

/**
 * 学习任务信息
 * @Author: peng.hao
 * @create: 2024/9/9:13:58
 */
@Data
public class FtbCultivateLearnTaskInfoVO {

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

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

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

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

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

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

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

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

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

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

    /** 任务状态(0未发布,1未开始,2进行中,3已完成) */
    private Integer status;

    /** 任务分配规则(1,指定成员,2指定组织,3指定岗位,4自定义) */
    private Integer assignmentRule;

    /** 任务分配规则关联id(逗号分割) */
    private String associationIds;

    /** 自定义员工入职(期限开始天数) */
    private Integer startEntryPeriod;

    /** 自定义员工入职(期限结束天数) */
    private Integer endEntryPeriod;

    /***************************************任务分配***********************************************/
    /**任务分配用户id集合*/
    private List<String> userIds;

    /**************************************提醒规则************************************************/
    /** 任务开始提醒(0否,1是) */
    private Integer taskStartReminder;

    /** 任务结束提醒(0否,1是) */
    private Integer taskEndReminder;

    /** 任务结束提醒单位(0天,1小时) */
    private Integer taskEndReminderType;

    /** 提醒任务结束前 */
    private Integer beforeDeadline;

    /** 提醒每间隔时间 */
    private Integer perInterval;

    /**课程列表***/
    private List<FtbCultivateLearnTaskCourseInfoVO> courseList;

    /***考试***/
    private FtbCultivateLearnTaskExamInfoVO examList;

    /***鉴定***/
    private FtbCultivateLearnTaskIdentificationInfoVO identificationList;

    /***证书***/
    private FtbCultivateLearnTaskCertificateInfoVO certificateList;
    /**
     * 分类级联list
     */
    List<FtbCultivateLearnCategories> allCategoryList;

    /** 是否合格才完成任务，1-是  0-否 */
    private Integer isPassComplete;


    public static FtbCultivateLearnTaskInfoVO convert(FtbCultivateLearnTask info) {
        if (info == null) {
            return null;
        }
        FtbCultivateLearnTaskInfoVO ftbCultivateLearnTaskInfoVO = new FtbCultivateLearnTaskInfoVO();
        ftbCultivateLearnTaskInfoVO.setTaskClass(info.getTaskClass());
        ftbCultivateLearnTaskInfoVO.setTaskName(info.getTaskName());
        ftbCultivateLearnTaskInfoVO.setTaskType(info.getTaskType());
        ftbCultivateLearnTaskInfoVO.setTimeLimitStartTime(info.getTimeLimitStartTime());
        ftbCultivateLearnTaskInfoVO.setTimeLimitEndTime(info.getTimeLimitEndTime());
        ftbCultivateLearnTaskInfoVO.setStudentTimeCompletion(info.getStudentTimeCompletion());
        ftbCultivateLearnTaskInfoVO.setTimeCompletionUnit(info.getTimeCompletionUnit());
        ftbCultivateLearnTaskInfoVO.setTimeCompletionDays(info.getTimeCompletionDays());
        ftbCultivateLearnTaskInfoVO.setStatus(info.getStatus());
        ftbCultivateLearnTaskInfoVO.setAssignmentRule(info.getAssignmentRule());
        ftbCultivateLearnTaskInfoVO.setAssociationIds(info.getAssociationIds());
        ftbCultivateLearnTaskInfoVO.setStartEntryPeriod(info.getStartEntryPeriod());
        ftbCultivateLearnTaskInfoVO.setEndEntryPeriod(info.getEndEntryPeriod());
        ftbCultivateLearnTaskInfoVO.setId(info.getId());
        ftbCultivateLearnTaskInfoVO.setIsPassComplete(info.getIsPassComplete());
        return ftbCultivateLearnTaskInfoVO;
    }
}
