package cn.cecep.talroad.vo;

import cn.cecep.talroad.common.core.annotation.Excel;
import cn.cecep.talroad.config.BigDecimalSerialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * 排放量汇总统计相关vo
 */
public class EmissionsStatVo {

    @Data
    @ApiModel("公共的查询参数")
    public static class BaseSearch {
        @ApiModelProperty("开始时间")
        private String startTime;

        @ApiModelProperty("结束时间")
        private String endTime;

        @ApiModelProperty("污染物种类")
        private String pollutantCode;

        @ApiModelProperty("行业类别")
        private String industryCode;

        @ApiModelProperty("是否超标 0:否, 1:是")
        private String over;
    }

    @Data
    @ApiModel("监测点排放量统计查询条件vo")
    public static class PointSearch extends BaseSearch {
        @ApiModelProperty("企业id")
        private String factoryId;

        @ApiModelProperty("企业名称")
        private String factoryName;

        @ApiModelProperty("区县编码")
        private String regionCode;

        @ApiModelProperty("监测点位名称")
        private String pointName;

        @ApiModelProperty(value="页数")
        private Integer pageNum;

        @ApiModelProperty(value="条数")
        private Integer pageSize;

        @ApiModelProperty(value="是否重点管控点位：0否 1是")
        private String controlPoints;
    }

    @Data
    @ApiModel("企业排放量统计查询条件vo")
    public static class FactorySearch extends BaseSearch {
        @ApiModelProperty("企业id")
        private String factoryId;

        @ApiModelProperty("企业名称")
        private String factoryName;

        @ApiModelProperty("区县编码")
        private String regionCode;

        @ApiModelProperty(value="页数")
        private Integer pageNum;

        @ApiModelProperty(value="条数")
        private Integer pageSize;
    }

    @Data
    @ApiModel("区域排放量统计查询条件vo")
    public static class RegionSearch extends BaseSearch {
    }

    @Data
    @ApiModel("公共的数据行属性vo")
    public static class BaseRow {
        @ApiModelProperty("区县编码")
        private String regionCode;

        @ApiModelProperty("区县名称")
        @Excel(name = "区县名称", sort = 100)
        private String regionName;

        @ApiModelProperty("行业类别")
        @Excel(name = "行业类别", sort = 110)
        private String industryName;

        @ApiModelProperty("污染物code")
        private String pollutantCode;

        @ApiModelProperty("污染物种类")
        @Excel(name = "污染物种类", sort = 120)
        private String pollutantName;

        @ApiModelProperty("管控浓度排放量（kg）")
        @Excel(name = "管控浓度排放量（kg）", sort = 140, scale = 9)
        @JsonSerialize(using = BigDecimalSerialize.class)
        private BigDecimal manageEmissions;

        @ApiModelProperty("实际排放量（kg）")
        @Excel(name = "实际排放量（kg）", sort = 150, scale = 9)
        @JsonSerialize(using = BigDecimalSerialize.class)
        private BigDecimal realEmissions;

        @ApiModelProperty("是否超标")
        @Excel(name = "是否超标")
        private String over;
    }

    @Data
    @ApiModel("监测点排放量统计查询数据行vo")
    public static class PointRow extends BaseRow {
        @ApiModelProperty("监测点位id")
        private String pointId;

        @ApiModelProperty("监测点位名称")
        @Excel(name = "监测点位名称", sort = 1)
        private String pointName;

        @ApiModelProperty(value="是否重点管控点位：0否 1是")
        @Excel(name = "是否重点管控点位", readConverterExp = "0=否,1=是", sort = 3)
        private String controlPoints;

        @ApiModelProperty("企业id")
        private String factoryId;

        @ApiModelProperty("企业名称")
        @Excel(name = "企业名称", sort = 5)
        private String factoryName;

        @ApiModelProperty("管控浓度标准")
        private BigDecimal controlStandard;

        @ApiModelProperty(value = "小时数据数量")
        private Long hourDataCount;

        @ApiModelProperty("管控浓度排放量与实际排放量差值（kg）")
        @Excel(name = "管控浓度排放量与实际排放量差值（kg）", sort = 170, scale = 9)
        @JsonSerialize(using = BigDecimalSerialize.class)
        private BigDecimal manageRealDiff;
    }

    @Data
    @ApiModel("企业排放量统计查询数据行vo")
    public static class FactoryRow extends BaseRow {
        @ApiModelProperty("企业名称")
        @Excel(name = "企业名称", sort = 1)
        private String factoryName;

        @ApiModelProperty("企业id")
        private String factoryId;

        @ApiModelProperty("基准排放量（kg）")
        @Excel(name = "基准排放量（kg）", sort = 121, scale = 9)
        @JsonSerialize(using = BigDecimalSerialize.class)
        private BigDecimal basisEmissions;

        @ApiModelProperty("非重点管控点位实际排放量（kg）")
        @Excel(name = "非重点管控点位实际排放量（kg）", sort = 122, scale = 9)
        @JsonSerialize(using = BigDecimalSerialize.class)
        private BigDecimal nonKeyRealEmissions;

        @ApiModelProperty("基准排放量与实际排放量差值（kg）")
        @Excel(name = "基准排放量与实际排放量差值（kg）", sort = 160, scale = 9)
        @JsonSerialize(using = BigDecimalSerialize.class)
        private BigDecimal basisRealDiff;
    }

    @Data
    @ApiModel("区域排放量统计查询数据行vo")
    public static class RegionRow extends BaseRow {
        @ApiModelProperty("管控目标排放量（kg）")
        @Excel(name = "管控目标排放量（kg）", sort = 121, scale = 9)
        @JsonSerialize(using = BigDecimalSerialize.class)
        private BigDecimal ctrlTargetEmissions;

        @ApiModelProperty("基准排放量（kg）")
        @Excel(name = "基准排放量（kg）", sort = 122, scale = 9)
        @JsonSerialize(using = BigDecimalSerialize.class)
        private BigDecimal basisEmissions;

        @ApiModelProperty("非重点管控点位实际排放量（kg）")
        @Excel(name = "非重点管控点位实际排放量（kg）", sort = 143, scale = 9)
        @JsonSerialize(using = BigDecimalSerialize.class)
        private BigDecimal nonKeyRealEmissions;

        @ApiModelProperty("管控目标与实际排放量差值（kg）")
        @Excel(name = "管控目标与实际排放量差值（kg）", sort = 153, scale = 9)
        @JsonSerialize(using = BigDecimalSerialize.class)
        private BigDecimal ctrlTargetRealDiff;

        @ApiModelProperty("基准排放量与实际排放量差值（kg）")
        @Excel(name = "基准排放量与实际排放量差值（kg）", sort = 156, scale = 9)
        @JsonSerialize(using = BigDecimalSerialize.class)
        private BigDecimal basisRealDiff;
    }

    @Data
    @ApiModel("区域排放量统计查询vo")
    public static class Region {
        @ApiModelProperty("曲线图数据")
        private EChartsVO chartsVO;

        @ApiModelProperty("表格数据")
        private List<RegionRow> rows;
    }

}
