package com.gyee.wisdom.xfai.net3.service;

import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.HashSet;

@Service
public class CacheService {
    HashMap<String, String> orgNameMap;
    public String getOrgName(String info) {
        if (orgNameMap == null) {
            orgNameMap = new HashMap<>();
            orgNameMap.put("GS","公司");
            orgNameMap.put("FD","公司风电");
            orgNameMap.put("GF","公司光伏");
            orgNameMap.put("MHS","麻黄山风电场");
            orgNameMap.put("NSS","牛首山风电场");
            orgNameMap.put("QS","青山风电场");
            orgNameMap.put("SBQ","石板泉风电场");
            orgNameMap.put("XS","香山风电场");
            orgNameMap.put("DWK","大武口光电场");
            orgNameMap.put("PL","平罗光电场");
            orgNameMap.put("XH","宣和光电场");
            orgNameMap.put("MCH","马场湖光电场");
            orgNameMap.put("YC","银川市");
        }
        if(orgNameMap.containsKey(info)){
            return orgNameMap.get(info);
        }else {
            return info;
        }
    }
    HashMap<String, String> orgIdMap;
    public String getOrgId(String info) {
        if (orgIdMap == null) {
            orgIdMap = new HashMap<>();
            orgIdMap.put("GS","0");
            orgIdMap.put("FD","-1");
            orgIdMap.put("GF","-2");
            orgIdMap.put("MHS","MHS_FDC");
            orgIdMap.put("NSS","NSS_FDC");
            orgIdMap.put("QS","QS_FDC");
            orgIdMap.put("SBQ","SBQ_FDC");
            orgIdMap.put("XS","XS_FDC");
            orgIdMap.put("DWK","DWK_GDC");
            orgIdMap.put("PL","PL_GDC");
            orgIdMap.put("XH","XH_GDC");
        }
        if(orgIdMap.containsKey(info)){
            return orgIdMap.get(info);
        }else {
            return info;
        }
    }

    private HashMap<String, String> RFDLPointMap;
    public HashMap<String, String> getRFDLPointMap() {
        if (RFDLPointMap == null) {
            RFDLPointMap = new HashMap<>();
            RFDLPointMap.put("GS","JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0088");
            RFDLPointMap.put("FD","JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0088");
            RFDLPointMap.put("GF","JSFW.NX_GD_GDC_XX_XX_XXX_XXX_CI0088");
            RFDLPointMap.put("MHS","MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0088");
            RFDLPointMap.put("NSS","NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0088");
            RFDLPointMap.put("QS","QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0088");
            RFDLPointMap.put("SBQ","SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0088");
            RFDLPointMap.put("XS","XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0088");
            RFDLPointMap.put("DWK","DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0088");
            RFDLPointMap.put("PL","PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0088");
            RFDLPointMap.put("XH","XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0088");
        }
        return RFDLPointMap;
    }
    public String getRFDLTagId(String org) {
        return getRFDLPointMap().get(org);
    }
    private HashMap<String, String> YFDLPointMap;
    public HashMap<String,String> getYFDLPointMap(){
        if (YFDLPointMap == null){
            YFDLPointMap = new HashMap<>();
            YFDLPointMap.put("GS","JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0146");
            YFDLPointMap.put("FD","JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0146");
            YFDLPointMap.put("GF","JSFW.NX_GD_GDC_XX_XX_XXX_XXX_CI0146");
            YFDLPointMap.put("MHS","MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0146");
            YFDLPointMap.put("NSS","NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0146");
            YFDLPointMap.put("QS","QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0146");
            YFDLPointMap.put("SBQ","SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0146");
            YFDLPointMap.put("XS","XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0146");
            YFDLPointMap.put("DWK","DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0146");
            YFDLPointMap.put("PL","PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0146");
            YFDLPointMap.put("XH","XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0146");
        }
        return YFDLPointMap;
    }
    public String getYFDLTagId(String org){
        return getYFDLPointMap().get(org);
    }
    private HashMap<String,String> NFDLPointMap;
    public HashMap<String,String> getNFDLPointMap(){
        if (NFDLPointMap == null){
            NFDLPointMap = new HashMap<>();
            NFDLPointMap.put("GS","JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0037");
            NFDLPointMap.put("FD","JSFW.NX_GD_FDC_XX_XX_XXX_XXX_CI0037");
            NFDLPointMap.put("GF","JSFW.NX_GD_GDC_XX_XX_XXX_XXX_CI0037");
            NFDLPointMap.put("MHS","MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0037");
            NFDLPointMap.put("NSS","NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0037");
            NFDLPointMap.put("QS","QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0037");
            NFDLPointMap.put("SBQ","SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0037");
            NFDLPointMap.put("XS","XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0037");
            NFDLPointMap.put("DWK","DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0037");
            NFDLPointMap.put("PL","PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0037");
            NFDLPointMap.put("XH","XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0037");
        }
        return NFDLPointMap;
    }
    public String getNFDLTagId(String org){
        return getNFDLPointMap().get(org);
    }
    private HashMap<String,String> malFunctionMap;
    public String getFaultPoint(String info){
        if (malFunctionMap == null){
            malFunctionMap = new HashMap<>();
            malFunctionMap.put("GS","JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0016");
            malFunctionMap.put("MHS","MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0016");
            malFunctionMap.put("XS","XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0016");
            malFunctionMap.put("QS","QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0016");
            malFunctionMap.put("SBQ","SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0016");
            malFunctionMap.put("NSS","NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0016");
            malFunctionMap.put("PL","PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0016");
            malFunctionMap.put("DWK","DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0016");
            malFunctionMap.put("XH","DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0016");
            malFunctionMap.put("MCH","MCHGDCJSFW.NX_GD_MCHG_XX_XX_XXX_XXX_CI0016");
        }
        if(malFunctionMap.containsKey(info)){
            return malFunctionMap.get(info);
        }else {
            return info;
        }
    }
    private HashMap<String,String> mainTainMap;
    public String getMainTainPoint(String info){
        if (mainTainMap == null){
            mainTainMap = new HashMap<>();
            mainTainMap.put("GS","JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0141");
            mainTainMap.put("MHS","MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0141");
            mainTainMap.put("XS","XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0141");
            mainTainMap.put("QS","QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0141");
            mainTainMap.put("SBQ","SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0141");
            mainTainMap.put("PL","PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0141");
            mainTainMap.put("NSS","NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0141");
            mainTainMap.put("DWK","DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0141");
            mainTainMap.put("XH","XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0141");
            mainTainMap.put("MCH","MCHGDCJSFW.NX_GD_MCHG_XX_XX_XXX_XXX_CI0141");
        }
        if(mainTainMap.containsKey(info)){
            return mainTainMap.get(info);
        }else {
            return info;
        }
    }
    private HashMap<String,String> limitPointMap;
    public String getLimitPoint(String info){
        if (limitPointMap == null){
            limitPointMap = new HashMap<>();
            limitPointMap.put("GS","JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0142");
            limitPointMap.put("MHS","MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0142");
            limitPointMap.put("XS","XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0142");
            limitPointMap.put("QS","QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0142");
            limitPointMap.put("SBQ","SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0142");
            limitPointMap.put("PL","PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0142");
            limitPointMap.put("NSS","NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0142");
            limitPointMap.put("DWK","DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0142");
            limitPointMap.put("XH","XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0142");
            limitPointMap.put("MCH","MCHGDCJSFW.NX_GD_MCHG_XX_XX_XXX_XXX_CI0142");
        }
        if(limitPointMap.containsKey(info)){
            return limitPointMap.get(info);
        }else {
            return info;
        }
    }
    private HashMap<String,String> OffLinePointMap;
    public String getOffLinePoint(String info){
        if (OffLinePointMap == null){
            OffLinePointMap = new HashMap<>();
            OffLinePointMap.put("GS","JSFW.NX_GD_XXX_XX_XX_XXX_XXX_CI0035");
            OffLinePointMap.put("MHS","MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0035");
            OffLinePointMap.put("XS","XSFCJSFW.NX_GD_XSF_XX_XX_XXX_XXX_CI0035");
            OffLinePointMap.put("QS","QSFCJSFW.NX_GD_QSF_XX_XX_XXX_XXX_CI0035");
            OffLinePointMap.put("SBQ","SBQFCJSFW.NX_GD_SBQF_XX_XX_XXX_XXX_CI0035");
            OffLinePointMap.put("PL","PLGDCJSFW.NX_GD_PLG_XX_XX_XXX_XXX_CI0035");
            OffLinePointMap.put("NSS","NSSFCJSFW.NX_GD_NSSF_XX_XX_XXX_XXX_CI0035");
            OffLinePointMap.put("DWK","DWKGDCJSFW.NX_GD_DWKG_XX_XX_XXX_XXX_CI0035");
            OffLinePointMap.put("XH","XHGDCJSFW.NX_GD_XHG_XX_XX_XXX_XXX_CI0035");
            OffLinePointMap.put("MCH","MCHGDCJSFW.NX_GD_MCHG_XX_XX_XXX_XXX_CI0035");
        }
        if(OffLinePointMap.containsKey(info)){
            return OffLinePointMap.get(info);
        }else {
            return info;
        }
    }
    private HashMap<String,String> powerStationMap;
    public HashMap<String,String> getPowerStationMap(){
        if (powerStationMap == null){
            powerStationMap = new HashMap<>();
            powerStationMap.put("NSS","99");
            powerStationMap.put("MHS","43");
            powerStationMap.put("QS","91");
            powerStationMap.put("SBQ","116");
            powerStationMap.put("XS","58");
            powerStationMap.put("PL","61");
            powerStationMap.put("DWK","20");
            powerStationMap.put("XH","42");
        }
        return powerStationMap;
    }
    public String getPowerStationNum(String org){
        return getPowerStationMap().get(org);
    }

}
