package com.qmth.themis.business.cache.bean;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qmth.themis.business.enums.FinishTypeEnum;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.Objects;

/**
 * @Description: 考试明细bean
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2022/4/26
 */
public class ExamRecordDetailBean implements Serializable {

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

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

    @ApiModelProperty(value = "考试名称")
    private String name;

    @ApiModelProperty(value = "考场编码")
    private String code;

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

    @ApiModelProperty(value = "考生名称")
    private String examStudentName;

    @ApiModelProperty(value = "考生身份证")
    private String identity;

    @ApiModelProperty(value = "科目编码")
    private String courseCode;

    @ApiModelProperty(value = "科目名称")
    private String courseName;

    @ApiModelProperty(value = "考场编码")
    private String roomCode;

    @ApiModelProperty(value = "考场名称")
    private String roomName;

    @ApiModelProperty(value = "进入考试时间")
    private Long firstStartTime;

    @ApiModelProperty(value = "结束考试时间")
    private Long finishTime;

    @ApiModelProperty(value = "交卷方式")
    private FinishTypeEnum finishType;

    @ApiModelProperty(value = "交卷方式")
    private String finishTypeStr;

    public Long getExamRecordId() {
        return examRecordId;
    }

    public void setExamRecordId(Long examRecordId) {
        this.examRecordId = examRecordId;
    }

    public Long getExamId() {
        return examId;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Long getExamActivityId() {
        return examActivityId;
    }

    public void setExamActivityId(Long examActivityId) {
        this.examActivityId = examActivityId;
    }

    public String getExamStudentName() {
        return examStudentName;
    }

    public void setExamStudentName(String examStudentName) {
        this.examStudentName = examStudentName;
    }

    public String getIdentity() {
        return identity;
    }

    public void setIdentity(String identity) {
        this.identity = identity;
    }

    public String getCourseCode() {
        return courseCode;
    }

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

    public String getCourseName() {
        return courseName;
    }

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

    public String getRoomCode() {
        return roomCode;
    }

    public void setRoomCode(String roomCode) {
        this.roomCode = roomCode;
    }

    public String getRoomName() {
        return roomName;
    }

    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    public Long getFirstStartTime() {
        return firstStartTime;
    }

    public void setFirstStartTime(Long firstStartTime) {
        this.firstStartTime = firstStartTime;
    }

    public Long getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(Long finishTime) {
        this.finishTime = finishTime;
    }

    public FinishTypeEnum getFinishType() {
        return finishType;
    }

    public void setFinishType(FinishTypeEnum finishType) {
        this.finishType = finishType;
    }

    public String getFinishTypeStr() {
        if (Objects.nonNull(finishType)) {
            return finishType.getCode();
        } else {
            return finishTypeStr;
        }
    }

    public void setFinishTypeStr(String finishTypeStr) {
        this.finishTypeStr = finishTypeStr;
    }
}
