Commit 28324b54 by 徐高华

自建通讯录回调

parent 03ce651e
...@@ -154,6 +154,20 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -154,6 +154,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);
...@@ -163,12 +177,11 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -163,12 +177,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("非自建应用回调");
...@@ -437,12 +450,11 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -437,12 +450,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