package com.qmth.distributed.print.business.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.distributed.print.business.enums.DataSourceEnum;
import com.qmth.teachcloud.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * <p>
 * 命题统计临时表
 * </p>
 *
 * @author wangliang
 * @since 2021-09-09
 */
@ApiModel(value = "TCStatisticsTemp对象", description = "命题统计临时表")
public class TCStatisticsTemp extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "考试id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long examId;

    @ApiModelProperty(value = "开课学院id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long collegeId;

    @ApiModelProperty(value = "开课学院名称")
    private String collegeName;

    @ApiModelProperty(value = "开课部门id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long teachingRoomId;

    @ApiModelProperty(value = "开课部门名称")
    private String teachingRoomName;

    @ApiModelProperty(value = "课程名称")
    private String courseName;

    @ApiModelProperty(value = "课程代码")
    private String courseCode;

    @ApiModelProperty(value = "任课老师名称")
    private String teacherName;

    @ApiModelProperty(value = "班级id")
    @JsonSerialize(using = ToStringSerializer.class)
    private String clazzIds;

    @ApiModelProperty(value = "班级名称")
    private String clazzName;

    @ApiModelProperty(value = "试卷编号")
    private String paperNumber;

    @ApiModelProperty(value = "印刷计划id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long printPlanId;

    @ApiModelProperty(name = "考务数据明细id")
    @JsonSerialize(using = ToStringSerializer.class)
    Long examDetailCourseId;

    @ApiModelProperty(name = "命题任务明细id")
    @JsonSerialize(using = ToStringSerializer.class)
    Long examTaskDetailId;

    @ApiModelProperty(value = "批次号")
    private String batchNo;

    @ApiModelProperty(value = "数据来源")
    DataSourceEnum dataSource;

    @ApiModelProperty(name = "命题明细id")
    @JsonSerialize(using = ToStringSerializer.class)
    Long examDetailId;

    public TCStatisticsTemp() {

    }

    public TCStatisticsTemp(Long examId,
                            Long collegeId,
                            String collegeName,
                            Long teachingRoomId,
                            String teachingRoomName,
                            String courseName,
                            String courseCode,
                            String teacherName,
                            String clazzIds,
                            String clazzName,
                            String batchNo,
                            Long userId) {
        insertInfo(userId);
        this.examId = examId;
        this.collegeId = collegeId;
        this.collegeName = collegeName;
        this.teachingRoomId = teachingRoomId;
        this.teachingRoomName = teachingRoomName;
        this.courseName = courseName;
        this.courseCode = courseCode;
        this.teacherName = teacherName;
        this.clazzIds = clazzIds;
        this.clazzName = clazzName;
        this.batchNo = batchNo;
        this.dataSource = DataSourceEnum.IMPORT;
    }

    public TCStatisticsTemp(Long collegeId,
                            String collegeName,
                            Long teachingRoomId,
                            String teachingRoomName,
                            String courseName,
                            String courseCode,
                            String teacherName,
                            String clazzIds,
                            String clazzName,
                            String batchNo,
                            String paperNumber,
                            Long printPlanId,
                            Long examDetailCourseId,
                            Long examTaskDetailId,
                            Long userId) {
        insertInfo(userId);
        this.collegeId = collegeId;
        this.collegeName = collegeName;
        this.teachingRoomId = teachingRoomId;
        this.teachingRoomName = teachingRoomName;
        this.courseName = courseName;
        this.courseCode = courseCode;
        this.teacherName = teacherName;
        this.clazzIds = clazzIds;
        this.clazzName = clazzName;
        this.batchNo = batchNo;
        this.paperNumber = paperNumber;
        this.printPlanId = printPlanId;
        this.examDetailCourseId = examDetailCourseId;
        this.examTaskDetailId = examTaskDetailId;
    }

    public void updateInfo(Long userId, TCStatisticsTemp t) {
        this.paperNumber = t.getPaperNumber();
        this.printPlanId = t.getPrintPlanId();
        this.examDetailCourseId = t.getExamDetailCourseId();
        this.examTaskDetailId = t.getExamTaskDetailId();
        updateInfo(userId);
    }

    public Long getExamId() {
        return examId;
    }

    public void setExamId(Long examId) {
        this.examId = examId;
    }

    public Long getExamDetailId() {
        return examDetailId;
    }

    public void setExamDetailId(Long examDetailId) {
        this.examDetailId = examDetailId;
    }

    public DataSourceEnum getDataSource() {
        return dataSource;
    }

    public void setDataSource(DataSourceEnum dataSource) {
        this.dataSource = dataSource;
    }

    public Long getCollegeId() {
        return collegeId;
    }

    public void setCollegeId(Long collegeId) {
        this.collegeId = collegeId;
    }

    public String getCollegeName() {
        return collegeName;
    }

    public void setCollegeName(String collegeName) {
        this.collegeName = collegeName;
    }

    public Long getTeachingRoomId() {
        return teachingRoomId;
    }

    public void setTeachingRoomId(Long teachingRoomId) {
        this.teachingRoomId = teachingRoomId;
    }

    public String getTeachingRoomName() {
        return teachingRoomName;
    }

    public void setTeachingRoomName(String teachingRoomName) {
        this.teachingRoomName = teachingRoomName;
    }

    public String getCourseName() {
        return courseName;
    }

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

    public String getClazzName() {
        return clazzName;
    }

    public void setClazzName(String clazzName) {
        this.clazzName = clazzName;
    }

    public Long getExamDetailCourseId() {
        return examDetailCourseId;
    }

    public void setExamDetailCourseId(Long examDetailCourseId) {
        this.examDetailCourseId = examDetailCourseId;
    }

    public Long getExamTaskDetailId() {
        return examTaskDetailId;
    }

    public void setExamTaskDetailId(Long examTaskDetailId) {
        this.examTaskDetailId = examTaskDetailId;
    }

    public String getBatchNo() {
        return batchNo;
    }

    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getCourseCode() {
        return courseCode;
    }

    public void setCourseCode(String courseCode) {
        this.courseCode = courseCode;
    }

    public String getTeacherName() {
        return teacherName;
    }

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

    public String getClazzIds() {
        return clazzIds;
    }

    public void setClazzIds(String clazzIds) {
        this.clazzIds = clazzIds;
    }

    public String getPaperNumber() {
        return paperNumber;
    }

    public void setPaperNumber(String paperNumber) {
        this.paperNumber = paperNumber;
    }

    public Long getPrintPlanId() {
        return printPlanId;
    }

    public void setPrintPlanId(Long printPlanId) {
        this.printPlanId = printPlanId;
    }
}
