package cn.cecep.talroad.vo;

import cn.cecep.talroad.common.core.annotation.Excel;
import cn.cecep.talroad.domain.SEnvGasMonReal;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 废气监测数据对象 s_env_gas_mon_real
 *
 * @author szhpt
 * @date 2023-04-06*/
@ApiModel(value = "废气监测数据")
@EqualsAndHashCode(callSuper = false)
@Data
public class SEnvGasMonRealVo
{
    @ApiModelProperty(value = "主键id")
    private String id;

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

    @ApiModelProperty(value = "排口id")
    private String outletId;

    @ApiModelProperty(value = "排口名称")
    @Excel(name = "排口名称",sort = 2)
    private String outletName;

    @ApiModelProperty(value = "排口编号")
    @Excel(name = "排口编号",sort = 3)
    private String outletCode;

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

    @ApiModelProperty(value = "标记说明")
//    @Excel(name = "标记说明", readConverterExp="N=正常,F=停运,M=维护/维修,S=手工输入的设定值,D=故障/断电,C=校准,T=超测量上限")
    private String mark;

    @ApiModelProperty(value = "数据类型（日：d；小时：h；分钟：m）")
    private String dataType;

    @ApiModelProperty(value = "日期")
    @Excel(name = "时间",sort = 4)
    private String monitoringTime;

    @ApiModelProperty(value = "二氧化硫")
    @Excel(name = "SO₂实测(mg/m³)",sort = 5)
    private String so2;

    @ApiModelProperty(value = "二氧化硫折算")
    @Excel(name = "SO₂折算(mg/m³)",sort = 6)
    private String so2Convert;

    @ApiModelProperty(value = "二氧化硫排放量")
    @Excel(name = "SO₂排放量(kg)",sort = 7)
    private String so2Emission;

    @ApiModelProperty(value = "氮氧化物")
    @Excel(name = "NOx实测(mg/m³)",sort =8)
    private String nox;

    @ApiModelProperty(value = "氮氧化物折算")
    @Excel(name = "NOx折算(mg/m³)",sort = 9)
    private String noxConvert;

    @ApiModelProperty(value = "氮氧化物排放量")
    @Excel(name = "NOx排放量(kg)",sort = 10)
    private String noxEmission;

    @ApiModelProperty(value = "一氧化氮")
    @Excel(name = "NO实测(mg/m³)", sort = 250)
    private String no;

    @ApiModelProperty(value = "一氧化氮折算")
    @Excel(name = "NO折算(mg/m³)", sort = 251)
    private String noConvert;

    @ApiModelProperty(value = "一氧化氮排放量")
    @Excel(name = "NO排放量(kg)", sort = 252)
    private String noEmission;

    @ApiModelProperty(value = "二氧化氮")
    @Excel(name = "NO₂实测(mg/m³)", sort = 253)
    private String no2;

    @ApiModelProperty(value = "二氧化氮折算")
    @Excel(name = "NO₂折算(mg/m³)", sort = 254)
    private String no2Convert;

    @ApiModelProperty(value = "二氧化氮排放量")
    @Excel(name = "NO₂排放量(kg)", sort = 255)
    private String no2Emission;

    @ApiModelProperty(value = "烟尘")
    @Excel(name = "烟尘实测(mg/m³)", sort = 30)
    private String smokeDust;

    @ApiModelProperty(value = "烟尘折算")
    @Excel(name = "烟尘折算(mg/m³)", sort = 31)
    private String smokeDustConvert;

    @ApiModelProperty(value = "烟尘排放量")
    @Excel(name = "烟尘排放量(kg)", sort = 32)
    private String smokeDustEmission;

    @ApiModelProperty(value = "颗粒物实测")
    private String pm;

    @ApiModelProperty(value = "颗粒物折算")
    private String pmConvert;

    @ApiModelProperty(value = "颗粒物排放量")
    private String pmEmission;

    @ApiModelProperty(value = "VOCs实测")
    @Excel(name = "VOCs实测(mg/m³)",sort = 14)
    private String vocs;

    @ApiModelProperty(value = "VOCs折算")
    @Excel(name = "VOCs折算(mg/m³)",sort = 15)
    private String vocsConvert;

    @ApiModelProperty(value = "vocs排放量")
    @Excel(name = "VOCs排放量(kg)",sort = 16)
    private String vocsEmission;

    @ApiModelProperty(value = "氧气含量")
    @Excel(name = "氧气含量(%)",sort = 17)
    private String o3;

    @ApiModelProperty(value = "废气")
    @Excel(name = "废气流量(m³/s)",sort = 18)
    private String oxygen;

    @ApiModelProperty(value = "废气排放量")
    @Excel(name = "废气排放量(m³)",sort = 19)
    private String oxygenEmission;

    @ApiModelProperty(value = "烟气温度")
    @Excel(name = "烟气温度(℃)",sort = 200)
    private String smokeDustTem;

    @ApiModelProperty(value = "烟气压力")
    @Excel(name = "烟气压力(kPa)",sort = 201)
    private String smokeDustPressure;

    @ApiModelProperty(value = "烟气流速")
    @Excel(name = "烟气流速(m/s)",sort = 202)
    private String smokeDustFlowVelocity;

    @ApiModelProperty(value = "烟气湿度")
    @Excel(name = "烟气湿度(%)",sort = 203)
    private String smokeDustHumidity;

    private String so2Flag;
    private String noxFlag;
    private String noFlag;
    private String no2Flag;
    private String smokeDustFlag;
    private String pmFlag;
    private String vocsFlag;
    private String o3Flag;
    private String oxygenFlag;
    private String smokeDustTemFlag;
    private String smokeDustPressureFlag;
    private String smokeDustFlowVelocityFlag;
    private String smokeDustHumidityFlag;

    private String dataFlag;

    public String getDataFlag() {
        SEnvGasMonReal.DataFlagEnum byEnumName = SEnvGasMonReal.DataFlagEnum.getByEnumName(dataFlag);
        return byEnumName != null ? byEnumName.label : null;
    }

    @Data
    public static class EmissionSumVo {
        @ApiModelProperty(value = "排口id")
        private String outletId;

        @ApiModelProperty(value = "二氧化硫排放量总和")
        private BigDecimal so2EmissionSum;

        @ApiModelProperty(value = "氮氧化物排放量总和")
        private BigDecimal noxEmissionSum;

        @ApiModelProperty(value = "一氧化氮排放量总和")
        private BigDecimal noEmissionSum;

        @ApiModelProperty(value = "二氧化氮排放量总和")
        private BigDecimal no2EmissionSum;

        @ApiModelProperty(value = "烟尘排放量总和")
        private BigDecimal smokeDustEmissionSum;

        @ApiModelProperty(value = "颗粒物排放量总和")
        private BigDecimal pmEmissionSum;

        @ApiModelProperty(value = "vocs排放量总和")
        private BigDecimal vocsEmissionSum;

        @ApiModelProperty(value = "废气排放量总和")
        private BigDecimal oxygenEmissionSum;

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

    @Data
    public static class OxygenEmissionAvg {
        @ApiModelProperty(value = "排口id")
        private String outletId;

        @ApiModelProperty(value = "废气排放量平均值")
        private BigDecimal oxygenEmissionAvg;
    }

    @Data
    public static class EmissionAvgAndMax {
        @ApiModelProperty(value = "企业id")
        private String factoryId;
        @ApiModelProperty(value = "排口id")
        private String outletId;

        @ApiModelProperty(value = "SO2排放量平均值")
        private BigDecimal s02EmissionAvg;

        @ApiModelProperty(value = "SO2排放量最大值")
        private BigDecimal s02EmissionMax;

        @ApiModelProperty(value = "NOx排放量平均值")
        private BigDecimal noxEmissionAvg;

        @ApiModelProperty(value = "NOx排放量最大值")
        private BigDecimal noxEmissionMax;

        @ApiModelProperty(value = "一氧化氮排放量平均值")
        private BigDecimal noEmissionAvg;

        @ApiModelProperty(value = "一氧化氮排放量最大值")
        private BigDecimal noEmissionMax;

        @ApiModelProperty(value = "二氧化氮排放量平均值")
        private BigDecimal no2EmissionAvg;

        @ApiModelProperty(value = "二氧化氮排放量最大值")
        private BigDecimal no2EmissionMax;

        @ApiModelProperty(value = "烟尘排放量平均值")
        private BigDecimal smokeDustEmissionAvg;

        @ApiModelProperty(value = "烟尘排放量最大值")
        private BigDecimal smokeDustEmissionMax;

        @ApiModelProperty(value = "颗粒物排放量平均值")
        private BigDecimal pmEmissionAvg;

        @ApiModelProperty(value = "颗粒物排放量最大值")
        private BigDecimal pmEmissionMax;

        @ApiModelProperty(value = "VOCs排放量平均值")
        private BigDecimal vocsEmissionAvg;

        @ApiModelProperty(value = "VOCs排放量最大值")
        private BigDecimal vocsEmissionMax;

        @ApiModelProperty(value = "废气排放量平均值")
        private BigDecimal oxygenEmissionAvg;

        @ApiModelProperty(value = "废气排放量最大值")
        private BigDecimal oxygenEmissionMax;
    }
}
