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

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

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

/**
 * @Description: 实时监控台视频返回对象
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/8/22
 */
@ApiModel("监考明细管理列表返回对象")
public class InvigilateListHistoryBean implements Serializable {

    @ApiModelProperty(name = "序号")
    private Integer seq;

    @ApiModelProperty(name = "考试批次名称")
    @ExcelProperty(name = "批次", width = 30, index = 1)
    private String examName;

    @ApiModelProperty(name = "场次code")
    @ExcelProperty(name = "场次", width = 30, index = 2)
    private String examActivityCode;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "考试id")
    @ExcelProperty(name = "考试ID", width = 30, index = 4)
    private Long examId;

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

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "考生id")
    private Long examStudentId;

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

    @ApiModelProperty(name = "证件号")
    @ExcelProperty(name = "证件号", width = 30, index = 5)
    private String identity;

    @ApiModelProperty(name = "虚拟考场代码")
    private String roomCode;

    @ApiModelProperty(name = "虚拟考场名称")
    @ExcelProperty(name = "考场", width = 30, index = 3)
    private String roomName;

    @ApiModelProperty(name = "姓名")
    @ExcelProperty(name = "姓名", width = 30, index = 6)
    private String name;

    @ApiModelProperty(name = "班级")
    @ExcelProperty(name = "班级", width = 30, index = 7)
    private String classNo;

    @ApiModelProperty(name = "考生状态")
    @ExcelProperty(name = "状态", width = 30, index = 10)
    private String status;

    @ApiModelProperty(name = "考生状态值")
    private ExamRecordStatusEnum statusCode;

    @ApiModelProperty(name = "交卷原因")
    private FinishTypeEnum finishType;

    @ApiModelProperty(name = "交卷原因")
    @ExcelProperty(name = "交卷方式", width = 30, index = 11)
    private String finishTypeStr;

    @ApiModelProperty(name = "预警量")
    @ExcelProperty(name = "预警数", width = 30, index = 14)
    private Integer warningCount;

    @ApiModelProperty(name = "陌生人脸")
    @ExcelProperty(name = "陌生人脸", width = 30, index = 12)
    private Integer multipleFaceCount;

    @ApiModelProperty(name = "异常处理")
    @ExcelProperty(name = "异常处理", width = 30, index = 13)
    private Integer exceptionCount;

    @ApiModelProperty(name = "是否违纪")
    private Integer breachStatus;

    @ApiModelProperty(name = "是否违纪")
    @ExcelProperty(name = "违纪", width = 30, index = 15)
    private String breachStatusStr;

    @ApiModelProperty(name = "更新时间")
    private Long updateTime;

    @ApiModelProperty(name = "科目代码")
    @ExcelProperty(name = "科目代码", width = 30, index = 9)
    private String courseCode;

    @ApiModelProperty(name = "联系电话")
    @ExcelProperty(name = "联系电话", width = 30, index = 8)
    private String mobileNumber;

    public String getClassNo() {
        return classNo;
    }

    public void setClassNo(String classNo) {
        this.classNo = classNo;
    }

    public String getBreachStatusStr() {
        if (Objects.nonNull(breachStatus)) {
            return breachStatus.intValue() == 1 ? "正常" : "违纪";
        } else {
            return breachStatusStr;
        }
    }

    public void setBreachStatusStr(String breachStatusStr) {
        this.breachStatusStr = breachStatusStr;
    }

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

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

    public Integer getSeq() {
        return seq;
    }

    public void setSeq(Integer seq) {
        this.seq = seq;
    }

    public String getMobileNumber() {
        return mobileNumber;
    }

    public void setMobileNumber(String mobileNumber) {
        this.mobileNumber = mobileNumber;
    }

    public String getCourseCode() {
        return courseCode;
    }

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

    public String getExamName() {
        return examName;
    }

    public void setExamName(String examName) {
        this.examName = examName;
    }

    public String getExamActivityCode() {
        return examActivityCode;
    }

    public void setExamActivityCode(String examActivityCode) {
        this.examActivityCode = examActivityCode;
    }

    public FinishTypeEnum getFinishType() {
        return finishType;
    }

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

    public Integer getMultipleFaceCount() {
        return multipleFaceCount;
    }

    public void setMultipleFaceCount(Integer multipleFaceCount) {
        this.multipleFaceCount = multipleFaceCount;
    }

    public Integer getExceptionCount() {
        return exceptionCount;
    }

    public void setExceptionCount(Integer exceptionCount) {
        this.exceptionCount = exceptionCount;
    }

    public String getRoomName() {
        return roomName;
    }

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

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public Long getExamId() {
        return examId;
    }

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

    public Long getExamActivityId() {
        return examActivityId;
    }

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

    public Long getExamStudentId() {
        return examStudentId;
    }

    public void setExamStudentId(Long examStudentId) {
        this.examStudentId = examStudentId;
    }

    public Long getExamRecordId() {
        return examRecordId;
    }

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

    public String getIdentity() {
        return identity;
    }

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

    public String getRoomCode() {
        return roomCode;
    }

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

    public String getName() {
        return name;
    }

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

    public String getStatus() {
        if (statusCode != null) {
            return statusCode.getCode();
        }
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public ExamRecordStatusEnum getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(ExamRecordStatusEnum statusCode) {
        this.statusCode = statusCode;
    }

    public Integer getWarningCount() {
        return warningCount;
    }

    public void setWarningCount(Integer warningCount) {
        this.warningCount = warningCount;
    }

    public Integer getBreachStatus() {
        return breachStatus;
    }

    public void setBreachStatus(Integer breachStatus) {
        this.breachStatus = breachStatus;
    }
}