package com.jeequan.jeepay.thirdparty.channel.dgpay.utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DgUtils {

    private static List<Map<String, String>> limitList = new ArrayList<>();

    static {
        Map<String, String> item = new HashMap<>();
        item.put("name", "贵州省");
        item.put("code", "520000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "湖南省");
        item.put("code", "430000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "陕西省");
        item.put("code", "610000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "河南省");
        item.put("code", "410000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "浙江省");
        item.put("code", "330000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "重庆市");
        item.put("code", "500100");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "云南省");
        item.put("code", "530000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "湖北省");
        item.put("code", "420000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "福建省");
        item.put("code", "350000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "宁夏回族自治区");
        item.put("code", "640000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "吉林省");
        item.put("code", "220000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "黑龙江省");
        item.put("code", "230000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "江苏省");
        item.put("code", "320000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "海南省");
        item.put("code", "460000");
        limitList.add(item);

        item = new HashMap<>();
        item.put("name", "青海省");
        item.put("code", "630000");
        limitList.add(item);
    }

    /**
     * 检验银联限制
     * @param provinceCode
     * @return
     */
    public static boolean checkBankLimitArea(String provinceCode) {
        for (Map<String, String> item : limitList) {
            if (provinceCode.equals(item.get("code"))) {
                return false;
            }
        }

        return true;
    }
}
