|
|
@ -53,7 +53,6 @@ public class HuiLianTongUnionCardConfig { |
|
|
|
map.put("sign", MD5Util.MD5Encode(str, "UTF-8").toUpperCase()); |
|
|
|
map.put("sign", MD5Util.MD5Encode(str, "UTF-8").toUpperCase()); |
|
|
|
System.out.println(MapUtils.getString(map, "sign")); |
|
|
|
System.out.println(MapUtils.getString(map, "sign")); |
|
|
|
return HttpsUtils.doPost("http://hltgz.com:4010/api/v2/execute.json", JSON.toJSONString(map)); |
|
|
|
return HttpsUtils.doPost("http://hltgz.com:4010/api/v2/execute.json", JSON.toJSONString(map)); |
|
|
|
// return null;
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -97,5 +96,47 @@ public class HuiLianTongUnionCardConfig { |
|
|
|
// return null;
|
|
|
|
// return null;
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取token |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
* @throws Exception |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static JSONObject queryCardInfo() throws Exception { |
|
|
|
|
|
|
|
// 签名码
|
|
|
|
|
|
|
|
String signCode = "F8E91A3C"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new LinkedHashMap<>(); |
|
|
|
|
|
|
|
map.put("accessCode", "6FCAE1470CEF465988351BB65ABAA8AE"); |
|
|
|
|
|
|
|
map.put("requestId", new Date().getTime()); |
|
|
|
|
|
|
|
map.put("method", "qgk/queryCardInfo"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 业务数据
|
|
|
|
|
|
|
|
Map<String,Object> dataMap = new HashMap<>(); |
|
|
|
|
|
|
|
dataMap.put("cardNo", "8800030115015107746"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 转换成json
|
|
|
|
|
|
|
|
String dataJson = JSONObject.toJSONString(dataMap); |
|
|
|
|
|
|
|
System.out.println(dataJson); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DES加密
|
|
|
|
|
|
|
|
map.put("data", DesUtil.encode(dataJson, Charset.forName("UTF-8"),signCode)); |
|
|
|
|
|
|
|
System.out.println(MapUtils.getString(map,"data")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 数据签名字符串
|
|
|
|
|
|
|
|
String str = (MapUtils.getString(map,"accessCode")+signCode); |
|
|
|
|
|
|
|
str +=(MapUtils.getString(map,"requestId")+signCode) ; |
|
|
|
|
|
|
|
str += (MapUtils.getString(map,"method") + signCode); |
|
|
|
|
|
|
|
str += (MapUtils.getString(map,"data") + signCode); |
|
|
|
|
|
|
|
System.out.println(str); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MD5加密
|
|
|
|
|
|
|
|
map.put("sign", MD5Util.MD5Encode(str, "UTF-8").toUpperCase()); |
|
|
|
|
|
|
|
System.out.println(MapUtils.getString(map, "sign")); |
|
|
|
|
|
|
|
return HttpsUtils.doPost("http://hltgz.com:4010/api/v2/execute.json", JSON.toJSONString(map)); |
|
|
|
|
|
|
|
// return null;
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|