package cn.cecep.talroad.enums;

import cn.cecep.talroad.domain.PcLabel;
import cn.cecep.talroad.domain.PcLabelFactory;
import com.google.common.collect.Lists;

import java.util.List;
import java.util.Map;

public enum LabelFactoryEnum {
    BASE003("BASE003","生产类型"),
    BASE004("BASE004","是否重点排污单位"),
    BASE005("BASE005","重点排污单位名录类别"),
    BASE006("BASE006","许可管理类别"),
    BASE007("BASE007","许可是否整改"),
    BASE008("BASE008","管控级别"),
    BASE009("BASE009","生态环境信用级别"),
    BASE011("BASE011","所在地是否属于大气重点控制区"),
    BASE012("BASE012","所在地是否属于总磷控制区"),
    BASE013("BASE013","所在地是否属于总氮控制区"),
    BASE014("BASE014","所在地是否属于重金属污染物特别排放限值实施区域"),
    BASE015("BASE015","是否位于工业园区"),
    BASE017("BASE017","风险源类别"),
    BASE019("BASE019","是否有排污许可证"),
    PF007("PF007","涉源类型"),
    PF005("PF005","危险废物单位监管类型"),
    PF006("PF006","危险废物单位类型"),
    BASE020("BASE020","气：污染物名称"),
    BASE021("BASE021","水：染污物名称"),
    BASE022("BASE022","有许可总量要求的污染物"),
    PF027("PF027","承诺更加严格排放浓度限值"),
    JG010("JG010","运输车辆类型"),
    PF001("PF001","废水排放方式"),
    JG001("JG001","排污许可证是否在有效内"),
    JG002("JG002","许可证有效期不足1个月"),
    PF003("PF003","受纳水体功能目标"),
    PF004("PF004","是否为直排海企业"),
    PF002("PF002","受纳自然水体名称"),
    JG011("JG011","在线监测设备安装情况是否符合许可证要求"),
    BASE023("BASE023","包含数据类型"),
    BASE001("BASE001","行业类别"),
    BASE502("BASE502","大气管控监管企业"),
    BASE501("BASE501","大气企业监管行业"),
    JG006("JG006","是否安装分表计电"),
    JG007("JG007","是否安装无组织监控点位"),
    JG003("JG003","1年内治理设施是否存在异常运行"),
    PF023("PF023","1年内是否有无组织超标排放情况"),
    JG053("JG053","本年内无组织监控数据传输率"),
    JG055("JG055","本年内在线监测数据传输率"),
    JG021("JG021","年度在线监测数据有效传输率是否达到95%以上"),
    JG052("JG052","本年内工况数据传输率"),
    JG054("JG054","本年内分表计电数据传输率"),
    PF018("PF018","1年内是否有大气污染物浓度超标情况"),
    PF019("PF019","1年内是否有大气污染物总量超标情况"),
    PF016("PF016","用电特征"),
    PF008("PF008","SO₂排放特征"),
    PF009("PF009","NOx排放特征"),
    PF010("PF010","颗粒物排放特征"),
    PF011("PF011","VOCs排放特征"),
    PF012("PF012","COD排放特征"),
    PF013("PF013","氨氮排放特征"),
    PF014("PF014","总氮排放特征"),
    PF015("PF015","总磷排放特征"),
    JG004("JG004","是否存在执行报告未提交情况"),
    JG005("JG005","1年内是否存在执行报告不规范情况"),
    PF024("PF024","10%<单项重点污染物减排量≤30%"),
    PF026("PF026","单项重点污染物减排量>50%"),
    PF025("PF025","30%<单项重点污染物减排量≤50%"),

    ;
    private String enumId;
    private String enumName;
    LabelFactoryEnum(String enumId,String enumName) {
        this.enumId=enumId;
        this.enumName=enumName;
    }

    public static LabelFactoryEnum getByCode(String code) {
        for (LabelFactoryEnum value : values()) {
            if (value.enumId.equals(code)) {
                return value;
            }
        }
        return null;
    }

    public String getEnumId() {
        return enumId;
    }

    public static List<String> getPollutantEnumIds() {
        return Lists.newArrayList(PF008.getEnumId(), PF009.getEnumId(), PF010.getEnumId(), PF011.getEnumId(), PF012.getEnumId(), PF013.getEnumId(), PF014.getEnumId(), PF015.getEnumId());
    }

    public PcLabelFactory pcLabelFactory(String id, Map<String, PcLabel> pcLabelsMap, String value, String useing, PcLabelFactory pcLabelFactory){
        pcLabelFactory=new PcLabelFactory();
        pcLabelFactory.setFactoryId(id);
        pcLabelFactory.setLabelId(pcLabelsMap.get(enumId).getId());
        pcLabelFactory.setLabelValue(value);
        pcLabelFactory.setLableUseing(useing);
        return pcLabelFactory;
    }
    public PcLabelFactory pcLabelFactoryPollutant(String id, Map<String, PcLabel> pcLabelsMap, String value, String useing, PcLabelFactory pcLabelFactory){
        pcLabelFactory=new PcLabelFactory();
        pcLabelFactory.setFactoryId(id);
        pcLabelFactory.setLabelId(pcLabelsMap.get(enumId).getId());
        pcLabelFactory.setLabelValue(value);
        pcLabelFactory.setLableUseing(useing);
        return pcLabelFactory;
    }

}
