|
@@ -85,20 +85,24 @@ public class QyWxAccessTokenUtil {
|
|
|
String url ="";
|
|
String url ="";
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- //token未过期使用缓存的token
|
|
|
|
|
- long currentTiem = new Date().getTime();
|
|
|
|
|
- if(this.accessToken!=null &&(currentTiem-createTime)<(expires*1000)){
|
|
|
|
|
- log.info("本身的token为{}",this.accessToken);
|
|
|
|
|
- return this.accessToken;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// //token未过期使用缓存的token
|
|
|
|
|
+// long currentTiem = new Date().getTime();
|
|
|
|
|
+// if(this.accessToken!=null &&(currentTiem-createTime)<(expires*1000)){
|
|
|
|
|
+// log.info("本身的token为{}",this.accessToken);
|
|
|
|
|
+// return this.accessToken;
|
|
|
|
|
+// }
|
|
|
//获取请求地址
|
|
//获取请求地址
|
|
|
if (StringUtils.isEmpty(userType)){
|
|
if (StringUtils.isEmpty(userType)){
|
|
|
|
|
+ log.info("好邦手发送");
|
|
|
url = QyWxServiceUrl.ACCESS_TOKEN_URL.getformatUrl(corpid, corpsecret);
|
|
url = QyWxServiceUrl.ACCESS_TOKEN_URL.getformatUrl(corpid, corpsecret);
|
|
|
}else if ("1".equals(userType)){
|
|
}else if ("1".equals(userType)){
|
|
|
|
|
+ log.info("经销商发送");
|
|
|
url = QyWxServiceUrl.ACCESS_TOKEN_URL.getformatUrl(corpid, ssbCorpsecret);
|
|
url = QyWxServiceUrl.ACCESS_TOKEN_URL.getformatUrl(corpid, ssbCorpsecret);
|
|
|
}else if ("3".equals(userType)){
|
|
}else if ("3".equals(userType)){
|
|
|
|
|
+ log.info("金牌店发送");
|
|
|
url = QyWxServiceUrl.ACCESS_TOKEN_URL.getformatUrl(corpid, jpdCorpsecret);
|
|
url = QyWxServiceUrl.ACCESS_TOKEN_URL.getformatUrl(corpid, jpdCorpsecret);
|
|
|
}else if ("2".equals(userType)){
|
|
}else if ("2".equals(userType)){
|
|
|
|
|
+ log.info("服务商发送");
|
|
|
url = QyWxServiceUrl.ACCESS_TOKEN_URL.getformatUrl(corpid, fwsCorpsecret);
|
|
url = QyWxServiceUrl.ACCESS_TOKEN_URL.getformatUrl(corpid, fwsCorpsecret);
|
|
|
}
|
|
}
|
|
|
log.info("getAccessToken url:{} ", url);
|
|
log.info("getAccessToken url:{} ", url);
|
|
@@ -209,8 +213,18 @@ public class QyWxAccessTokenUtil {
|
|
|
return corpsecret;
|
|
return corpsecret;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public String getAgentId() {
|
|
|
|
|
- return agentId;
|
|
|
|
|
|
|
+ public String getAgentId(String userType) {
|
|
|
|
|
+ if (StringUtils.isEmpty(userType)){
|
|
|
|
|
+ return agentId;
|
|
|
|
|
+ }else if ("1".equals(userType)){
|
|
|
|
|
+ return ssbAgentId;
|
|
|
|
|
+ }else if ("3".equals(userType)){
|
|
|
|
|
+ return jpdAgentId;
|
|
|
|
|
+ }else if ("2".equals(userType)){
|
|
|
|
|
+ return fwsAgentId;
|
|
|
|
|
+ }else {
|
|
|
|
|
+ return agentId;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void setAgentId(String agentId) {
|
|
public void setAgentId(String agentId) {
|