|
@@ -646,7 +646,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
return result;
|
|
|
}
|
|
|
@Override
|
|
|
- public HttpRespMsg getBatchSearchUserInfo(WxCorpInfo wxCorpInfo, List<String> userNameList)throws Exception{
|
|
|
+ public HttpRespMsg getBatchSearchUserInfo(WxCorpInfo wxCorpInfo, List<String> userNameList ,String cursor)throws Exception{
|
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
|
List<User> userList=new ArrayList<>();
|
|
|
String url = GET_BATCH_SEARCH_USER_INFO.replace("ACCESS_TOKEN",getProviderAccessToken());
|
|
@@ -663,7 +663,9 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
item.put("query_range",1);
|
|
|
item.put("limit",50);
|
|
|
item.put("full_match_field",1);
|
|
|
- item.put("cursor",CURSOR.get("cursor"));
|
|
|
+ if(cursor!=null){
|
|
|
+ item.put("cursor",cursor);
|
|
|
+ }
|
|
|
jsonArray.add(item);
|
|
|
}
|
|
|
jsonObject.put("query_request_list",jsonArray);
|
|
@@ -677,6 +679,8 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
throw new Exception(json.toJSONString());
|
|
|
}
|
|
|
JSONArray resultList = json.getJSONArray("query_result_list");
|
|
|
+ List<String> targetUserNameList=new ArrayList<>();
|
|
|
+ String nextCursor=null;
|
|
|
for (int i = 0; i < resultList.size(); i++) {
|
|
|
User user=new User();
|
|
|
JSONObject item = resultList.getJSONObject(i);
|
|
@@ -696,7 +700,20 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
|
|
|
}
|
|
|
user.setCorpwxUserid(openUseridList.get(0));
|
|
|
userList.add(user);
|
|
|
+ boolean isLast = item.getBoolean("is_last");
|
|
|
+ if(!isLast){
|
|
|
+ nextCursor = item.getString("next_cursor");
|
|
|
+ targetUserNameList.add(userName);
|
|
|
+ }
|
|
|
}
|
|
|
+ if(targetUserNameList.size()>0){
|
|
|
+ HttpRespMsg respMsg = getBatchSearchUserInfo(wxCorpInfo, targetUserNameList,nextCursor);
|
|
|
+ if(!respMsg.code.equals("0")){
|
|
|
+ List<User> targetUserList= (List<User>) respMsg.data;
|
|
|
+ userList.addAll(targetUserList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
msg.data=userList;
|
|
|
return msg;
|