|
@@ -475,8 +475,8 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
|
|
|
//获取企业管理员列表
|
|
//获取企业管理员列表
|
|
@Override
|
|
@Override
|
|
- public List<User> getAdminList(Integer companyId)throws Exception{
|
|
|
|
- List<User> userList=new ArrayList<>();
|
|
|
|
|
|
+ public List<String> getAdminOpenIdList(Integer companyId)throws Exception{
|
|
|
|
+ List<String> userOpenIdList=new ArrayList<>();
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
|
|
String url=GET_ADMIN_LIST.replaceAll("SUITE_ACCESS_TOKEN",getSuiteAccessToken());
|
|
String url=GET_ADMIN_LIST.replaceAll("SUITE_ACCESS_TOKEN",getSuiteAccessToken());
|
|
HttpHeaders headers = new HttpHeaders();
|
|
HttpHeaders headers = new HttpHeaders();
|
|
@@ -490,19 +490,19 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
if (responseEntity.getStatusCode() == HttpStatus.OK) {
|
|
if (responseEntity.getStatusCode() == HttpStatus.OK) {
|
|
String resp = responseEntity.getBody();
|
|
String resp = responseEntity.getBody();
|
|
JSONObject json = JSONObject.parseObject(resp);
|
|
JSONObject json = JSONObject.parseObject(resp);
|
|
|
|
+ System.out.println(json);
|
|
if (json.getIntValue("errcode") == 0) {
|
|
if (json.getIntValue("errcode") == 0) {
|
|
JSONArray adminList = json.getJSONArray("admin");
|
|
JSONArray adminList = json.getJSONArray("admin");
|
|
for (int i = 0; i < adminList.size(); i++) {
|
|
for (int i = 0; i < adminList.size(); i++) {
|
|
JSONObject object = adminList.getJSONObject(i);
|
|
JSONObject object = adminList.getJSONObject(i);
|
|
- String userid = String.valueOf(object.get("userid"));
|
|
|
|
- User user = userMapper.selectOne(new QueryWrapper<User>().eq("corpwx_userid", userid));
|
|
|
|
- userList.add(user);
|
|
|
|
|
|
+ String openUserid = String.valueOf(object.get("open_userid"));
|
|
|
|
+ userOpenIdList.add(openUserid);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
throw new Exception(json.toJSONString());
|
|
throw new Exception(json.toJSONString());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return userList;
|
|
|
|
|
|
+ return userOpenIdList;
|
|
}
|
|
}
|
|
|
|
|
|
//获取企业AccessToken
|
|
//获取企业AccessToken
|