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.MonitorStatusSourceEnum;
import com.qmth.themis.business.enums.WebsocketStatusEnum;
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 InvigilateListVideoBean implements Serializable {

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

    @ApiModelProperty(name = "考试批次名称")
    private String examName;

    @ApiModelProperty(name = "场次code")
    private String examActivityCode;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(name = "考试id")
    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 = "证件号")
    private String identity;

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

    @ApiModelProperty(name = "虚拟考场名称")
    private String roomName;

    @ApiModelProperty(name = "姓名")
    private String name;

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

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

    @ApiModelProperty(name = "试题下载状态")
    private Integer paperDownload;

    @ApiModelProperty(name = "考生状态")
    private String status;

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

    @ApiModelProperty(name = "答题进度")
    private Double progress;

    @ApiModelProperty(name = "预警量")
    private Integer warningCount;

    @ApiModelProperty(name = "客户端网络通信状态")
    private WebsocketStatusEnum clientWebsocketStatus;

    @ApiModelProperty(name = "电脑摄像头通信状态")
    private MonitorStatusSourceEnum cameraMonitorStatusSource;

    @ApiModelProperty(name = "电脑屏幕通信状态")
    private MonitorStatusSourceEnum screenMonitorStatusSource;

    @ApiModelProperty(name = "手机主机位通信状态")
    private MonitorStatusSourceEnum mobileFirstMonitorStatusSource;

    @ApiModelProperty(name = "手机辅机位监控通信状态")
    private MonitorStatusSourceEnum mobileSecondMonitorStatusSource;

    @ApiModelProperty(name = "ip地址")
    private String clientCurrentIp;

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

    @ApiModelProperty(name = "监控观看地址")
    private String monitorLiveUrl;

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

    @ApiModelProperty(name = "剩余时间")
    private String remainTime;

    @ApiModelProperty(name = "新增预警")
    private Integer warningNew;

    @ApiModelProperty(name = "开启监控的视频源")
    private String monitorVideoSource;

    @ApiModelProperty(name = "开启转录的视频源")
    private String monitorRecord;

    @ApiModelProperty(value = "考生底照地址")
    private String basePhotoPath;

    public String getBasePhotoPath() {
        return basePhotoPath;
    }

    public void setBasePhotoPath(String basePhotoPath) {
        this.basePhotoPath = basePhotoPath;
    }

    public String getMonitorRecord() {
        return monitorRecord;
    }

    public void setMonitorRecord(String monitorRecord) {
        this.monitorRecord = monitorRecord;
    }

    public String getMonitorVideoSource() {
        return monitorVideoSource;
    }

    public void setMonitorVideoSource(String monitorVideoSource) {
        this.monitorVideoSource = monitorVideoSource;
    }

    public String getCourseCode() {
        return courseCode;
    }

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

    public Integer getPaperDownload() {
        return paperDownload;
    }

    public void setPaperDownload(Integer paperDownload) {
        this.paperDownload = paperDownload;
    }

    public WebsocketStatusEnum getClientWebsocketStatus() {
        return clientWebsocketStatus;
    }

    public void setClientWebsocketStatus(WebsocketStatusEnum clientWebsocketStatus) {
        this.clientWebsocketStatus = clientWebsocketStatus;
    }

    public MonitorStatusSourceEnum getCameraMonitorStatusSource() {
        return cameraMonitorStatusSource;
    }

    public void setCameraMonitorStatusSource(MonitorStatusSourceEnum cameraMonitorStatusSource) {
        this.cameraMonitorStatusSource = cameraMonitorStatusSource;
    }

    public MonitorStatusSourceEnum getScreenMonitorStatusSource() {
        return screenMonitorStatusSource;
    }

    public void setScreenMonitorStatusSource(MonitorStatusSourceEnum screenMonitorStatusSource) {
        this.screenMonitorStatusSource = screenMonitorStatusSource;
    }

    public MonitorStatusSourceEnum getMobileFirstMonitorStatusSource() {
        return mobileFirstMonitorStatusSource;
    }

    public void setMobileFirstMonitorStatusSource(MonitorStatusSourceEnum mobileFirstMonitorStatusSource) {
        this.mobileFirstMonitorStatusSource = mobileFirstMonitorStatusSource;
    }

    public MonitorStatusSourceEnum getMobileSecondMonitorStatusSource() {
        return mobileSecondMonitorStatusSource;
    }

    public void setMobileSecondMonitorStatusSource(MonitorStatusSourceEnum mobileSecondMonitorStatusSource) {
        this.mobileSecondMonitorStatusSource = mobileSecondMonitorStatusSource;
    }

    public String getClientCurrentIp() {
        return clientCurrentIp;
    }

    public void setClientCurrentIp(String clientCurrentIp) {
        this.clientCurrentIp = clientCurrentIp;
    }

    public String getCourseName() {
        return courseName;
    }

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

    public Integer getSeq() {
        return seq;
    }

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

    public Integer getWarningNew() {
        return warningNew;
    }

    public void setWarningNew(Integer warningNew) {
        this.warningNew = warningNew;
    }

    public String getRemainTime() {
        return remainTime;
    }

    public void setRemainTime(String remainTime) {
        this.remainTime = remainTime;
    }

    public Double getProgress() {
        return progress;
    }

    public void setProgress(Double progress) {
        this.progress = progress;
    }

    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 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 String getMonitorLiveUrl() {
        return monitorLiveUrl;
    }

    public void setMonitorLiveUrl(String monitorLiveUrl) {
        this.monitorLiveUrl = monitorLiveUrl;
    }

    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 && Objects.equals(ExamRecordStatusEnum.FIRST_PREPARE, statusCode)) {
            return "已待考";
        } else if (statusCode != null && Objects.equals(ExamRecordStatusEnum.BREAK_OFF, statusCode)) {
            return "已中断";
        } else if (statusCode != null && (Objects.equals(ExamRecordStatusEnum.ANSWERING, statusCode) || Objects.equals(ExamRecordStatusEnum.RESUME_PREPARE, statusCode) || Objects.equals(ExamRecordStatusEnum.BREAK_OFF, statusCode))) {
            return "考试中";
        } else {
            if (Objects.nonNull(statusCode)) {
                return statusCode.getCode();
            } else {
                return "未参加考试";
            }
        }
    }

    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;
    }
}
