package com.ssj.service.conch.schoolmaster.v1.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.StringUtils;

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

public class LessonGroupDTO implements Serializable {

    private static final long serialVersionUID = 6696565248337154250L;

    private String lessonGroupId;//小组id
    private String teacherName;//授课老师姓名
    private String teacherImg;//授课老师头像
    private Integer currentCount;//当前学习课次
    private Integer courseCount;//总学习课次
    private Integer planStatus;//计划状态 1上课意向确认，2讲义生成，3上课，4反馈
    @JsonFormat(pattern = "MM-dd HH:mm", timezone = "GMT+8")
    private Date courseConfirmTime;//上课意向确认时间
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    private Date courseCallTime;//上课时间
    @JsonFormat(pattern = "HH:mm", timezone = "GMT+8")
    private Date courseFeedbackTime;//反馈时间
    private Integer studentCount;//学生个数
    private String courseName;//科目
    private String grade;//年级

    @JSONField(serialize=false)
    private String courseDate;//授课时间  格式2018-11-08 09:00:00,2018-11-09 09:00:00
    @JSONField(serialize=false)
    private String startTime;//开始时间
    @JSONField(serialize=false)
    private String endTime;//结束时间

    private String courseTime;//  当前课次课程上课时间  ，如:2018-12-13 14:00—16:00
    private String address;//上课地址

    public String getLessonGroupId() {
        return lessonGroupId;
    }

    public void setLessonGroupId(String lessonGroupId) {
        this.lessonGroupId = lessonGroupId;
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public String getTeacherImg() {
        return teacherImg;
    }

    public void setTeacherImg(String teacherImg) {
        this.teacherImg = teacherImg;
    }

    public Integer getCurrentCount() {
        return currentCount;
    }

    public void setCurrentCount(Integer currentCount) {
        this.currentCount = currentCount;
    }

    public Integer getCourseCount() {
        return courseCount;
    }

    public void setCourseCount(Integer courseCount) {
        this.courseCount = courseCount;
    }

    public Integer getPlanStatus() {
        return planStatus;
    }

    public void setPlanStatus(Integer planStatus) {
        this.planStatus = planStatus;
    }

    public Date getCourseConfirmTime() {
        return courseConfirmTime;
    }

    public void setCourseConfirmTime(Date courseConfirmTime) {
        this.courseConfirmTime = courseConfirmTime;
    }

    public Date getCourseCallTime() {
        return courseCallTime;
    }

    public void setCourseCallTime(Date courseCallTime) {
        this.courseCallTime = courseCallTime;
    }

    public Date getCourseFeedbackTime() {
        return courseFeedbackTime;
    }

    public void setCourseFeedbackTime(Date courseFeedbackTime) {
        this.courseFeedbackTime = courseFeedbackTime;
    }

    public Integer getStudentCount() {
        return studentCount;
    }

    public void setStudentCount(Integer studentCount) {
        this.studentCount = studentCount;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public String getCourseDate() {
        return courseDate;
    }

    public void setCourseDate(String courseDate) {
        this.courseDate = courseDate;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getCourseTime() {

        if (StringUtils.isBlank(courseTime)) {
            if (courseDate == null || startTime == null || endTime == null) {
                this.courseTime = "";
            } else {
                String[] split = courseDate.split(",");
                this.courseTime = split[currentCount - 1].substring(0, 16) + "—" + endTime;
            }
        }
        return courseTime;
    }

    public void setCourseTime(String courseTime) {
        this.courseTime = courseTime;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
