package com.rc.httpcore.vo.response;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 查询报警记录列表 response bean
 *
 * @author ReiChin_
 */
public class AioAlarmRecordVo implements Parcelable {

    public String alarmContent; // 报警内容
    public String alarmMode; // 报警方式（1.系统通知，2.声光报警，3.短信通知）
    public String alarmTime; // 报警时间
    public String alarmType; // 报警类型（1 自动（过期），2 检测，3 手动）
    public String deptId; // 实验室所属学院id
    public String deptName; // 实验室所属学院
    public String handlingContent; // 处理内容
    public String handlingStatus; // 处理状态 1.待处理，2.已处理
    public String handlingTime; // 处理时间
    public String handlingUserId; // 处理人id
    public String id; // 报警记录ID
    public String liableUserIds; // 责任ID
    public String liableUserNames; // 责任人姓名
    public String liableUserPhones; // 责任人手机号码
    public String adminNames; // 责任人 柴云龙 13319297777
    public String safeUserId;
    public String safeUserName; // 实验室安全责任人
    public String safeUserPhones; // 实验室安全责任人手机号码
    public String safeUserNames; // 实验室安全责任人  高升 18681887295
    public String subId; // 实验室id
    public String subName; // 实验室名称
    public String terminalNum; // 设备编号

    public String decodeAlarmMode() {
        if ("1".equals(alarmMode)) return "系统通知";
        if ("2".equals(alarmMode)) return "声光报警";
        if ("3".equals(alarmMode)) return "短信通知";
        return "";
    }

    public String decodeAlarmType() {
        if ("1".equals(alarmType)) return "自动（过期）";
        if ("2".equals(alarmType)) return "检测";
        if ("3".equals(alarmType)) return "手动";
        return "";
    }

    public String decodeHandlingStatus() {
        if ("1".equals(handlingStatus)) return "待处理";
        if ("2".equals(handlingStatus)) return "已处理";
        return "";
    }

    public AioAlarmRecordVo() {
    }

    protected AioAlarmRecordVo(Parcel in) {
        alarmContent = in.readString();
        alarmMode = in.readString();
        alarmTime = in.readString();
        alarmType = in.readString();
        deptId = in.readString();
        deptName = in.readString();
        handlingContent = in.readString();
        handlingStatus = in.readString();
        handlingTime = in.readString();
        handlingUserId = in.readString();
        id = in.readString();
        liableUserIds = in.readString();
        liableUserNames = in.readString();
        liableUserPhones = in.readString();
        adminNames = in.readString();
        safeUserId = in.readString();
        safeUserName = in.readString();
        safeUserPhones = in.readString();
        safeUserNames = in.readString();
        subId = in.readString();
        subName = in.readString();
        terminalNum = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(alarmContent);
        dest.writeString(alarmMode);
        dest.writeString(alarmTime);
        dest.writeString(alarmType);
        dest.writeString(deptId);
        dest.writeString(deptName);
        dest.writeString(handlingContent);
        dest.writeString(handlingStatus);
        dest.writeString(handlingTime);
        dest.writeString(handlingUserId);
        dest.writeString(id);
        dest.writeString(liableUserIds);
        dest.writeString(liableUserNames);
        dest.writeString(liableUserPhones);
        dest.writeString(adminNames);
        dest.writeString(safeUserId);
        dest.writeString(safeUserName);
        dest.writeString(safeUserPhones);
        dest.writeString(safeUserNames);
        dest.writeString(subId);
        dest.writeString(subName);
        dest.writeString(terminalNum);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<AioAlarmRecordVo> CREATOR = new Creator<AioAlarmRecordVo>() {
        @Override
        public AioAlarmRecordVo createFromParcel(Parcel in) {
            return new AioAlarmRecordVo(in);
        }

        @Override
        public AioAlarmRecordVo[] newArray(int size) {
            return new AioAlarmRecordVo[size];
        }
    };
}
