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

import com.alibaba.fastjson.annotation.JSONField;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class LessonGroupDetailDTO implements Serializable {

    private static final long serialVersionUID = -6263832288008879948L;

    private List<String> courseTimeList;
    private String courseTime;
    private String startTime;
    private String endTime;
    private String teacherName;
    private String courseName;
    private String grade;
    private Integer courseCount;
    private Integer studentCount;
    private BigDecimal coursePrice;
    private BigDecimal courseSumPrice;
    public List<String> getCourseTimeList() {
    	if(courseTimeList!=null&& courseTimeList.size()>0){
			return courseTimeList;
		}
    	 if (courseTime == null) {
             return Collections.emptyList();
         } else {
             return Arrays.asList(courseTime.split(","));
         }
	}

	public void setCourseTimeList(List<String> courseTimeList) {
		this.courseTimeList = courseTimeList;
	}
	@JSONField(serialize=false)
	public String getCourseTime() {
		return courseTime;
	}

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

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

    public String getStartTime() {
        return startTime;
    }

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

    public String getEndTime() {
        return endTime;
    }

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

    public String getTeacherName() {
        return teacherName;
    }

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

    public String getCourseName() {
        return courseName;
    }

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

    public String getGrade() {
        return grade;
    }

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

    public Integer getCourseCount() {
        return courseCount;
    }

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

    public Integer getStudentCount() {
        return studentCount;
    }

    public void setCoursePrice(BigDecimal coursePrice) {
        this.coursePrice = coursePrice;
    }

    public BigDecimal getCoursePrice() {
        return coursePrice;
    }

    public void setCourseSumPrice(BigDecimal courseSumPrice) {
        this.courseSumPrice = courseSumPrice;
    }

    public BigDecimal getCourseSumPrice() {
        if (courseSumPrice == null) {
            setCourseSumPrice(coursePrice.multiply(new BigDecimal(courseCount)).multiply(new BigDecimal(studentCount)));
        }
        return courseSumPrice;
    }

}
