|
|
@@ -42,7 +42,7 @@ public class SYUtils {
|
|
|
* @return
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
- public String getSignature(String xReqNonce,String timestamp) throws IOException {
|
|
|
+ public String getSignature(String xReqNonce,String timestamp,TreeMap<String, String> getParam) throws IOException {
|
|
|
logger.error("====获取签名===进入到了com.kingdee.eas.custom.jiuzhoutong.utils.SYUtils.getSignature=======");
|
|
|
TreeMap<String, String> treeMap = new TreeMap<>();
|
|
|
String version = propt.getProperty("version");//版本
|
|
|
@@ -59,6 +59,9 @@ public class SYUtils {
|
|
|
treeMap.put("appKey", appKey);
|
|
|
treeMap.put("xReqNonce", xReqNonce);
|
|
|
treeMap.put("appSecret", appSecret);
|
|
|
+ if (getParam!=null){
|
|
|
+ treeMap.putAll(getParam);
|
|
|
+ }
|
|
|
StringBuilder mergeStr = new StringBuilder();
|
|
|
for (Map.Entry<String, String> stringStringEntry : treeMap.entrySet()) {
|
|
|
mergeStr.append(stringStringEntry.getValue());
|
|
|
@@ -95,12 +98,12 @@ public class SYUtils {
|
|
|
return signatureResult;
|
|
|
}
|
|
|
|
|
|
- public Map<String,String> getCommonParameter() throws IOException {
|
|
|
+ public Map<String,String> getCommonParameter(TreeMap<String, String> getParam) throws IOException {
|
|
|
String appKey = propt.getProperty("appKey");
|
|
|
String timestamp = String.valueOf(new Date().getTime());
|
|
|
String version = propt.getProperty("version");
|
|
|
String xReqNonce = UUID.randomUUID().toString().replace("-", "");//调用者生成的 UUID(32位),结合时间戳timestamp 防重放
|
|
|
- String signature = this.getSignature(xReqNonce,timestamp);
|
|
|
+ String signature = this.getSignature(xReqNonce,timestamp,getParam);
|
|
|
Map<String,String> parameters = new HashMap<String,String>();
|
|
|
parameters.put("appKey",appKey);
|
|
|
parameters.put("timestamp",timestamp);
|
|
|
@@ -151,4 +154,5 @@ public class SYUtils {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|