Commit cd7b9560 by 徐高华

会员详情

parent 55c76ee1
......@@ -151,6 +151,8 @@ public interface MemberUnionidRelatedApiService {
*/
ExternalUserDTO getCorpSelfExternalUseridInfo(String wxEnterpriseId, String wxUserId, String externalUserId);
ExternalUserDTO getCorpSelfExternalUseridInfoForMember(String wxEnterpriseId, String wxUserId, String externalUserId);
/**
* 添加企微好友关联关系表-无需触达
*
......
......@@ -1370,6 +1370,31 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
@Override
public ExternalUserDTO getCorpSelfExternalUseridInfoForMember(String wxEnterpriseId, String wxUserId,
String externalUserId) {
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
if (qwDTO == null) {
log.info("企业不存在");
return null;
}
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseId, SecretTypeEnum.MEMBER_WAPP.getVal());
if (null == secretSetting) {
log.info("没有配置secret");
return null;
}
String unionIdJson = qywxUserApiService.getCorpSelfExternalUseridInfo(qwDTO.getMemberCorpid(), secretSetting.getSecretVal(), externalUserId);
if (StringUtils.isBlank(unionIdJson)) {
log.info("好友不存在");
return null;
} else if ("1".equals(unionIdJson)) {
log.info("接口调用被限制");
throw new WxApiLimitException("getCorpSelfExternalUseridInfo接口调用被限制");
}
ExternalUserPojo pojo = getExternalUserPojo(unionIdJson, wxUserId, wxEnterpriseId);
return EntityUtil.changeEntityByJSON(ExternalUserDTO.class, pojo);
}
@Override
public ExternalUserDTO getExternalUseridInfo(String wxEnterpriseId, String wxUserId, String externalUserId) {
log.info("查询第三方:wxEnterpriseId:{},wxUserId:{},externalUserId:{}", wxEnterpriseId, wxUserId, externalUserId);
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
......
......@@ -561,7 +561,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
if(qwInfo.needOpenUserIdDk()) {
wxUserId = staffDTO.getWxOpenUseId() ;
}
ExternalUserDTO externalUserDTO = memberUnionidRelatedApiService.getCorpSelfExternalUseridInfo(wxEnterpriseId, wxUserId, externalUserid);
ExternalUserDTO externalUserDTO = memberUnionidRelatedApiService.getCorpSelfExternalUseridInfoForMember(wxEnterpriseId, wxUserId, externalUserid);
if (externalUserDTO == null) {
logger.info("请先添加好友,企业微信未查询到该好友,externalUserid:{}", externalUserid);
return resultResponse(HaoBanErrCode.ERR_11126);
......
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