package com.yxcheng.token.utils;

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

/**
 * @ProjectName: tax-sys-test
 * @Package: com.yxcheng.token.constants
 * @ClassName: FileDownloadContants
 * @Author: ddx
 * @Description: ${description}
 * @Date: 2022-01-17 14:48
 * @Version: 1.0
 */
public class FileDownloadUtil {

    public static Map<String, String> gxDic = null;
    public static Map<String, String> gxAllDic = null;
    public static Map<String, String> invTypeDicG = null;
    public static Map<String, String> invTypeDicX = null;
    public static Map<String, String> forceFlagDic = null;

    static {
        gxDic = new HashMap<String, String>();
        gxDic.put("1", "进项");
        gxDic.put("2", "销项");

        gxAllDic = new HashMap<String, String>();
        gxAllDic.put("0", "全部");
        gxAllDic.putAll(gxDic);

        invTypeDicX = new HashMap<String, String>();
        invTypeDicX.put("01", "增值税专用发票");
        invTypeDicX.put("03", "机动车销售统一发票");
        invTypeDicX.put("10", "增值税普通发票（电子）");
        invTypeDicX.put("04", "增值税普通发票");
        invTypeDicX.put("08", "增值税专用发票（电子）");
        invTypeDicX.put("11", "增值税普通发票（卷票）");
        invTypeDicX.put("14", "道路通行费电子普通发票");
        invTypeDicX.put("15", "二手车销售统一发票");
        invTypeDicX.put("81", "电子发票（增值税专用发票）");
        invTypeDicX.put("82", "电子发票（普通发票）");
        invTypeDicX.put("83", "电子发票（铁路电子客票）");
        invTypeDicX.put("84", "纸质发票（增值税专用发票）");
        invTypeDicX.put("85", "纸质发票（增值税普通发票）");

        invTypeDicX.put("73", "机动车销售电子统一发票");
        invTypeDicX.put("86", "二手车销售电子统一发票");
        invTypeDicX.put("61", "电子发票（航空运输电子客票行程单）");
        invTypeDicX.put("87", "纸质发票（机动车销售统一发票）");
        invTypeDicX.put("88", "纸质发票（二手车销售统一发票）");

        invTypeDicG = new HashMap<String, String>();
        invTypeDicG.putAll(invTypeDicX);
        invTypeDicG.put("17", "海关缴款书");

        forceFlagDic = new HashMap<String, String>();
        forceFlagDic.put("0", "正常");
        forceFlagDic.put("1", "强制");
    }

    public static boolean checkForceFlag(String forceFlag) {
        return forceFlagDic.containsKey(forceFlag);
    }

    public static boolean checkInvSpec(String invSpec) {
        return gxDic.containsKey(invSpec);
    }

    public static boolean checkAllInvSpec(String invSpec) {
        return gxAllDic.containsKey(invSpec);
    }

    public static boolean checkInvType(String invSpec, String invType) {
        boolean checkInvTypeFlag = false;
        if(invSpec.equals(INVTYPE_INCOME)) {
            checkInvTypeFlag = invTypeDicG.containsKey(invType);
        } else {
            checkInvTypeFlag = invTypeDicX.containsKey(invType);
        }
        return checkInvTypeFlag;
    }


    //进项
    public static String INVTYPE_INCOME = "1";
    //销项
    public static String INVTYPE_SALE = "2";
}
