package com.ruoyi.sim.domain;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 故障对象 sim_fault
 *
 * @author tom
 * @date 2024-12-15
 */
public class Fault extends BaseEntity implements Comparable<Fault> {

    private static final long serialVersionUID = 1L;

    /**
     * 故障ID
     */
    private String faultId;

    /**
     * 父故障ID
     */
    @Excel(name = "父故障ID")
    private String parentFaultId;

    /**
     * 模拟器类型
     */
    @Excel(name = "模拟器类型")
    private String simType;

    /**
     * 故障类型:
     * 1:故障现象
     * 2:故障现象的可能原因
     * 3:故障部位
     * 4:故障部位的排除方法
     * 5:修复结论
     */
    @Excel(name = "故障类型")
    private String faultType;

    /**
     * 故障状态
     * 0:启用
     * 5:禁用
     */
    @Excel(name = "故障状态")
    private String faultState;

    /**
     * 互斥所有故障ID逗号分割
     */
    @Excel(name = "互斥所有故障ID逗号分割")
    private String conflictFaultIds;

    /**
     * 是否是更换件 1:是 0:不是
     */
    @Excel(name = "是否是更换件 1:是 0:不是")
    private String replacePart;

    /**
     * 更换件名称
     */
    @Excel(name = "更换件名称")
    private String replaceName;

    /**
     * 名称
     */
    @Excel(name = "名称")
    private String name;

    /**
     * 绑定硬件通信报文
     */
    @Excel(name = "绑定硬件通信报文")
    private String bindHardwareMsg;

    /**
     * 显示顺序
     */
    @Excel(name = "显示顺序")
    private Long orderNum;

    public void setFaultId(String faultId) {
        this.faultId = faultId;
    }

    public String getFaultId() {
        return faultId;
    }

    public void setParentFaultId(String parentFaultId) {
        this.parentFaultId = parentFaultId;
    }

    public String getParentFaultId() {
        return parentFaultId;
    }

    public void setSimType(String simType) {
        this.simType = simType;
    }

    public String getSimType() {
        return simType;
    }

    public void setFaultType(String faultType) {
        this.faultType = faultType;
    }

    public String getFaultType() {
        return faultType;
    }

    public void setFaultState(String faultState) {
        this.faultState = faultState;
    }

    public String getFaultState() {
        return faultState;
    }

    public void setConflictFaultIds(String conflictFaultIds) {
        this.conflictFaultIds = conflictFaultIds;
    }

    public String getConflictFaultIds() {
        return conflictFaultIds;
    }

    public void setReplacePart(String replacePart) {
        this.replacePart = replacePart;
    }

    public String getReplacePart() {
        return replacePart;
    }

    public void setReplaceName(String replaceName) {
        this.replaceName = replaceName;
    }

    public String getReplaceName() {
        return replaceName;
    }

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

    public String getName() {
        return name;
    }

    public void setBindHardwareMsg(String bindHardwareMsg) {
        this.bindHardwareMsg = bindHardwareMsg;
    }

    public String getBindHardwareMsg() {
        return bindHardwareMsg;
    }

    public void setOrderNum(Long orderNum) {
        this.orderNum = orderNum;
    }

    public Long getOrderNum() {
        return orderNum;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("faultId", getFaultId())
                .append("parentFaultId", getParentFaultId())
                .append("simType", getSimType())
                .append("faultType", getFaultType())
                .append("faultState", getFaultState())
                .append("conflictFaultIds", getConflictFaultIds())
                .append("replacePart", getReplacePart())
                .append("replaceName", getReplaceName())
                .append("name", getName())
                .append("bindHardwareMsg", getBindHardwareMsg())
                .append("orderNum", getOrderNum())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }

    // -------------------------------- tom add  --------------------------------
    @Override
    public int compareTo(Fault o) {
        if (StringUtils.isNotEmpty(faultId)) {
            return faultId.compareTo(o.getFaultId());
        } else {
            return -1;
        }
    }


    public static String TYPE_1 = "1";
    public static String TYPE_2 = "2";
    public static String TYPE_3 = "3";
    public static String TYPE_4 = "4";
    public static String TYPE_5 = "5";

    public interface State {
        String ENABLE = "0";
        String DISABLE = "5";
    }

    public static String ROOT_FAULT_ID = "000000000000";
}
