package com.njcn.gather.event.eventlist.pojo.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.njcn.gather.event.eventlist.config.EventMillisecondTimeSerializer;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 暂态事件列表展示对象。
 */
@Data
public class EventListVO implements Serializable {

    private static final long serialVersionUID = 1L;

    private String eventId;

    private String measurementPointId;

    @Excel(name = "发生时刻", width = 25, exportFormat = "yyyy-MM-dd HH:mm:ss.SSS")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = EventMillisecondTimeSerializer.class)
    private LocalDateTime startTime;

    @Excel(name = "工程名称", width = 25)
    private String engineeringName;

    @Excel(name = "项目名称", width = 25)
    private String projectName;

    @Excel(name = "设备名称", width = 25)
    private String equipmentName;

    private String mac;

    @Excel(name = "监测点名称", width = 25)
    private String lineName;

    @Excel(name = "暂降/暂升幅值(%)", width = 20)
    private BigDecimal featureAmplitude;

    @Excel(name = "持续时间(s)", width = 18)
    private BigDecimal duration;

    @Excel(name = "事件类型", width = 18)
    private String eventType;

    @Excel(name = "相别", width = 15)
    private String phase;

    @Excel(name = "事件描述", width = 25)
    @JsonProperty("event_describe")
    private String eventDescribe;

    @Excel(name = "事件发生位置", width = 18)
    private String sagsource;

    private String wavePath;

    private Integer fileFlag;

    private Integer dealFlag;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;
}
