|
@@ -436,7 +436,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
|
|
|
//获取provider_access_token
|
|
|
private String getProviderAccessToken() {
|
|
|
- if (WeiXinCorpController.SUITE_ACCESS_TOKEN == null || WeiXinCorpController.suiteTokenExpireTime < System.currentTimeMillis()) {
|
|
|
+ if (UserServiceImpl.provider_access_token == null || UserServiceImpl.providerTokenExpireTime < System.currentTimeMillis()) {
|
|
|
//失效了,需要重新获取
|
|
|
String url = "https://qyapi.weixin.qq.com/cgi-bin/service/get_provider_token";
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
@@ -457,7 +457,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
UserServiceImpl.provider_access_token = obj.getString("provider_access_token");
|
|
|
UserServiceImpl.providerTokenExpireTime = System.currentTimeMillis() + obj.getIntValue("expires_in")*1000;
|
|
|
}else{
|
|
|
- System.err.println("token获取失败");
|
|
|
+ System.err.println("====================token获取失败======================");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -499,12 +499,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
user = jsonArray.toArray();
|
|
|
}
|
|
|
}else{
|
|
|
- System.err.println("通讯录查询请求无userid列表");
|
|
|
+ System.err.println("==================通讯录查询请求无userid列表===================");
|
|
|
}
|
|
|
}else {
|
|
|
- System.err.println("通讯录查询请求失败");
|
|
|
+ System.err.println("===================通讯录查询请求失败=================");
|
|
|
}
|
|
|
}
|
|
|
+ }else {
|
|
|
+ System.out.println("=============token查询失败=================");
|
|
|
}
|
|
|
return user;
|
|
|
}
|
|
@@ -520,14 +522,16 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|
|
data.put("total",0);
|
|
|
//当企业开启了微信通讯录的情况下
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(keyword) && wxCorpInfo!=null && wxCorpInfo.getSaasSyncContact()==1 && departmentId == -1){
|
|
|
+ System.out.println("====================开始查询通讯录名单======================");
|
|
|
Object[] users = getOpenId(wxCorpInfo.getCorpid(), keyword);
|
|
|
if (users!=null){
|
|
|
- System.err.println("查询到的users列表为:"+users.toString());
|
|
|
+ System.err.println("=========================查询到的users列表为:"+users[0]);
|
|
|
List<User> realUser = userMapper.selectList(new QueryWrapper<User>().in("corpwx_userid", users));
|
|
|
data.put("records",realUser);
|
|
|
return httpRespMsg;
|
|
|
}else {
|
|
|
- System.err.println("没有查询到数据");
|
|
|
+ System.err.println("======================user列表没有查询到数据===========================");
|
|
|
+ System.err.println("======================httpRespMsg返回空集合===========================");
|
|
|
ArrayList<Object> records = new ArrayList<>();
|
|
|
data.put("records",records);
|
|
|
return httpRespMsg;
|