package jnpf.model.cultivate.vo.learn;

import com.baomidou.mybatisplus.core.toolkit.StringPool;
import jnpf.model.cultivate.dto.learn.FtbCultivateLearnTaskCertificateInfoDto;
import jnpf.model.cultivate.dto.learn.FtbCultivateLearnTaskCourseInfoDto;
import jnpf.model.cultivate.dto.learn.FtbCultivateLearnTaskExamInfoDto;
import jnpf.model.cultivate.dto.learn.FtbCultivateLearnTaskIdentificationInfoDto;
import jnpf.model.cultivate.po.learn.FtbCultivateLearnTask;
import lombok.Data;

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

@Data
public class FtbLearnQueryTaskDetailsEditingVO {
    /**
     * 主键id
     */
    private String id;

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

    /**
     * 任务名称
     */
    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天,23小时)
     */
    private Integer timeCompletionDays;

    /**
     * 任务分配规则(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;

    /**
     * 每天定时发送消息时间,HH:MM格式
     */
    private String perInterval;

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

    /***考试***/
    private FtbCultivateLearnTaskExamInfoDto examList;

    /***鉴定***/
    private FtbCultivateLearnTaskIdentificationInfoDto identificationList;

    /***证书***/
    private FtbCultivateLearnTaskCertificateInfoDto certificateList;

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

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

}
