package com.njcn.mq.message;

import com.njcn.middle.rocket.domain.BaseMessage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * 类的介绍：
 *
 * @author xuyang
 * @version 1.0.0
 * @createTime 2023/8/22 11:06
 */
@Data
public class AppEventMessage extends BaseMessage {

    @ApiModelProperty("网络设备码")
    private String id;

    private Integer mid;

    @ApiModelProperty("逻辑设备 治理逻辑设备为1 电能质量设备为2")
    private Integer did;

    private Integer pri;

    private Integer type;

    private Msg msg;

    @Data
    public static class Msg{

        @ApiModelProperty("逻辑子设备 治理逻辑设备为0 电能质量设备为1、2")
        private Integer clDid;

        private Integer dataType;

        @ApiModelProperty("数据属性：无-0、实时-1、统计-2")
        private Integer dataAttr;

        private Integer dsNameIdx;

        private List<DataArray> dataArray;
    }

    @Data
    public static class DataArray{

        private Integer idx;

        private String name;

        private Long dataTimeSec;

        private Long dataTimeUSec;

        @ApiModelProperty("数据标识，1-标识数据异常")
        private Integer dataTag;

        @ApiModelProperty("事件类型")
        private String type;

        @ApiModelProperty("告警故障编码（一般显示为Hex）")
        private String code;

        private List<Param> param;

        @ApiModelProperty("工程名称")
        private String prjName;

        @ApiModelProperty("装置启动时间")
        private Long prjTimeStart;

        @ApiModelProperty("装置结束时间")
        private Long prjTimeEnd;

        @ApiModelProperty("装置数据路径")
        private String prjDataPath;

        @ApiModelProperty("装置型号")
        private String devType;

        @ApiModelProperty("装置mac地址")
        private String devMac;

        @ApiModelProperty("装置程序版本")
        private String appVersion;

        @ApiModelProperty("逻辑子设备id")
        private Integer clDid;

        @ApiModelProperty("统计间隔")
        private Integer statCycle;

        @ApiModelProperty("电压等级")
        private Float volGrade;

        @ApiModelProperty("电压接线方式（0-星型, 1-角型, 2-V型）")
        private Integer volConType;

        @ApiModelProperty("电流接线方式（0-正常, 1-合成IB, 2-合成IC）")
        private Integer curConSel;

        @ApiModelProperty("PT变比")
        private Integer ptRatio;

        @ApiModelProperty("ct变比")
        private Integer ctRatio;

        @ApiModelProperty("基准短路容量")
        private Float capacitySscb;

        @ApiModelProperty("最小短路容量")
        private Float capacitySscmin;

        @ApiModelProperty("供电设备容量")
        private Float capacitySt;

        @ApiModelProperty("用户协议容量")
        private Float capacitySi;
    }

    @Data
    public static class Param{

        private String name;

        private String type;

        private String unit;

        private Object data;
    }
}
