|
|
@@ -310,13 +310,13 @@ public class RequestSTKServiceImpl implements RequestSTKService {
|
|
|
String timestamp = Long.toString(System.currentTimeMillis());
|
|
|
|
|
|
//应用id
|
|
|
- /*String appid = "bc81efc8_b2c6_4670_818e_e2710a45";
|
|
|
+ String appid = "bc81efc8_b2c6_4670_818e_e2710a45";
|
|
|
|
|
|
//应用key
|
|
|
String appkey = "9a1ae28bc9104deb86f74575acc1c2d6";
|
|
|
|
|
|
//接口代码
|
|
|
- String apiCode = "18c60d85eb0646a080341b64310109f1";*/
|
|
|
+ String apiCode = "18c60d85eb0646a080341b64310109f1";
|
|
|
|
|
|
//每一条数据在这里构造,根据实际情况修改
|
|
|
JSONObject request=new JSONObject(4);
|
|
|
@@ -330,10 +330,10 @@ public class RequestSTKServiceImpl implements RequestSTKService {
|
|
|
request.put("CREATED_ORG","HRORGI0000000001");
|
|
|
request.put("ISTEMPORARY","0");
|
|
|
|
|
|
- request.put("MDM_CODE",null);
|
|
|
+ /*request.put("MDM_CODE",null);
|
|
|
request.put("CREAT_AT","2024-07-04 17:11:43");
|
|
|
request.put("UPDATE_AT","2024-07-04 17:11:43");
|
|
|
- request.put("SERIAL","23468156486151");
|
|
|
+ request.put("SERIAL","23468156486151");*/
|
|
|
|
|
|
|
|
|
//param参数构造 并传入你构造的每一条数据参数,此处例:1条
|
|
|
@@ -344,21 +344,21 @@ public class RequestSTKServiceImpl implements RequestSTKService {
|
|
|
String content = requestparam.toString();
|
|
|
|
|
|
//加签方法第一个参数
|
|
|
- StringBuilder signBuilder = new StringBuilder("appid").append("=").append(STK_APP_ID).append("&")
|
|
|
+ StringBuilder signBuilder = new StringBuilder("appid").append("=").append(appid).append("&")
|
|
|
.append(content).append("&")
|
|
|
.append("timestamp").append("=").append(timestamp).append("&")
|
|
|
- .append("key").append("=").append(STK_APP_KEY);
|
|
|
+ .append("key").append("=").append(appkey);
|
|
|
|
|
|
//加签
|
|
|
- String sign = STKSignUtil.HMACSHA256(signBuilder.toString(),STK_APP_KEY);
|
|
|
+ String sign = STKSignUtil.HMACSHA256(signBuilder.toString(),appkey);
|
|
|
|
|
|
System.out.println("原始:"+signBuilder);
|
|
|
System.out.println("签名:"+sign);
|
|
|
System.out.println("content:"+content);
|
|
|
|
|
|
//请求数据(接口地址根据测试环境与正式环境变更)
|
|
|
- String body = HttpRequest.post("http://10.67.2.187/api/oapigw/api/oapisvc/automicUpsertApi/"+SAVE_OR_UPDATE_REQUEST_CODE)
|
|
|
- .header("appid",STK_APP_ID) //请求头
|
|
|
+ String body = HttpRequest.post("http://10.67.2.187/api/oapigw/api/oapisvc/automicUpsertApi/"+apiCode)
|
|
|
+ .header("appid",appid) //请求头
|
|
|
.header("timestamp", timestamp)
|
|
|
.header("sign", sign)
|
|
|
.header("Content-Type", "application/json")
|