Commit c7608810 by 徐高华

Merge branch 'feature/xgh/20241月迭代' into 'developer'

自建通讯录回调

See merge request !1679
parents 4394dee6 28324b54
...@@ -165,6 +165,20 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -165,6 +165,20 @@ public class MessageApiServiceImpl implements MessageApiService {
} }
} }
private String getWxEnterpriseId(String corpid) {
String wxEnterpriseId = null ;
TabHaobanWxApplication wxApplication = wxApplicationService.selectByCorpId(corpid);
if (null == wxApplication) {
TabHaobanWxEnterprise wxEnterprise = this.wxEnterpriseService.getEnterpriseBycorpId(corpid) ;
if(null != wxEnterprise) {
wxEnterpriseId = wxEnterprise.getWxEnterpriseId() ;
}
}else {
wxEnterpriseId = wxApplication.getWxEnterpriseId();
}
return wxEnterpriseId ;
}
@Override @Override
public void dealWxMessage(String param) { public void dealWxMessage(String param) {
QywxCallBackDTO dto = JSON.parseObject(param, QywxCallBackDTO.class); QywxCallBackDTO dto = JSON.parseObject(param, QywxCallBackDTO.class);
...@@ -174,12 +188,11 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -174,12 +188,11 @@ public class MessageApiServiceImpl implements MessageApiService {
log.info("通讯录只处理自建应用回调 dto={}", JSON.toJSONString(param)); log.info("通讯录只处理自建应用回调 dto={}", JSON.toJSONString(param));
return; return;
} }
TabHaobanWxApplication wxApplication = wxApplicationService.selectByCorpId(dto.getAuthCorpId()); String wxEnterpriseId = this.getWxEnterpriseId(dto.getAuthCorpId()) ;
if (Objects.isNull(wxApplication)) { if(null == wxEnterpriseId) {
log.info("授权企业不存在,{}", dto.getAuthCorpId()); log.info("授权企业不存在,{}", dto.getAuthCorpId());
return; return;
} }
String wxEnterpriseId = wxApplication.getWxEnterpriseId();
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ; WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ;
if(qwDTO.isSelf() && dto.getSelfCallback()==0) { if(qwDTO.isSelf() && dto.getSelfCallback()==0) {
log.info("非自建应用回调"); log.info("非自建应用回调");
...@@ -448,12 +461,11 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -448,12 +461,11 @@ public class MessageApiServiceImpl implements MessageApiService {
String authCorpId = qywxCallBackDTO.getAuthCorpId(); String authCorpId = qywxCallBackDTO.getAuthCorpId();
DepartmentDTO departmentDTO = new DepartmentDTO(); DepartmentDTO departmentDTO = new DepartmentDTO();
departmentDTO.setIsStore(0); departmentDTO.setIsStore(0);
TabHaobanWxApplication wxApplication = wxApplicationService.selectByCorpId(authCorpId); String wxEnterpriseId = this.getWxEnterpriseId(authCorpId) ;
if (Objects.isNull(wxApplication)) { if(null == wxEnterpriseId) {
log.info("授权企业不存在,{}", qywxCallBackDTO.getAuthCorpId()); log.info("授权企业不存在,{}", authCorpId);
return; return;
} }
String wxEnterpriseId = wxApplication.getWxEnterpriseId();
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ; WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ;
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseId, SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseId,
SecretTypeEnum.CUSTOMIZED_APP.getVal()); SecretTypeEnum.CUSTOMIZED_APP.getVal());
......
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