|
@@ -31,6 +31,8 @@ public class FanWeiUtils {
|
|
|
String param_code_url = mapentity.get("getcode");
|
|
|
String param_token_url = mapentity.get("gettoken");
|
|
|
String post_getspeaker_url = mapentity.get("getspeaker");
|
|
|
+ String param_secretkey = mapentity.get("secret_key");
|
|
|
+ String param_operator = mapentity.get("operator");
|
|
|
|
|
|
if( StringUtils.isEmpty(param_corpid) || StringUtils.isEmpty(param_app_secret)
|
|
|
|| StringUtils.isEmpty(param_code_url) || StringUtils.isEmpty(param_token_url)
|
|
@@ -92,8 +94,13 @@ public class FanWeiUtils {
|
|
|
speakerUrl.append(post_url);
|
|
|
speakerUrl.append("?access_token=");
|
|
|
speakerUrl.append(tokenString);
|
|
|
- String speakerJsonData = getSpeakerData();
|
|
|
- logger.info("请求SAP 接口:" + speakerUrl.toString() );
|
|
|
+ speakerUrl.append("&secret_key=");
|
|
|
+ speakerUrl.append(param_secretkey);
|
|
|
+
|
|
|
+ String speakerJsonData = getSpeakerData(param_operator);
|
|
|
+ logger.info("请求SAP 接口:" + speakerUrl.toString());
|
|
|
+ logger.info("请求SAP data:" + speakerJsonData);
|
|
|
+
|
|
|
String result = KHttpClientUtils.postjson(speakerUrl.toString(), header, speakerJsonData);
|
|
|
logger.info("请求SAP Speaker Return:" + result);
|
|
|
return result;
|
|
@@ -107,7 +114,7 @@ public class FanWeiUtils {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static String getSpeakerData()
|
|
|
+ public static String getSpeakerData(String operator)
|
|
|
{
|
|
|
// 构建 requestHead 对象
|
|
|
JSONObject requestHead = new JSONObject();
|
|
@@ -120,7 +127,7 @@ public class FanWeiUtils {
|
|
|
|
|
|
// 构建 header 对象
|
|
|
JSONObject header = new JSONObject();
|
|
|
- header.put("operator", "037267");
|
|
|
+ header.put("operator", operator);
|
|
|
|
|
|
// 构建 datajson 对象
|
|
|
JSONObject datajsonParent = new JSONObject();
|