|
|
|
@ -35,12 +35,12 @@ public class SynchronizeCNPC { |
|
|
|
|
tokenMap.put("appId", "jsVpwDoHZfR2rrpjhA"); |
|
|
|
|
tokenMap.put("appSecret", "R7yJjinikdPhOlTrVgmdS7cblWMMOf99zEJkfPgaTIoDtKGlX51JKueLV725a6S4"); |
|
|
|
|
JSONObject jsonObject = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/api/open/merchant/token", JSON.toJSONString(tokenMap)); |
|
|
|
|
System.out.println(jsonObject.toJSONString()); |
|
|
|
|
log.error(jsonObject.toJSONString()); |
|
|
|
|
if (jsonObject != null && jsonObject.getBoolean("success") == true) { |
|
|
|
|
JSONObject data = jsonObject.getJSONObject("data"); |
|
|
|
|
String token = data.getString("token"); |
|
|
|
|
|
|
|
|
|
Map<String, Object> bodyMap = new HashMap<>(); |
|
|
|
|
Map<String,Object> bodyMap = new HashMap<>(); |
|
|
|
|
bodyMap.put("appId", "jsVpwDoHZfR2rrpjhA"); |
|
|
|
|
bodyMap.put("pageNo", 1); |
|
|
|
|
bodyMap.put("pageSize", 10); |
|
|
|
@ -53,11 +53,13 @@ public class SynchronizeCNPC { |
|
|
|
|
Long date = new Date().getTime(); |
|
|
|
|
String sha256 = encodeBySHA256(signature + JSON.toJSONString(bodyMap) + date); |
|
|
|
|
|
|
|
|
|
Map<String, Object> headerMap = new HashMap<>(); |
|
|
|
|
headerMap.put("sign", sha256); |
|
|
|
|
Map<String,Object> headerMap = new HashMap<>(); |
|
|
|
|
headerMap.put("token", token); |
|
|
|
|
headerMap.put("sign", sha256); |
|
|
|
|
headerMap.put("ts", date); |
|
|
|
|
log.info(HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/sapapi/open/coupon/customerRedeemcodeList", bodyMap, headerMap).toJSONString()); |
|
|
|
|
//map2.put("sign", sha256);
|
|
|
|
|
JSONObject object = HttpsUtils.doPost("https://app.zshcqsy.com/api-provider/sapapi/open/coupon/customerRedeemcodeList", JSON.toJSONString(bodyMap), token, sha256, date); |
|
|
|
|
log.error(object.toJSONString()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|