Commit 1067c83a by qwmqiuwenmin

fix

parent d6577d9a
...@@ -433,12 +433,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -433,12 +433,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
} }
String wxRes = qywxUserApiService.listExternalUserid(wxEnterprise.getCorpid(), config.getSuiteId(), userId1); String wxRes = qywxUserApiService.listExternalUserid(wxEnterprise.getCorpid(), config.getSuiteId(), userId1);
JSONObject wxJson = JSON.parseObject(wxRes);
String externalUserId = "";
MemberUnionidRelatedDTO dto = new MemberUnionidRelatedDTO(); MemberUnionidRelatedDTO dto = new MemberUnionidRelatedDTO();
if("0".equals(wxJson.getString("errcode"))){ String externalUserId = "";
String external_userid = wxJson.getString("external_userid"); if(StringUtils.isNotBlank(wxRes)){
JSONArray jsonArr = wxJson.getJSONArray(external_userid); JSONArray jsonArr = JSON.parseArray(wxRes);
String wxName = ""; String wxName = "";
for (Object externalUserid : jsonArr) { for (Object externalUserid : jsonArr) {
String uJ = qywxUserApiService.getExternalUseridInfo(wxEnterprise.getCorpid(), config.getSuiteId(), externalUserid.toString()); String uJ = qywxUserApiService.getExternalUseridInfo(wxEnterprise.getCorpid(), config.getSuiteId(), externalUserid.toString());
...@@ -577,20 +575,16 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -577,20 +575,16 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
if(StringUtils.isBlank(res)){ if(StringUtils.isBlank(res)){
return; return;
} }
JSONObject json = JSON.parseObject(res); JSONArray jsonArr = JSON.parseArray(res);
if("0".equals(json.getString("errcode"))){ List<MemberUnionidRelatedDTO> list = this.getByWxUserIdAndWxEnterpriseId(wxUserId, wxEnterpriseId);
String external_userid = json.getString("external_userid"); List<String> externalUserIdList = list.stream().map(student->student.getExternalUserid())
JSONArray jsonArr = json.getJSONArray(external_userid); .collect(Collectors.toList());
List<MemberUnionidRelatedDTO> list = this.getByWxUserIdAndWxEnterpriseId(wxUserId, wxEnterpriseId); for (Object object : jsonArr) {
List<String> externalUserIdList = list.stream().map(student->student.getExternalUserid()) if(externalUserIdList.contains(object.toString())){
.collect(Collectors.toList()); continue;
for (Object object : jsonArr) { }else{
if(externalUserIdList.contains(object.toString())){ //String string = qywxUserApiService.getCorpSelfExternalUseridInfo(enterprise.getCorpid(), enterprise.getWxSecretKey(), object.toString());
continue; this.add(wxEnterpriseId, object.toString(), wxUserId);
}else{
//String string = qywxUserApiService.getCorpSelfExternalUseridInfo(enterprise.getCorpid(), enterprise.getWxSecretKey(), object.toString());
this.add(wxEnterpriseId, object.toString(), wxUserId);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment