package com.njcn.device.pq.pojo.vo.dataClean;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @version 1.0.0
 * @author: chenchao
 * @date: 2022/07/18 11:04
 */
@Getter
@Setter
@EqualsAndHashCode
public class DataVerifyExcel implements Serializable {

    private String lineId;

    @ColumnWidth(20)
    @ExcelProperty(value = "供电公司")
    @Excel(name = "供电公司")
    private String city;

    @ColumnWidth(20)
    @ExcelProperty(value = "所属变电站")
    @Excel(name = "所属变电站")
    private String stationName;


    @ColumnWidth(20)
    @ExcelProperty(value = "终端名称")
    @Excel(name = "终端名称")
    private String devName;

    @ColumnWidth(20)
    @ExcelProperty(value = "监测点名称")
    @Excel(name = "监测点名称")
    private String lineName;


    @ColumnWidth(20)
    @ExcelProperty(value = "IP")
    @Excel(name = "IP")
    private String ip;

    @ColumnWidth(20)
    @ExcelProperty(value = "干扰源类型")
    @Excel(name = "干扰源类型")
    private String loadType;


    @ColumnWidth(20)
    @ExcelProperty(value = "监测对象名称")
    @Excel(name = "监测对象名称")
    private String objName;


    @ColumnWidth(20)
    @ExcelProperty(value = "电网侧变电站")
    @Excel(name = "电网侧变电站")
    private String powerSubstationName;

    @ColumnWidth(20)
    @ExcelProperty(value = "厂商")
    @Excel(name = "厂商")
    private String manufacturer;

    @ColumnWidth(20)
    @ExcelProperty(value = "电网标志")
    @Excel(name = "电网标志")
    @ApiModelProperty(name = "powerFlag",value = "电网标志")
    private String powerFlag;

    @ColumnWidth(20)
    @ExcelProperty(value = "总指标异常时间")
    @Excel(name = "总指标异常时间")
    private Integer allTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "频率")
    @Excel(name = "频率")
    private Integer freqTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "频率偏差")
    @Excel(name = "频率偏差")
    private Integer freqDevTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "相电压有效值")
    @Excel(name = "相电压有效值")
    private Integer vRmsTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "正序电压")
    @Excel(name = "正序电压")
    private Integer vPosTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "负序电压")
    @Excel(name = "负序电压")
    private Integer vNegTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "零序电压")
    @Excel(name = "零序电压")
    private Integer vZeroTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "电压不平衡度")
    @Excel(name = "电压不平衡度")
    private Integer vUnbalanceTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "线电压有效值")
    @Excel(name = "线电压有效值")
    private Integer rmsLvrTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "电压正偏差")
    @Excel(name = "电压正偏差")
    private Integer vuDevTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "电压负偏差")
    @Excel(name = "电压负偏差")
    private Integer vlDevTime;

    @ColumnWidth(25)
    @ExcelProperty(value = "电压总谐波畸变率")
    @Excel(name = "电压总谐波畸变率")
    private Integer vThdTime;

    @ColumnWidth(25)
    @ExcelProperty(value = "相电压基波有效值")
    @Excel(name = "相电压基波有效值")
    private Integer vTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "电流有效值")
    @Excel(name = "电流有效值")
    private Integer iRmsTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "长时闪变")
    @Excel(name = "长时闪变")
    private Integer pltTime;

    @ColumnWidth(25)
    @ExcelProperty(value = "间谐波电压含有率")
    @Excel(name = "间谐波电压含有率")
    private Integer vInharmTime;

    @ColumnWidth(25)
    @ExcelProperty(value = "谐波电压含有率")
    @Excel(name = "谐波电压含有率")
    private Integer vHarmTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "功率因数")
    @Excel(name = "功率因数")
    private Integer pfTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "谐波电压相角")
    @Excel(name = "谐波电压相角")
    private Integer vPhasicTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "谐波电压基波相角")
    @Excel(name = "谐波电压基波相角")
    private Integer v1PhasicTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "电压波动")
    @Excel(name = "电压波动")
    private Integer flucTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "短时闪变")
    @Excel(name = "短时闪变")
    private Integer pstTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "电压暂降")
    @Excel(name = "电压暂降")
    private Integer dipTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "电压暂升")
    @Excel(name = "电压暂升")
    private Integer riseTime;


    // 字段名 ↔ Excel列名 映射
    public static final Map<String, String> FIELD_COLUMN_MAP = new HashMap<>();
    static {
        // 按代码中字段顺序整理，确保一一对应
        FIELD_COLUMN_MAP.put("freqTime", "频率");
        FIELD_COLUMN_MAP.put("freqDevTime", "频率偏差");
        FIELD_COLUMN_MAP.put("vRmsTime", "相电压有效值");
        FIELD_COLUMN_MAP.put("vPosTime", "正序电压");
        FIELD_COLUMN_MAP.put("vNegTime", "负序电压");
        FIELD_COLUMN_MAP.put("vZeroTime", "零序电压");
        FIELD_COLUMN_MAP.put("vUnbalanceTime", "电压不平衡度");
        FIELD_COLUMN_MAP.put("rmsLvrTime", "线电压有效值");
        FIELD_COLUMN_MAP.put("vuDevTime", "电压正偏差");
        FIELD_COLUMN_MAP.put("vlDevTime", "电压负偏差");
        FIELD_COLUMN_MAP.put("vThdTime", "电压总谐波畸变率");
        FIELD_COLUMN_MAP.put("vTime", "相电压基波有效值");
        FIELD_COLUMN_MAP.put("iRmsTime", "电流有效值");
        FIELD_COLUMN_MAP.put("pltTime", "长时闪变");
        FIELD_COLUMN_MAP.put("vInharmTime", "间谐波电压含有率");
        FIELD_COLUMN_MAP.put("vHarmTime", "谐波电压含有率");
        FIELD_COLUMN_MAP.put("pfTime", "功率因数");
        FIELD_COLUMN_MAP.put("vPhasicTime", "谐波电压相角");
        FIELD_COLUMN_MAP.put("v1PhasicTime", "谐波电压基波相角");
        FIELD_COLUMN_MAP.put("flucTime", "电压波动");
        FIELD_COLUMN_MAP.put("pstTime", "短时闪变");
        FIELD_COLUMN_MAP.put("dipTime", "电压暂降");
        FIELD_COLUMN_MAP.put("riseTime", "电压暂升");
    }

}
