Commit 03c21832 by qwmqiuwenmin

fix

parent 415bd64d
......@@ -3,6 +3,8 @@ package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
import org.springframework.util.StringUtils;
public class WxEnterpriseDTO implements Serializable {
private String wxEnterpriseId;
......@@ -63,6 +65,12 @@ public class WxEnterpriseDTO implements Serializable {
private String contactSecret;
private Boolean wxSecretKeyFlag;
private Boolean memberSecretFlag;
private Boolean contactSecretFlag;
private Date wxSecretKeyLastTime;
private Date contactSecretLastTime;
......@@ -357,6 +365,30 @@ public class WxEnterpriseDTO implements Serializable {
this.memberSecretLastTime = memberSecretLastTime;
}
public Boolean getWxSecretKeyFlag() {
return !StringUtils.isEmpty(this.wxSecretKey);
}
public void setWxSecretKeyFlag(Boolean wxSecretKeyFlag) {
this.wxSecretKeyFlag = wxSecretKeyFlag;
}
public Boolean getMemberSecretFlag() {
return !StringUtils.isEmpty(this.memberSecret);
}
public void setMemberSecretFlag(Boolean memberSecretFlag) {
this.memberSecretFlag = memberSecretFlag;
}
public Boolean getContactSecretFlag() {
return !StringUtils.isEmpty(this.contactSecret);
}
public void setContactSecretFlag(Boolean contactSecretFlag) {
this.contactSecretFlag = contactSecretFlag;
}
......
......@@ -399,35 +399,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
List<TabHaobanWxEnterpriseRelated> list = wxEnterpriseRelatedService.getByWxEnterpriseId(wxEnterprise.getWxEnterpriseId());
String unionIdJson = qywxUserApiService.getCorpSelfExternalUseridInfo(wxEnterprise.getCorpid(), wxEnterprise.getWxSecretKey(), selfExternalUserId);
String wxRes = qywxUserApiService.listExternalUserid(wxEnterprise.getCorpid(), config.getSuiteId(), userId1);
JSONObject wxJson = JSON.parseObject(wxRes);
String externalUserId = selfExternalUserId;
if("0".equals(wxJson.getString("errcode"))){
String external_userid = wxJson.getString("external_userid");
JSONArray jsonArr = wxJson.getJSONArray(external_userid);
for (Object externalUserid : jsonArr) {
String uJ = qywxUserApiService.getExternalUseridInfo(wxEnterprise.getCorpid(), config.getSuiteId(), externalUserid.toString());
if(StringUtils.isNotBlank(uJ)){
JSONObject jo = JSON.parseObject(unionIdJson);
String external_contact = jo.getString("external_contact");
String uj_follow_user = jo.getString("follow_user");
if(StringUtils.isNotBlank(uj_follow_user)){
JSONArray j = JSON.parseArray(uj_follow_user);
String uj_userId = "";
for (Object object : j) {
String followJson = JSON.toJSONString(object);
JSONObject follow = JSON.parseObject(followJson);
uj_userId = follow.getString("userid");
if(uj_userId.equals(userId1)){
}
}
}
}
}
}
MemberUnionidRelatedDTO dto = new MemberUnionidRelatedDTO();
log.info("【新增外部联系人回调】unionIdJson={}",JSON.toJSONString(unionIdJson));
String unionId = "";
String name = "";
......@@ -461,6 +432,42 @@ 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 wxName = "";
for (Object externalUserid : jsonArr) {
String uJ = qywxUserApiService.getExternalUseridInfo(wxEnterprise.getCorpid(), config.getSuiteId(), externalUserid.toString());
if(StringUtils.isNotBlank(uJ)){
JSONObject jo = JSON.parseObject(unionIdJson);
String external_contact = jo.getString("external_contact");
String uj_follow_user = jo.getString("follow_user");
if(StringUtils.isNotBlank(external_contact)){
JSONObject jt = JSON.parseObject(external_contact);
externalUserId = jt.getString("external_userid");
wxName = EmojiFilterUtil.filterEmojiLast(jt.getString("name"), true);
}
if(StringUtils.isNotBlank(uj_follow_user)){
JSONArray j = JSON.parseArray(uj_follow_user);
String uj_userId = "";
for (Object object : j) {
String followJson = JSON.toJSONString(object);
JSONObject follow = JSON.parseObject(followJson);
uj_userId = follow.getString("userid");
if(uj_userId.equals(userId1) && createTime.equals(follow.getString("createtime")) && name.equals(wxName)){
dto.setExternalUserid(externalUserId);
}
}
}
}
}
}
for (TabHaobanWxEnterpriseRelated tabHaobanWxEnterpriseRelated : list) {
......
......@@ -100,6 +100,7 @@ public class WxEnterpriseController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1);
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getOne(wxEnterpriseId);
wxEnterpriseDTO.setSmallVersion("免费版");
return resultResponse(HaoBanErrCode.ERR_1,wxEnterpriseDTO);
}
......
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