package com.tax.sign.constants;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Configuration
public class SignConstants {

    //token请求最大次数
    public static int REQ_MAX_TIMES = 5;

    public static int TOKEN_VALID_TIME = 5 * 60;
    //token在途重试最大次数
    public static int RETRY_MAX_TIMES = 10;

    //token有效
    public static final String TOKEN_VALID = "1";
    //token在途
    public static String TOKEN_ON_THE_WAY = "2";
    //
    public static String SERVER_LOCAL = "1";
    //第三方服务
    public static String SERVER_THIRD = "2";


    //第三方token所需信息
    public static String TOKEN_CHECK_RUNGETTOKEN = null;
    public static String TOKEN_CHECK_USERNAME = null;
    public static String TOKEN_CHECK_PASSWORD = null;

    public static String TOKEN_FROM = null;

    public static String BRANCH_ZONECODES = null;

    public static String dateInfoUrlSuffix = "SbsqWW/querymm.do";


    //服务时间来源
    public static String LOCAL_EXE_SERVER_DATE_WAY = "1";


    public static Long SERVER_LOCAL_EXPECT_TIME_DIFF = 4 * 60 * 1000L;


    public static String signType;

    public static String loginSignType;

    public static String timeToChage;

    public static String loginSignNewProvince;

    public static String pushTokenFlag;

    public static String dateInfoUrl;


    @Value("${constants.signType}")
    public  void setSignType(String signType) {
        this.signType = signType;
    }

    @Value("${constants.loginSignType}")
    public  void setLoginSignType(String loginSignType) {
        SignConstants.loginSignType = loginSignType;
    }

    @Value("${constants.timeToChage}")
    public  void setTimeToChage(String timeToChage) {
        this.timeToChage = timeToChage;
    }

    @Value("${constants.loginSignNewProvince}")
    public  void setLoginSignNewProvince(String loginSignNewProvince) {
        SignConstants.loginSignNewProvince = loginSignNewProvince;
    }

    @Value("${constants.pushTokenFlag}")
    public  void setPushTokenFlag(String pushTokenFlag) {
        SignConstants.pushTokenFlag = pushTokenFlag;
    }

    @Value("${constants.dateInfoUrl}")
    public  void setDateInfoUrl(String dateInfoUrl) {
        SignConstants.dateInfoUrl = dateInfoUrl;
    }

    public static Map<String, String> urlMap;
    static {
        urlMap = new HashMap<String, String>();
        urlMap.put("1100", "https://fpdk.bjsat.gov.cn/");
        urlMap.put("1200", "https://fpdk.tjsat.gov.cn/");
        urlMap.put("1300", "https://fpdk.he-n-tax.gov.cn:81/");
        urlMap.put("1400", "https://fpdk.tax.sx.cn/");
        urlMap.put("1500", "https://fpdk.nm-n-tax.gov.cn/");
        urlMap.put("2100", "https://fpdk.tax.ln.cn/");
        urlMap.put("2102", "https://fpdk.dlntax.gov.cn/");
        urlMap.put("2200", "https://fpdk.jl-n-tax.gov.cn:4431/");
        urlMap.put("2300", "https://fpdk.hl-n-tax.gov.cn/");
        urlMap.put("3100", "https://fpdk.tax.sh.gov.cn/");
        urlMap.put("3200", "https://fpdk.jsgs.gov.cn:81/");
        urlMap.put("3300", "https://fpdk.zjtax.gov.cn/");
        urlMap.put("3302", "https://fpdk.nb-n-tax.gov.cn/");
        urlMap.put("3400", "https://fpdk.ah-n-tax.gov.cn/");
        urlMap.put("3500", "https://fpdk.fj-n-tax.gov.cn/");
        urlMap.put("3502", "https://fpdk.xm-n-tax.gov.cn/");
        urlMap.put("3600", "https://fpdk.jxgs.gov.cn/");
        urlMap.put("3700", "https://fpdk.sd-n-tax.gov.cn/");
        urlMap.put("3702", "https://fpdk.qd-n-tax.gov.cn/");
        urlMap.put("4100", "https://fpdk.ha-n-tax.gov.cn/");
        urlMap.put("4200", "https://fpdk.hb-n-tax.gov.cn/");
        urlMap.put("4300", "https://fpdk.hntax.gov.cn/");
        urlMap.put("4400", "https://fpdk.gd-n-tax.gov.cn/");
        urlMap.put("4403", "https://fpdk.szgs.gov.cn/");
        urlMap.put("4500", "https://fpdk.gxgs.gov.cn/");
        urlMap.put("4600", "https://fpdk.hitax.gov.cn/");
        urlMap.put("5000", "https://fpdk.cqsw.gov.cn/");
        urlMap.put("5100", "https://fpdk.sc-n-tax.gov.cn/");
        urlMap.put("5200", "https://fpdk.gz-n-tax.gov.cn/");
        urlMap.put("5300", "https://fpdk.yngs.gov.cn/");
        urlMap.put("5400", "https://fpdk.xztax.gov.cn/");
        urlMap.put("6100", "https://fprzweb.sn-n-tax.gov.cn/");
        urlMap.put("6200", "https://fpdk.gs-n-tax.gov.cn/");
        urlMap.put("6300", "http://fpdk.qh-n-tax.gov.cn/");
        urlMap.put("6400", "https://fpdk.nxgs.gov.cn/");
        urlMap.put("6500", "https://fpdk.xj-n-tax.gov.cn/");
    }


}
