package com.hdkj.lt.core.bizms.modle.dto;

import com.hdkj.lt.utils.poi.BaseReadExcelConfig;
import com.hdkj.lt.utils.poi.ExcelImport;
import lombok.Data;

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author luorui
 * @date 2025/6/16 17:13
 */
@Data
public class FhzgSwitchProtectionSettingsBaseReadExcelConfig implements BaseReadExcelConfig {

    public static final String SHEET_NAME = "sheet1";

    /**
     * 所属区县
     */
    @ExcelImport("maintOrgName")
    private String maintOrgName;

    /**
     * 所属线路
     */
    @ExcelImport("feederName")
    private String feederName;

    /**
     * 开关名称
     */
    @ExcelImport("switchName")
    private String switchName;
    /**
     * 开关id
     */
    @ExcelImport(value = "switchId", required = true)
    private String switchId;

    /**
     * 是否联络开关 1-是，0-否
     */
    @ExcelImport("isContactSwitch")
    private String isContactSwitch;
    /**
     * 联络是否有效,1-有效，0-无效
     */
    @ExcelImport("contactEffective")
    private String contactEffective;


    /**
     * 开关隐患类型
     */
    @ExcelImport("hazardType")
    private String hazardType;

    /**
     * 开关描述
     */
    @ExcelImport(value = "hazardDesc")
    private String hazardDesc;


    /**
     * 过流I段定值
     */
    @ExcelImport("oc1Value")
    private String oc1Value;

    /**
     * 过流I段延迟
     */
    @ExcelImport("oc1Delay")
    private String oc1Delay;

    /**
     * 设置类型1-告警，2-跳闸
     */
    @ExcelImport("oc1Setting")
    private String oc1Setting;

    /**
     * 过流II段定值
     */
    @ExcelImport("oc2Value")
    private String oc2Value;

    /**
     * 过流II段延迟
     */
    @ExcelImport("oc2Delay")
    private String oc2Delay;
    /**
     * 设置类型1-告警，2-跳闸
     */
    @ExcelImport("oc2Setting")
    private String oc2Setting;

    /**
     * 过流III段定值
     */
    @ExcelImport("oc3Value")
    private String oc3Value;

    /**
     * 过流III段延迟
     */
    @ExcelImport("oc3Delay")
    private String oc3Delay;

    /**
     * 设置类型1-告警，2-跳闸
     */
    @ExcelImport("oc3Setting")
    private String oc3Setting;

    //保护投退 (0-退出 1-投入）
    @ExcelImport("protEnableStatus")
    private String protEnableStatus;

    //重合闸 (0-退出 1-投入）
    @ExcelImport("recloseEnableStatus")
    private String recloseEnableStatus;

    /**
     *
     * @author luorui
     * @date 2025/6/16 14:53
     * @discription
     *
     **/
    public static BaseReadExcelConfig[] values() {
        FhzgSwitchProtectionSettingsBaseReadExcelConfig fhzgSwitchProtectionSettingsBaseReadExcelConfig = new FhzgSwitchProtectionSettingsBaseReadExcelConfig();
        BaseReadExcelConfig[] configs = new BaseReadExcelConfig[1];
        configs[0] = fhzgSwitchProtectionSettingsBaseReadExcelConfig;
        return configs;
    }

    @Override
    public String getSheetName() {
        return SHEET_NAME;
    }

    @Override
    public String getCode() {
        return SHEET_NAME;
    }

    @Override
    public int getStartRead() {
        return 1;
    }

    //导出数据的表头顺序是按照当前对象属性列表顺序赋值的所以，excel中表头的属性顺序要和对象中属性顺序保持一致
    @Override
    public List<String> getColumns() {
        Field[] fields = FhzgSwitchProtectionSettingsBaseReadExcelConfig.class.getDeclaredFields();
        List<String> fileNameList = Arrays.stream(fields).map(Field::getName).collect(Collectors.toList());
        return fileNameList;
    }

    @Override
    public Map<String, String> getHeaderCol() {
        return null;
    }
}
