/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.apache.commons.lang.StringUtils
 *  org.apache.commons.logging.Log
 *  org.apache.commons.logging.LogFactory
 *  org.springframework.stereotype.Service
 */
package com.hst.common.util;

import com.hst.framework.common.HstSqlMapClientTemplate;
import com.hst.framework.constants.WebConstants;
import java.util.HashMap;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Service;

@Service
public class JhxtInitUtil {
    private static final long serialVersionUID = 3574019451372146643L;
    public static Log _logger = LogFactory.getLog(JhxtInitUtil.class);

    public static void initJhxtUrlMap(String bsdtdjxh) throws Exception {
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("bsdt_djxh", bsdtdjxh);
        HstSqlMapClientTemplate sqlMapClientTemplate = (HstSqlMapClientTemplate)WebConstants.WEB_APP_CONTEXT.getBean("sqlMapClientTemplate");
        sqlMapClientTemplate.queryForObject("queryJhxtTaxUrlByBsdtDjxh", map);
        String url = (String)map.get("url");
        if (StringUtils.isNotBlank((String)url)) {
            WebConstants.JHXT_URL_MAP.put(bsdtdjxh, url);
        }
    }

    public static String doGetJhxtUrl(String bsdtdjxh) throws Exception {
        if (WebConstants.JHXT_URL_MAP.containsKey(bsdtdjxh)) {
            return WebConstants.JHXT_URL_MAP.get(bsdtdjxh);
        }
        JhxtInitUtil.initJhxtUrlMap(bsdtdjxh);
        return WebConstants.JHXT_URL_MAP.get(bsdtdjxh);
    }
}
