Commit aee12114 by xugaojun

鸿星尔克定制需求:增加企业校验

parent cd736752
...@@ -25,6 +25,7 @@ import com.gic.wechat.api.dto.qywx.ItemDTO; ...@@ -25,6 +25,7 @@ import com.gic.wechat.api.dto.qywx.ItemDTO;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO; import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
import com.gic.wechat.api.service.qywx.QywxDepartmentApiService; import com.gic.wechat.api.service.qywx.QywxDepartmentApiService;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService; import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.google.common.collect.Sets;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
...@@ -133,6 +134,12 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -133,6 +134,12 @@ public class MessageApiServiceImpl implements MessageApiService {
log.info("通过corpId:【{}】未查询到授权企业,无法处理", dto.getAuthCorpId()); log.info("通过corpId:【{}】未查询到授权企业,无法处理", dto.getAuthCorpId());
return; return;
} }
// 校验适用企业
boolean suitWxEnterpriseIid = checkSuitEnterpriseId(enterprise.getWxEnterpriseId());
if (!suitWxEnterpriseIid) {
log.info("微信企业id:{}, 不适用", enterprise.getWxEnterpriseId());
return;
}
List<TabHaobanWxEnterpriseRelated> relatedList = wxEnterpriseRelatedService.getByWxEnterpriseId(enterprise.getWxEnterpriseId()); List<TabHaobanWxEnterpriseRelated> relatedList = wxEnterpriseRelatedService.getByWxEnterpriseId(enterprise.getWxEnterpriseId());
if (CollectionUtils.isEmpty(relatedList)) { if (CollectionUtils.isEmpty(relatedList)) {
log.info("未查询到企业关联企业 wxEnt"); log.info("未查询到企业关联企业 wxEnt");
...@@ -189,6 +196,11 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -189,6 +196,11 @@ public class MessageApiServiceImpl implements MessageApiService {
return userid.startsWith("5"); return userid.startsWith("5");
} }
private boolean checkSuitEnterpriseId(String wxEnterpriseId) {
Set<String> wxSet = Sets.newHashSet("ca66a01b79474c40b3e7c7f93daf1a3b");
return wxSet.contains(wxEnterpriseId);
}
private void doDealUser(QywxCallBackDTO dto, String enterpriseId, String secret) { private void doDealUser(QywxCallBackDTO dto, String enterpriseId, String secret) {
ClerkQwDTO clerkQwDTO = new ClerkQwDTO(); ClerkQwDTO clerkQwDTO = new ClerkQwDTO();
clerkQwDTO.setEnterpriseId(enterpriseId); clerkQwDTO.setEnterpriseId(enterpriseId);
......
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