package cn.cecep.talroad.domain;


import cn.cecep.talroad.common.core.web.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;


@ApiModel(value = "企业档案分类表")
@Data
@TableName("pc_archives_factory")
public class PcArchivesFactory extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    private String factoryId;
    private String type;
    private String archivesCode;

    @TableField("is_hide")
    private String hide;

    @TableField("is_follow")
    private String follow;


    public enum Type {
        BASE_INFO("1", "基础档案信息"),
        MONITOR_INFO("2", "监测监控信息"),
        BUSINESS("3", "业务信息")
        ;

        private final String code;
        private final String label;

        Type(String code, String label) {
            this.code = code;
            this.label = label;
        }

        public String getCode() {
            return code;
        }

        public String getLabel() {
            return label;
        }

        public static String getLabelByCode(String code) {
            for (Type value : values()) {
                if (value.getCode().equals(code)) {
                    return value.getLabel();
                }
            }
            return null;
        }
    }

    /**
     * 档案枚举
     */
    public enum Archives {
        A1("1", "基本信息", Type.BASE_INFO, "basicInfo"),
        A2("2", "废气排口档案", Type.BASE_INFO, "flueGas"),
        A3("3", "废水排口档案", Type.BASE_INFO, "outletWater"),
        A4("4", "固废噪声档案", Type.BASE_INFO, "solidWaste"),
        A5("5", "总许可量", Type.BASE_INFO, "permits"),
        A6("6", "特征标签", Type.BASE_INFO, "propertyLabel"),

        A10("10", "企业排放信息", Type.MONITOR_INFO, "enterpriseEmissionInfo"),
        A11("11", "在线监测信息", Type.MONITOR_INFO, "onlineMonitoringInfor"),
        A12("12", "站房运维信息", Type.MONITOR_INFO, "maintenanceInfo"),
        A13("13", "无组织监控", Type.MONITOR_INFO, "unorganizedMonitoring"),
        A14("14", "固危废监控", Type.MONITOR_INFO, "wastemonitoring"),
        A15("15", "分表计电", Type.MONITOR_INFO, "electricityMetering"),
        A16("16", "工况监控", Type.MONITOR_INFO, "operatingModeMetering"),
        A17("17", "门禁监控", Type.MONITOR_INFO, "cardAccess"),
        A18("18", "视频监控", Type.MONITOR_INFO, "videoMonitor"),
        A19("19", "产治排跟踪", Type.MONITOR_INFO, "CZPtrack"),

        A20("20", "排污许可信息", Type.BUSINESS, "pollutantsDischargeLicense"),
        A21("21", "执行报告信息", Type.BUSINESS, "implementationReport"),
        A22("22", "移动执法信息", Type.BUSINESS, "mobileLawEnforcement"),
        A23("23", "三监联动执法信息", Type.BUSINESS, "linkageLawEnforcement"),
        ;

        private final String code;
        private final String label;
        private final Type type;
        private final String url;

        Archives(String code, String label, Type type, String url) {
            this.code = code;
            this.label = label;
            this.type = type;
            this.url = url;
        }

        public String getCode() {
            return code;
        }

        public String getLabel() {
            return label;
        }

        public Type getType() {
            return type;
        }

        public String getUrl() {
            return url;
        }

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

}
