Commit e18875b6 by fudahua

Merge remote-tracking branch 'origin/developer' into developer

parents fde36f5c 45134798
......@@ -433,12 +433,10 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
String wxRes = qywxUserApiService.listExternalUserid(wxEnterprise.getCorpid(), config.getSuiteId(), userId1);
JSONObject wxJson = JSON.parseObject(wxRes);
String externalUserId = "";
MemberUnionidRelatedDTO dto = new MemberUnionidRelatedDTO();
if("0".equals(wxJson.getString("errcode"))){
String external_userid = wxJson.getString("external_userid");
JSONArray jsonArr = wxJson.getJSONArray(external_userid);
String externalUserId = "";
if(StringUtils.isNotBlank(wxRes)){
JSONArray jsonArr = JSON.parseArray(wxRes);
String wxName = "";
for (Object externalUserid : jsonArr) {
String uJ = qywxUserApiService.getExternalUseridInfo(wxEnterprise.getCorpid(), config.getSuiteId(), externalUserid.toString());
......@@ -532,7 +530,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
dto.setMemberId(dto.getMemberId());
//更新对外联系人id
dto.setSelfExternalUserid(selfExternalUserId);
memberUnionRelatedService.update(exsitDTO);
uuid = memberUnionRelatedService.addMemberUnionidRelated(dto);
}else{
return "";
......@@ -570,25 +567,23 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
@Override
public void freshWxFrend(String wxEnterpriseId, String wxUserId) {
log.info("【刷下好友】wxUserId={}",wxUserId);
WxEnterpriseDTO enterprise = wxEnterpriseService.selectById(wxEnterpriseId);
String res = qywxUserApiService.listSelfExternalUserid(enterprise.getCorpid(), enterprise.getWxSecretKey(), wxUserId);
log.info("【刷下好友】res={}",res);
if(StringUtils.isBlank(res)){
return;
}
JSONObject json = JSON.parseObject(res);
if("0".equals(json.getString("errcode"))){
String external_userid = json.getString("external_userid");
JSONArray jsonArr = json.getJSONArray(external_userid);
List<MemberUnionidRelatedDTO> list = this.getByWxUserIdAndWxEnterpriseId(wxUserId, wxEnterpriseId);
List<String> externalUserIdList = list.stream().map(student->student.getExternalUserid())
.collect(Collectors.toList());
for (Object object : jsonArr) {
if(externalUserIdList.contains(object.toString())){
continue;
}else{
//String string = qywxUserApiService.getCorpSelfExternalUseridInfo(enterprise.getCorpid(), enterprise.getWxSecretKey(), object.toString());
this.add(wxEnterpriseId, object.toString(), wxUserId);
}
JSONArray jsonArr = JSON.parseArray(res);
List<MemberUnionidRelatedDTO> list = this.getByWxUserIdAndWxEnterpriseId(wxUserId, wxEnterpriseId);
List<String> externalUserIdList = list.stream().map(student->student.getExternalUserid())
.collect(Collectors.toList());
for (Object object : jsonArr) {
if(externalUserIdList.contains(object.toString())){
continue;
}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