package com.njcn.device.pms.pojo.excel;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.njcn.device.pms.utils.ExcelValid;
import lombok.Data;

import java.io.Serializable;


/**
 * 发电用户导入模板
 */
@Data
public class PowerGenerationUserExcel implements Serializable {

    private static final long serialVersionUID = 1L;


    @Excel(name = "*用户编号", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*用户编号")
    @ExcelValid(message = "用户编号不能为空")
    private String id;

    @Excel(name = "*用户名称", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*用户名称")
    @ExcelValid(message = "用户名称不能为空")
    private String name;

    @Excel(name = "*组织机构名称", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*组织机构名称")
    @ExcelValid(message = "组织机构名称不能为空")

    private String orgName;

    @Excel(name = "*组织机构ID", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*组织机构ID")
    @ExcelValid(message = "组织机构ID不能为空")
    private String orgId;

    @Excel(name = "*运维单位名称", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*运维单位名称")
    @ExcelValid(message = "运维单位名称不能为空")
    private String operationName;

    @Excel(name = "*运维单位ID", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*运维单位ID")
    @ExcelValid(message = "运维单位ID不能为空")
    private String operationId;

    @Excel(name = "*电源类别", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*电源类别")
    @ExcelValid(message = "电源类别不能为空")
    private String powerCategory;

    @Excel(name = "*电站类型", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*电站类型")
    @ExcelValid(message = "电站类型不能为空")
    private String powerStationType;

    @Excel(name = "*发电方式", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*发电方式")
    @ExcelValid(message = "发电方式不能为空")
    private String powerGenerationMode;

    @Excel(name = "*并网电压等级", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*并网电压等级")
    @ExcelValid(message = "并网电压等级不能为空")
    private String voltageLevel;

    @Excel(name = "*总装机容量", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*总装机容量")
    @ExcelValid(message = "总装机容量不能为空")
    private Float sourceCapacity;

    @Excel(name = "*并网日期(yyyy-MM-dd)", importFormat = "yyyy-MM-dd", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*并网日期(yyyy-MM-dd)")
    @ExcelValid(message = "并网日期(yyyy-MM-dd)不能为空")
    private String connectionDate;

    @Excel(name = "*能源消纳方式", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*能源消纳方式")
    @ExcelValid(message = "能源消纳方式不能为空")
    private String connectionMode;

    @Excel(name = "*客户状态", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*客户状态")
    @ExcelValid(message = "客户状态不能为空")
    private String gcStat;

    @Excel(name = "*变电站编号", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*变电站编号")
    @ExcelValid(message = "变电站编号不能为空")
    private String powerStationId;

    @Excel(name = "*变电站名称", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*变电站名称")
    @ExcelValid(message = "变电站名称不能为空")
    private String powerStationName;

    @Excel(name = "*供电线路编号", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*供电线路编号")
    @ExcelValid(message = "供电线路编号不能为空")
    private String lineId;

    @Excel(name = "*供电线路名称", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*供电线路名称")
    @ExcelValid(message = "供电线路名称不能为空")
    private String lineName;

    @Excel(name = "*供电台区", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*供电台区")
    @ExcelValid(message = "供电台区不能为空")
    private String platformId;

    @Excel(name = "*供电台区名称", width = 30)
    @ColumnWidth(30)
    @ExcelProperty(value = "*供电台区名称")
    @ExcelValid(message = "供电台区名称不能为空")
    private String platformName;


    @Excel(name = "*是否是上送国网监测点", replace = {"否_0", "是_1"}, width = 40)
    @ColumnWidth(45)
    @ExcelProperty(value = "*是否是上送国网监测点")
    @ExcelValid(message = "是否是上送国网监测点不能为空")
    private String isUpToGrid;

    @Data
    public static class ErrMsg extends PowerGenerationUserExcel {

        @Excel(name = "错误信息", width = 50)
        @ColumnWidth(60)
        @ExcelProperty(value = "错误信息")
        private String errMsg;

    }
}
