Test2.java
1 |
/**
|
---|---|
2 |
* 2016??8??24??
|
3 |
*/
|
4 |
package testPkg; |
5 |
|
6 |
import java.io.UnsupportedEncodingException; |
7 |
import java.util.HashMap; |
8 |
import java.util.Map; |
9 |
|
10 |
import com.single.bean.ReturnBean; |
11 |
import com.singlee.BatchFile.AccountFileDemo; |
12 |
import com.singlee.BatchFile.AccountRequestDemo; |
13 |
import com.singlee.BatchFile.ClientUtils; |
14 |
import com.singlee.BatchFile.FilePayDemo; |
15 |
import com.singlee.BatchFile.FileQueryDemo; |
16 |
import com.singlee.BatchFile.SinglePayDemo; |
17 |
import com.singlee.BatchFile.SingleQueryDemo; |
18 |
import com.google.gson.*; |
19 |
|
20 |
import net.sf.json.JSONArray; |
21 |
|
22 |
/**
|
23 |
* TODO ?????????˵??ע?ͣ?
|
24 |
* @author Administrator
|
25 |
* 2016??8??24??
|
26 |
*/
|
27 |
public class Test2 { |
28 |
public static void main(String[] args){ |
29 |
|
30 |
|
31 |
String filecontent = ClientUtils.zip("451073776100039|0004|20161205|100|1|02||"+"\n"+ |
32 |
// "451073776100039|000020|400|01|6216261000000000018|ȫ????|||ƽ??????|01|341126197709218366|13552535506|||||"+"\n"+
|
33 |
"451073776100039|000021|100|01|6216261000000000018|ȫ????|||ƽ??????|01|341126197709218366|18668931866|||||");
|
34 |
|
35 |
String filename="451073776100039201612051814000004.txt"; |
36 |
|
37 |
|
38 |
|
39 |
for(int i = 0;i<1;i++) { |
40 |
//String str="batchNo=0001&bizCode=H0004&errCode=100001&filename=451073720100030201608261414300001.txt&merchantId=451073720100030&respDate=20160829&respTime=025424&signType=1&version=v1.0&key=null";
|
41 |
//??????ѯ ʧ?ܽ??IJ?ѯ
|
42 |
//String returnMsg=FileQueryDemo.QueryClient("20161017", "214600", "451073720100032201610171122000009.txt", "0009", "451073720100032", "","qdtaqdVpNyxTsFUjbDR1ATXQu9LYJIc4");
|
43 |
|
44 |
//String returnMsg=FileQueryDemo.QueryClient("20161017", "214600", "451073720100032201610171122000011.txt", "0010", "451073720100032", "","qdtaqdVpNyxTsFUjbDR1ATXQu9LYJIc4");
|
45 |
|
46 |
//????????
|
47 |
//String returnMsg=FilePayDemo.PayClient("20161205", "181400", "", filecontent, filename, "0004", "100", "1", "451073776100039","DYO0wU4lcRapGhlPcIlpvUtAJntoqlMT");
|
48 |
|
49 |
Map<String, String> map1 = new HashMap<String, String>(); |
50 |
Map<String, String> map2 = new HashMap<String, String>(); |
51 |
map1.put("merchantId", "451073776100039");//451073720100030 |
52 |
map1.put("orderDate", "20161205"); |
53 |
map1.put("orderTime", "1817"); |
54 |
map1.put("accType", "01"); |
55 |
map1.put("accNo", "6216261000000000018");/ |
56 |
String str123="ȫ????"; |
57 |
// String unicode123 = new String(str123.getBytes(),"GBK");
|
58 |
map1.put("accName", str123);
|
59 |
map1.put("merSeqId", "201612050000024"); |
60 |
map1.put("openBank", "ƽ??????"); |
61 |
map1.put("prov", "hb"); |
62 |
map1.put("city", "hz"); |
63 |
map1.put("transAmt", "100"); |
64 |
map1.put("purpose", "1"); |
65 |
|
66 |
map2.put("certifTp", "01"); |
67 |
map2.put("certifId", "341126197709218366");//370628198004150014 |
68 |
map2.put("customerNm", "ȫ????"); |
69 |
JSONArray json1 = JSONArray.fromObject(map2); |
70 |
map1.put("customerInfo", json1.toString().substring(1,json1.toString().length()-1)); |
71 |
JSONArray json = JSONArray.fromObject(map1); |
72 |
|
73 |
// System.out.println(json.toString().substring(1,json.toString().length()-1));
|
74 |
//System.out.println(json1.toString().substring(1,json1.toString().length()-1));
|
75 |
//???ʴ???
|
76 |
String returnMsg=SinglePayDemo.PayClient(json.toString().substring(1,json.toString().length()-1),"","DYO0wU4lcRapGhlPcIlpvUtAJntoqlMT"); |
77 |
//???ʲ?ѯ
|
78 |
//String returnMsg=SingleQueryDemo.QueryClient("20161205", "1521", "201612050000010", "02", "451073720100032", "", "qdtaqdVpNyxTsFUjbDR1ATXQu9LYJIc4");
|
79 |
|
80 |
Map<String, String> map11 = new HashMap<String, String>(); |
81 |
map11.put("merchantId", "473075600000039");//451073720100030 |
82 |
map11.put("orderDate", "20161108"); |
83 |
map11.put("orderTime", "135001"); |
84 |
map11.put("transDate", "20161107"); |
85 |
map11.put("bizCode", "H0005"); |
86 |
JSONArray json2 = JSONArray.fromObject(map11); |
87 |
|
88 |
//????????
|
89 |
//String returnMsg=AccountRequestDemo.AccountClient(json2.toString().substring(1,json2.toString().length()-1),"","oiwwH8N5l46VNPmYDzbIwp7wgB8dl2aj");
|
90 |
|
91 |
//????????
|
92 |
//String returnMsg=AccountFileDemo.AccountFileClient("451073720100032", "20161017", "135001", "20161012", "","qdtaqdVpNyxTsFUjbDR1ATXQu9LYJIc4");
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
System.out.println("???ؽ????"+returnMsg); |
98 |
//System.out.println("??"+i+"?β?ѯ");
|
99 |
|
100 |
} |
101 |
} |
102 |
|
103 |
|
104 |
} |