package com.ruoyi.course.domain.time;


import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.course.domain.res.RespClaTimeCalendar;
import lombok.Data;

/**
 * 单节排课信息
 */
@Data
public class ClaTimeCalendarItem {

    @JsonSerialize(using = ToStringSerializer.class)
    private Long courseTimeId;

    private String claName;

    private String courseName;
    private String courseTypeName;

    private String storeName;

    private String pic;

    // 日期
    private String claDate;

    // 星期
    private String weekDay;

    private String startTime;

    private String endTime;

    private String staffName;

    private int studentCount;

    // 教室
    private String roomName;

    private String claColor;
    private Integer fontSize;
    private String fontColor;

    // 上课状态
    private String claTimeStatus;

    /**
     * 预约人数
     */
    private Integer bookAttendCnt;

    /**
     * 限制最高人数
     */
    private Integer atClassCnt;

    /**
     * 最低开课人数
     */
    private Integer lessCnt;
    private Integer star;


    private String remark;

    public ClaTimeCalendarItem transfer(RespClaTimeCalendar respClaTime) {
        this.courseTimeId = respClaTime.getCourseTimeId();
        this.claName = respClaTime.getClaName();
        this.courseName = respClaTime.getCourseName();
        this.pic = respClaTime.getPic();
        this.claDate = respClaTime.getClaDate();
        this.weekDay = Constants.WEEK_DAY_MAP.get(respClaTime.getWeekDay());
        this.startTime = respClaTime.getStartTime().substring(0,5);
        this.endTime = respClaTime.getEndTime().substring(0,5);
        this.staffName = respClaTime.getStaffName();
//        this.studentCount = respClaTime.getStudentCount();
        this.roomName = respClaTime.getRoomName();
        this.claColor = respClaTime.getClaColor();
        this.fontSize = respClaTime.getFontSize();
        this.fontColor = respClaTime.getFontColor();
        this.claTimeStatus = respClaTime.getStatus();
        this.star=respClaTime.getStar();
        return this;
    }

}
