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

import com.qmth.themis.business.enums.BreachCancelTypeEnum;
import com.qmth.themis.business.enums.BreachTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Objects;

@ApiModel("报表-违纪名单明细返回对象")
public class ExamBreachDetailListBean {

    @ApiModelProperty(name = "违纪撤销/处理")
    private String status;

    @ApiModelProperty(name = "操作人")
    private String createName;

    @ApiModelProperty(name = "结束时间")
    private Long endTime;

    @ApiModelProperty(name = "类型原因")
    private String type;

    @ApiModelProperty(name = "描述")
    private String description;

    public String getStatus() {
        return status;
    }

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

    public String getCreateName() {
        return createName;
    }

    public void setCreateName(String createName) {
        this.createName = createName;
    }

    public Long getEndTime() {
        return endTime;
    }

    public void setEndTime(Long endTime) {
        this.endTime = endTime;
    }

    public String getType() {
        if (Objects.nonNull(type)) {
            if (Objects.nonNull(status) && Objects.equals("违纪处理", status)) {
                return BreachTypeEnum.valueOf(type).getCode();
            } else if (Objects.nonNull(status) && Objects.equals("撤销违纪", status)) {
                return BreachCancelTypeEnum.valueOf(type).getCode();
            } else {
                return null;
            }
        } else {
            return type;
        }
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
