'提交代码'

dev-discount
胡锐 3 years ago
parent dfb7392515
commit 319cf26b76
  1. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  2. 3
      hai-service/src/main/java/com/hai/common/security/DesUtil.java
  3. 43
      hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java

@ -222,7 +222,7 @@ public class HighTestController {
@ApiOperation(value = "测试")
public ResponseData test3() {
try {
return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.queryBalance());
return ResponseMsgUtil.success(HuiLianTongUnionCardConfig.queryCardInfo());
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e);

@ -251,7 +251,8 @@ public class DesUtil {
/*String s = encode("中国", Charset.forName("UTF-8"),"12345678");
System.out.println(s);*/
String data = "T3xbPEKEXV9+CbBw8D1B+N2jk8xwa55s0Bde48c49YDwYfnUdBVz6Kj4HS2oCA1TTiqJkCUIYa5ckMhJeByBCAMsqu21LmFjb/hdW0y1Tt0Wk5PqmO8FAg==";
//String data = "T3xbPEKEXV9+CbBw8D1B+N2jk8xwa55s0Bde48c49YDwYfnUdBVz6Kj4HS2oCA1TTiqJkCUIYa5ckMhJeByBCAMsqu21LmFjb/hdW0y1Tt0Wk5PqmO8FAg==";
String data = "T3xbPEKEXV9+CbBw8D1B+N2jk8xwa55s0Bde48c49YBr4/b4yBwN2FIVZZn+Xg9KQTDoTCLu3YtByaWh7zPmdcpBr9FGARduhPrwSnYTFJ0VVVSK/UzPWdHN2YYd4yHGQRJ2HEr/1egt2JUHpWr0JA==";
/* {
"success": true,
"message": "ok",

@ -53,7 +53,6 @@ public class HuiLianTongUnionCardConfig {
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;
}
/**
@ -97,5 +96,47 @@ public class HuiLianTongUnionCardConfig {
// 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;
}
}

Loading…
Cancel
Save