/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  net.sf.json.JSONObject
 *  org.apache.commons.httpclient.Header
 *  org.apache.commons.httpclient.HttpClient
 *  org.apache.commons.httpclient.HttpMethod
 *  org.apache.commons.httpclient.methods.PostMethod
 *  org.apache.commons.logging.Log
 *  org.apache.commons.logging.LogFactory
 */
package com.hst.taxService.service.imp;

import com.hst.common.util.Base64;
import com.hst.common.util.HstJsonUtil;
import com.hst.taxService.domain.wxfwh.PubGetPicReturnDomain;
import com.hst.taxService.service.imp.TestPost;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import net.sf.json.JSONObject;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class TestWxqyh {
    public static Log _logger = LogFactory.getLog(TestWxqyh.class);

    public static void main(String[] args) throws IOException, InstantiationException, IllegalAccessException {
        String url = "http://127.0.0.1:8088/taxService/service/taxWxqyhCommonApp!doWxqyhService";
        url = "http://bs.baishuichina.com/taxZfService/service/taxCommon!doService";
        String charset = "GBK";
        HashMap<String, String> params = new HashMap<String, String>();
        params.put("domain.ywId", "wxqyh.PubGetSwryxx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.PubGetSwryxx\",\"swjgdm\":\"13301910000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919991\"}");
        params.put("domain.ywId", "wxqyh.YbsxSltjCx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.YbsxSltjCx\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919502\",ckbz:\"N\" ,r}");
        params.put("domain.ywId", "wxqyh.YbsxGztxCx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.YbsxGztxCx\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919502\" }");
        params.put("domain.ywId", "wxqyh.WbsxTzcx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WddwFxList\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919502\" }");
        params.put("domain.ywId", "wxqyh.WddwFxDzSave");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WddwFxDzSave\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919502\" ,fxdj_xh:\"1000000032\",dzbz:\"Y\"}");
        params.put("domain.ywId", "wxqyh.WddwFxPlSave");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WddwFxPlSave\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919502\" ,fxdj_xh:\"1000000032\",hfnr:\"\u56de\u590d\u5185\u5bb9\"}");
        params.put("domain.ywId", "wxqyh.WddwHysList");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WddwHysList\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919502\"    }");
        params.put("domain.ywId", "wxqyh.WddwClList");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WddwClList\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919502\"    }");
        params.put("domain.ywId", "wxqyh.GrzxGrszSave");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.GrzxGrszSave\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"1\" , \"dataList\":[{\"csbm\":\"1001\",\"csszz\":\"1\"},{\"csbm\":\"1002\",\"csszz\":\"2222\"}]}");
        params.put("domain.ywId", "wxqyh.PubGetBmqzRyxx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.PubGetBmqzRyxx\",\"swjgdm\":\"13301910000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919508\" }");
        params.put("domain.ywId", "wxqyh.WbsxHyssqSave");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WbsxHyssqSave\",\"swjgdm\":\"13301910000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919508\",sqrq:\"2016-10-25\" ,sqsysjq:\"2016-10-21 11:11:11\",sqsysjz:\"2016-10-21 13:11:11\",hysm:\"\u56de\u5fc6\u8bf4\u660e\",flag:\"1\",hysdjxh:\"111111\",dd:\"\u4f1a\u8bae\u5ba4\u5730\u70b9\",zrfy:\"10000\",bz:\"\u4e2d\u9910\",sfyjsb:\"Y\",hybt:\"\u535a\u963f\u76ae\u4e9a\",chrybz:\"3\",dataList:[{chr_swrydm:\"13301919508\"},{chr_swrydm:\"13301919507\"},{chr_swrydm:\"13301919506\"}]}");
        params.put("domain.ywId", "wxqyh.WbsxHysysqxx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WbsxHysysqxx\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919508\" ,page:\"1\"}");
        params.put("domain.ywId", "wxqyh.WbsxHyssqCxmx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WbsxHyssqCxmx\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919508\",sxsqxh:\"1000000074\" }");
        params.put("domain.ywId", "wxqyh.GrzxWdhyBgchry");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.GrzxWdhyBgchry\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919508\",hyfb_djxh:\"1000000074\",chr_swry_dm:\"13301919501\"}");
        params.put("domain.ywId", "wxqyh.WbsxHyssqSave");
        params.put("domain.ParmJson", "{\"uid\":\"\",\"sid\":\"\",\"kz\":\"\",\"swrydm\":\"13301919504\",\"bz\":\"11\",\"sqsysjz\":\"2017-01-08 01:01:00\",\"hybt\":\"11\",\"sfyjsb\":\"Y\",\"hysm\":\"1\",\"ver\":\"1.0\",\"sqsysjq\":\"2017-01-07 01:01:00\",\"dd\":\"\",\"flag\":\"1\",\"hysdjxh\":\"1000000881\",\"swjgdm\":\"13301910000\",\"zrfy\":\"\",\"chrybz\":\"1\",\"sqrq\":\"2017-01-07\",\"bid\":\"wxqyh.WbsxHyssqSave\",\"chr_swrydm\":\"[]\"}");
        params.put("domain.ywId", "wxqyh.PubGetHysxx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.PubGetHysxx\",\"swjgdm\":\"13301910000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919502\",hysjq:\"2017-01-08 09:00:00\",hysjz:\"2017-01-08 10:00:00\"}");
        params.put("domain.ywId", "wxqyh.WbsxYcsqCxmx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WbsxYcsqCxmx\",\"swjgdm\":\"13301910000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919504\",sxsqxh:\"1000003586\" }");
        params.put("domain.ywId", "wxqyh.PubGetClxx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.PubGetClxx\",\"swjgdm\":\"13301910000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919504\" ,ycsjq:\"2017-01-11 00:00:00\",ycsjz:\"2017-01-12 00:00:00\" }");
        params.put("domain.ywId", "wxqyh.YbsxClapSave");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.YbsxClapSave\",\"swjgdm\":\"13301910000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919504\" ,ycsj_q:\"2017-01-11 00:00:00\",ycsj_z:\"2017-01-12 00:00:00\",pc_djxh:\"1\" }");
        params.put("domain.ywId", "wxqyh.YbsxClapCx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.YbsxClapCx\",\"swjgdm\":\"13301910000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919504\" ,ycsj_q:\"2017-01-11 00:00:00\",pczt:\"0\" }");
        params.put("domain.ywId", "wxqyh.GrzxKqNjxjcx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.GrzxKqNjxjcx\",\"swjgdm\":\"1\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"1\"   }");
        params.put("domain.ywId", "wxqyh.WbsxTzSave");
        params.put("domain.ywId", "wxqyh.WddwQxList");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WddwQxList\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919502\" ,swbmdm:\"11\"  }");
        params.put("domain.ywId", "wxqyh.GrzxKqYdkqcx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.GrzxKqYdkqcx\",\"swjgdm\":\"1\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301919501\"  ,ssyf:\"2017-02-01\" }");
        params.put("domain.ywId", "wxqyh.GrzxRzCsrz");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.GrzxRzCsrz\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301911609\",rcdj_xh:\"1000000034\" ,rq:\"2017-02-20\",rznr:\" \u5185\u751f22222\",sftx:\"N\",txsj_dm:\"1\"}");
        params.put("domain.ywId", "wxqyh.WbsxWcsqSave");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WbsxWcsqSave\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301911609\" ,sqrq:\"2017-02-20\",sqwcsjq:\" 2017-02-20 09:00:00\",sqwcsjz:\"2017-02-20 19:00:00\",shiy:\"shiy\",wcdd:\"wcdd\",xtry:\"bzsm\",sfjd:\"N\",bzsm:\"bzsm\"}");
        params.put("domain.ywId", "wxqyh.WbsxWcysqxx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WbsxWcysqxx\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301911609\"   }");
        params.put("domain.ywId", "wxqyh.WbsxWcsqCxmx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WbsxWcsqCxmx\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301911609\",sxsqxh:\"1000000123\"   }");
        params.put("domain.ywId", "wxqyh.WbsxWcsqQx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WbsxWcsqQx\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",swrydm:\"13301911609\",sxsqxh:\"1000000123\"   }");
        params.put("domain.ywId", "wxqyh.WzhhyHylistCx");
        params.put("domain.ParmJson", "{\"uid\":\"ea16224e51\",\"bid\":\"wxqyh.WzhhyHylistCx\",\"swjgdm\":\"13301000000\",\"sid\":\"\",\"kz\":\"\",\"ver\":\"1.0\",rq:\"2017-04-26\" ,rylb:\"1\",login:\"01\" ,wzhhy_djxh:\"1000020742\" }");
        String str = TestPost.doPost(url, params, charset, true);
        System.out.println(str);
    }

    public static String doPost(String url, Map<String, String> params, String charset, boolean pretty) {
        StringBuffer response;
        block10: {
            response = new StringBuffer();
            HttpClient client = new HttpClient();
            PostMethod post = new PostMethod(url);
            post.setRequestHeader(new Header("Content-type", "application/x-www-form-urlencoded;charset=utf-8"));
            post.setRequestHeader(new Header("User-Agent", "Mozilla/5.0 /Windows; U; Windows NT 4.1; de; rv:1.9.1.5) Gecko/20091102 Firefox/3.0"));
            if (params != null) {
                for (Map.Entry<String, String> entry : params.entrySet()) {
                    post.setParameter(entry.getKey(), entry.getValue());
                }
            }
            try {
                try {
                    client.executeMethod((HttpMethod)post);
                    if (post.getStatusCode() == 200) {
                        String line;
                        BufferedReader reader = new BufferedReader(new InputStreamReader(post.getResponseBodyAsStream(), charset));
                        while ((line = reader.readLine()) != null) {
                            if (pretty) {
                                response.append(line).append(System.getProperty("line.separator"));
                                continue;
                            }
                            response.append(line);
                        }
                        reader.close();
                    }
                }
                catch (IOException e) {
                    _logger.error((Object)("\u6267\u884cHTTP Post\u8bf7\u6c42" + url + "\u65f6\uff0c\u53d1\u751f\u5f02\u5e38\uff01"), (Throwable)e);
                    post.releaseConnection();
                    break block10;
                }
            }
            catch (Throwable throwable) {
                post.releaseConnection();
                throw throwable;
            }
            post.releaseConnection();
        }
        return response.toString();
    }

    protected static void getPic(String imgStr) {
        try {
            JSONObject jsonObject = JSONObject.fromObject((Object)imgStr);
            JSONObject retJson = JSONObject.fromObject((Object)jsonObject.getJSONObject("dsyyqh"));
            String resultJson = retJson.getString("retJson");
            JSONObject jsonObject1 = JSONObject.fromObject((Object)resultJson);
            PubGetPicReturnDomain domain = HstJsonUtil.jsonToBean(jsonObject1.getString("result"), PubGetPicReturnDomain.class);
            byte[] b = Base64.stringToByte(domain.getPic());
            int i = 0;
            while (i < b.length) {
                if (b[i] < 0) {
                    int n = i;
                    b[n] = (byte)(b[n] + 256);
                }
                ++i;
            }
            String imgFilePath = "d:\\Toolbar_h.png";
            FileOutputStream out = new FileOutputStream(imgFilePath);
            ((OutputStream)out).write(b);
            out.flush();
            ((OutputStream)out).close();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static byte[] getBytesFromFile(String filePath) {
        File f = new File(filePath);
        if (f.isDirectory()) {
            return null;
        }
        try {
            int n;
            FileInputStream stream = new FileInputStream(f);
            ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
            byte[] b = new byte[1024];
            while ((n = stream.read(b)) != -1) {
                out.write(b, 0, n);
            }
            stream.close();
            out.close();
            return out.toByteArray();
        }
        catch (IOException iOException) {
            return null;
        }
    }
}
