|
@@ -8,21 +8,37 @@ import org.apache.commons.httpclient.methods.PostMethod;
|
|
|
import java.io.*;
|
|
|
import java.util.Iterator;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ * Created by zhangqingxin Date : 16/11/6 Time : 10:41
|
|
|
+ * <p/>
|
|
|
+ * 参考一(HttpClient):http:
|
|
|
+ * httpclient/3.1
|
|
|
+ * 参考一(json-lib):http:
|
|
|
+ */
|
|
|
public class QueryDemo_Test {
|
|
|
|
|
|
|
|
|
* 测试地址
|
|
|
*/
|
|
|
- private static final String URL = "http://etc.jkcredit.com:9999/api/rest";
|
|
|
-
|
|
|
+ private static final String URL = "http://etc.jkcredit.com:9999/api/rest";
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
* 分配的appKey
|
|
|
*/
|
|
|
-
|
|
|
+
|
|
|
|
|
|
- private static final String appKey = "xxxxxx";
|
|
|
+ private static final String appKey = "jkxy";
|
|
|
+
|
|
|
|
|
|
|
|
|
* 方法入口
|
|
@@ -60,10 +76,12 @@ public class QueryDemo_Test {
|
|
|
* 基本参数
|
|
|
*/
|
|
|
JSONObject paramJsonObj = new JSONObject();
|
|
|
- paramJsonObj.put("api", "PROTOCOL_ADD_V1");
|
|
|
+ paramJsonObj.put("api", "RED_INK_INVOICE_QUERY");
|
|
|
+
|
|
|
paramJsonObj.put("appKey", appKey);
|
|
|
paramJsonObj.put("appSecret",
|
|
|
- "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
|
|
|
+ "7697CE9BB9D5A856CFDDE738320AD34EA53E483C");
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -87,13 +105,16 @@ public class QueryDemo_Test {
|
|
|
* 具体业务参数放在data中
|
|
|
*/
|
|
|
JSONObject dataJson = new JSONObject();
|
|
|
-
|
|
|
- dataJson.put("companyNum", "xxxxxx");
|
|
|
- dataJson.put("serviceStartTime","2022-05-16T11:30:37");
|
|
|
- dataJson.put("serviceEndTime","2023-05-16T21:30:37");
|
|
|
- dataJson.put("contractFileName","xxxxxx测试20220516.pdf");
|
|
|
- dataJson.put("serviceType","3");
|
|
|
- dataJson.put("base64Str",Base64Utils.fileToBase64Str(new File("/Users/mashengyi/Desktop/xxxxxx.pdf")));
|
|
|
+
|
|
|
+ dataJson.put("id_number","371081198911276112");
|
|
|
+ dataJson.put("mobile","15562139518");*/
|
|
|
+ dataJson.put("taxplayerCode", "91149900MA0LBCKM6F");
|
|
|
+ dataJson.put("month", "2022-04");
|
|
|
+ dataJson.put("pageNo", 1);
|
|
|
+
|
|
|
+
|
|
|
+ list.add("13752639577");
|
|
|
+ dataJson.put("msisdnmd5list",list);*/
|
|
|
return dataJson;
|
|
|
}
|
|
|
|
|
@@ -144,7 +165,7 @@ public class QueryDemo_Test {
|
|
|
public static String convertStreamToString(InputStream is) {
|
|
|
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
- String line = null;
|
|
|
+ String line = null;
|
|
|
try {
|
|
|
while ((line = reader.readLine()) != null) {
|
|
|
builder.append(line + "\n");
|