package com.ssj.service.kmt.exercisesys.dto;

import com.alibaba.fastjson.annotation.JSONField;

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

/**
 * @description
 * @author yrf
 * @time 2020/3/23 17:36
 */
public class FindCheckTeacherListDto implements Serializable {

    private static final long serialVersionUID = -3764035179314995279L;

    private String teacherId;
    private String teacherName;
    private String subject;

    @JSONField(serialize = false)
    private Integer isBanned;

    @JSONField(serialize = false)
    private Integer isCancelled;

    @JSONField(serialize = false)
    private Integer isFormal;

    /**
     * 角色状态 1考核中，2在职， 3已冻结，4已注销
     */
    private Integer teacherWorkingType;

    public String getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(String teacherId) {
        this.teacherId = teacherId;
    }

    public String getTeacherName() {
        return teacherName;
    }

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

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public Integer getIsBanned() {
        return isBanned;
    }

    public void setIsBanned(Integer isBanned) {
        this.isBanned = isBanned;
    }

    public Integer getIsCancelled() {
        return isCancelled;
    }

    public void setIsCancelled(Integer isCancelled) {
        this.isCancelled = isCancelled;
    }

    public Integer getIsFormal() {
        return isFormal;
    }

    public void setIsFormal(Integer isFormal) {
        this.isFormal = isFormal;
    }

    public Integer getTeacherWorkingType() {
        if (teacherWorkingType != null) {
            return teacherWorkingType;
        }
        if (Objects.equals(isCancelled, 1)) {
            teacherWorkingType = 4;
        } else if (Objects.equals(isBanned, 1)) {
            teacherWorkingType = 3;
        } else if (Objects.equals(isFormal, 1)) {
            teacherWorkingType = 2;
        } else {
            teacherWorkingType = 1;
        }
        return teacherWorkingType;
    }

    public void setTeacherWorkingType(Integer teacherWorkingType) {
        this.teacherWorkingType = teacherWorkingType;
    }
}
