package com.ym.mec.biz.dal.dto;

import com.ym.mec.biz.dal.enums.CourseStatusEnum;
import com.ym.mec.biz.dal.enums.GroupType;
import com.ym.mec.biz.dal.enums.TeachModeEnum;
import com.ym.mec.util.date.DateUtil;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

/**
 * @Author Joburgess
 * @Date 2019/12/19
 */
public class StudentCourseInfoDto {

    private Long id;

    private GroupType groupType;

    /**  */
    @ApiModelProperty(value = "乐团编号")
    private String musicGroupId;

    /** 班级编号 */
    @ApiModelProperty(value = "班级编号")
    private Integer classGroupId;

    /** 课程状态 */
    @ApiModelProperty(value = "课程状态")
    private CourseStatusEnum status;

    /** 上课日期 */
    @ApiModelProperty(value = "上课日期")
    private java.util.Date classDate;

    /** 上课时间 */
    @ApiModelProperty(value = "上课时间")
    private java.util.Date startClassTime;

    /** 结束时间 */
    @ApiModelProperty(value = "结束时间")
    private java.util.Date endClassTime;

    /** 实际上课教师 */
    @ApiModelProperty(value = "实际上课教师")
    private Integer actualTeacherId;

    private TeachModeEnum teachMode;

    @ApiModelProperty(value = "预计课酬")
    private BigDecimal expectPrice;

    public StudentCourseInfoDto(String classDate, String startClassTime, String endClassTime) {
        this.classDate = DateUtil.stringToDate(classDate, DateUtil.DEFAULT_PATTERN);
        if (Objects.nonNull(this.classDate) && !StringUtils.isBlank(startClassTime)) {
            startClassTime = classDate + " " + startClassTime;
            this.startClassTime = DateUtil.stringToDate(startClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
        }
        if (Objects.nonNull(this.classDate) && !StringUtils.isBlank(endClassTime)) {
            endClassTime = classDate + " " + endClassTime;
            this.endClassTime = DateUtil.stringToDate(endClassTime, DateUtil.EXPANDED_DATE_TIME_FORMAT);
        }
    }

    public StudentCourseInfoDto() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public GroupType getGroupType() {
        return groupType;
    }

    public void setGroupType(GroupType groupType) {
        this.groupType = groupType;
    }

    public String getMusicGroupId() {
        return musicGroupId;
    }

    public void setMusicGroupId(String musicGroupId) {
        this.musicGroupId = musicGroupId;
    }

    public Integer getClassGroupId() {
        return classGroupId;
    }

    public void setClassGroupId(Integer classGroupId) {
        this.classGroupId = classGroupId;
    }

    public CourseStatusEnum getStatus() {
        return status;
    }

    public void setStatus(CourseStatusEnum status) {
        this.status = status;
    }

    public Date getClassDate() {
        return classDate;
    }

    public void setClassDate(Date classDate) {
        this.classDate = classDate;
    }

    public Date getStartClassTime() {
        return startClassTime;
    }

    public void setStartClassTime(Date startClassTime) {
        this.startClassTime = startClassTime;
    }

    public Date getEndClassTime() {
        return endClassTime;
    }

    public void setEndClassTime(Date endClassTime) {
        this.endClassTime = endClassTime;
    }

    public Integer getActualTeacherId() {
        return actualTeacherId;
    }

    public void setActualTeacherId(Integer actualTeacherId) {
        this.actualTeacherId = actualTeacherId;
    }

    public TeachModeEnum getTeachMode() {
        return teachMode;
    }

    public void setTeachMode(TeachModeEnum teachMode) {
        this.teachMode = teachMode;
    }

    public BigDecimal getExpectPrice() {
        return expectPrice;
    }

    public void setExpectPrice(BigDecimal expectPrice) {
        this.expectPrice = expectPrice;
    }
}
